mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
code review
This commit is contained in:
parent
1d94536299
commit
e3a4c65100
@ -807,7 +807,7 @@ SelectionTab::CMapInfoTooltipBox::CMapInfoTooltipBox(std::string text, ResourceI
|
||||
: CWindowObject(BORDERED | RCLICK_POPUP)
|
||||
{
|
||||
drawPlayerElements = tabType == ESelectionScreen::newGame;
|
||||
renderImage = tabType == ESelectionScreen::newGame;
|
||||
renderImage = tabType == ESelectionScreen::newGame && settings["lobby"]["mapPreview"].Bool();
|
||||
|
||||
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
|
||||
|
||||
@ -819,9 +819,12 @@ SelectionTab::CMapInfoTooltipBox::CMapInfoTooltipBox(std::string text, ResourceI
|
||||
if(renderImage && mapLayerImages.size() > 1)
|
||||
pos.w += IMAGE_SIZE + BORDER;
|
||||
|
||||
auto drawLabel = [&]() {
|
||||
label = std::make_shared<CTextBox>(text, Rect(BORDER, BORDER, pos.w - 2 * BORDER, 350), 0, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE);
|
||||
if(!label->slider)
|
||||
label->resize(label->label->textSize);
|
||||
};
|
||||
drawLabel();
|
||||
|
||||
pos.h = BORDER + label->label->textSize.y + BORDER;
|
||||
if(renderImage)
|
||||
@ -829,10 +832,7 @@ SelectionTab::CMapInfoTooltipBox::CMapInfoTooltipBox(std::string text, ResourceI
|
||||
backgroundTexture = std::make_shared<CFilledTexture>("DIBOXBCK", pos);
|
||||
updateShadow();
|
||||
|
||||
// TODO: hacky redraw
|
||||
label = std::make_shared<CTextBox>(text, Rect(BORDER, BORDER, pos.w-2*BORDER, 350), 0, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE);
|
||||
if(!label->slider)
|
||||
label->resize(label->label->textSize);
|
||||
drawLabel();
|
||||
|
||||
if(renderImage)
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
{
|
||||
"type" : "object",
|
||||
"$schema" : "http://json-schema.org/draft-04/schema",
|
||||
"required" : [ "general", "video", "adventure", "battle", "input", "server", "logging", "launcher", "gameTweaks" ],
|
||||
"required" : [ "general", "video", "adventure", "battle", "input", "server", "logging", "launcher", "lobby", "gameTweaks" ],
|
||||
"definitions" : {
|
||||
"logLevelEnum" : {
|
||||
"type" : "string",
|
||||
@ -526,6 +526,18 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"lobby" : {
|
||||
"type" : "object",
|
||||
"additionalProperties" : false,
|
||||
"default" : {},
|
||||
"required" : [ "mapPreview" ],
|
||||
"properties" : {
|
||||
"mapPreview" : {
|
||||
"type" : "boolean",
|
||||
"default" : true
|
||||
}
|
||||
}
|
||||
},
|
||||
"gameTweaks" : {
|
||||
"type" : "object",
|
||||
"default" : {},
|
||||
|
Loading…
Reference in New Issue
Block a user