1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

disable text

This commit is contained in:
Laserlicht
2025-11-06 23:16:57 +01:00
parent 59936017fb
commit 43c66f5086
3 changed files with 32 additions and 0 deletions

View File

@@ -149,6 +149,18 @@ void CLobbyScreen::toggleTab(std::shared_ptr<CIntObject> tab)
GAME->server().sendGuiAction(LobbyGuiAction::OPEN_EXTRA_OPTIONS);
else if(tab == tabBattleOnlyMode)
GAME->server().sendGuiAction(LobbyGuiAction::BATTLE_MODE);
if(tab == tabBattleOnlyMode)
{
buttonStart->block(true);
card->clearSelection();
}
else
{
buttonStart->block(GAME->server().mi == nullptr || GAME->server().isGuest());
card->changeSelection();
}
CSelectionBase::toggleTab(tab);
}

View File

@@ -264,6 +264,7 @@ void InfoCard::changeSelection()
labelLossConditionText->setText(header->defeatMessage.toString());
flagbox->recreate();
labelDifficulty->setText(LIBRARY->generaltexth->arraytxt[142 + vstd::to_underlying(mapInfo->mapHeader->difficulty)]);
iconDifficulty->activate();
iconDifficulty->setSelected(SEL->getCurrentDifficulty());
if(SEL->screenType == ESelectionScreen::loadGame || SEL->screenType == ESelectionScreen::saveGame)
for(auto & button : iconDifficulty->buttons)
@@ -294,6 +295,24 @@ void InfoCard::changeSelection()
}
}
void InfoCard::clearSelection()
{
labelSaveDate->setText("");
mapName->setText("");
mapDescription->setText("");
if(SEL->screenType == ESelectionScreen::campaignList)
return;
labelMapSize->setText("");
labelVictoryConditionText->setText("");
labelLossConditionText->setText("");
iconDifficulty->deactivate();
labelDifficulty->setText("");
labelDifficultyPercent->setText("");
}
void InfoCard::toggleChat()
{
setChat(!showChat);

View File

@@ -129,6 +129,7 @@ public:
InfoCard();
void disableLabelRedraws();
void changeSelection();
void clearSelection();
void toggleChat();
void setChat(bool activateChat);
};