1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Improved General options tab layout presentation

This commit is contained in:
Ivan Savenko 2023-03-04 00:33:16 +02:00
parent 33603f87f3
commit 2f556ccf60
20 changed files with 173 additions and 96 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 902 B

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 399 B

After

Width:  |  Height:  |  Size: 399 B

View File

Before

Width:  |  Height:  |  Size: 460 B

After

Width:  |  Height:  |  Size: 460 B

View File

Before

Width:  |  Height:  |  Size: 529 B

After

Width:  |  Height:  |  Size: 529 B

View File

Before

Width:  |  Height:  |  Size: 602 B

After

Width:  |  Height:  |  Size: 602 B

View File

Before

Width:  |  Height:  |  Size: 628 B

After

Width:  |  Height:  |  Size: 628 B

View File

Before

Width:  |  Height:  |  Size: 713 B

After

Width:  |  Height:  |  Size: 713 B

View File

@ -0,0 +1,10 @@
{
"basepath" : "settingsWindow/",
"images" :
[
{ "frame" : 0, "file" : "button32Normal.png"},
{ "frame" : 1, "file" : "button32PressedSelected.png"},
{ "frame" : 2, "file" : "button32Pressed.png"},
{ "frame" : 3, "file" : "button32NormalSelected.png"}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@ -34,11 +34,15 @@
"vcmi.settingsMainWindow.otherTab.hover" : "Other Settings",
"vcmi.settingsMainWindow.otherTab.help" : "Switches to Other Settings tab - these options do not fit into other categories for various reasons",
"vcmi.systemOptions.videoGroup" : "Video Settings",
"vcmi.systemOptions.audioGroup" : "Audio Settings",
"vcmi.systemOptions.otherGroup" : "Other Settings",
"vcmi.systemOptions.fullscreenButton.hover" : "Fullscreen",
"vcmi.systemOptions.fullscreenButton.help" : "{Fullscreen}\n\n If selected, VCMI will run in fullscreen mode, otherwise VCMI will run in window",
"vcmi.systemOptions.resolutionButton.hover" : "Resolution",
"vcmi.systemOptions.resolutionButton.help" : "{Select resolution}\n\n Change in-game screen resolution. Game restart required to apply new resolution.",
"vcmi.systemOptions.resolutionMenu.hover" : "Select resolution",
"vcmi.systemOptions.resolutionButton.hover" : "{Resolution:} %wx%h",
"vcmi.systemOptions.resolutionButton.help" : "{Select Resolution}\n\n Change in-game screen resolution. Game restart required to apply new resolution.",
"vcmi.systemOptions.resolutionMenu.hover" : "Select Resolution",
"vcmi.systemOptions.resolutionMenu.help" : "Change in-game screen resolution.",
"vcmi.systemOptions.fullscreenFailed" : "{Fullscreen}\n\n Failed to switch to fullscreen mode! Current resolution is not supported by display!",
"vcmi.systemOptions.framerateButton.hover" : "Show FPS",
@ -46,10 +50,10 @@
"vcmi.adventureOptions.numericQuantities.hover" : "Numeric creatures quantities",
"vcmi.adventureOptions.numericQuantities.help" : "{Numeric creatures quantities}\n\n Shows inaccurate enemy creatures quantities in numeric A-B format.",
"vcmi.adventureOptions.forceMovementInfo.hover" : "Always show move info in status bar",
"vcmi.adventureOptions.forceMovementInfo.help" : "{Always show move info in status bar}\n\n Replaces default status bar info with movement points data without need to hold ALT button.",
"vcmi.adventureOptions.showGrid.hover" : "Show grid",
"vcmi.adventureOptions.showGrid.help" : "{Show grid}\n\n Shows grid overlay, showing borders between adventure map tiles.",
"vcmi.adventureOptions.forceMovementInfo.hover" : "Always Show Move Info",
"vcmi.adventureOptions.forceMovementInfo.help" : "{Always Show Move Info}\n\n Replaces default status bar info with movement points data without need to hold ALT button.",
"vcmi.adventureOptions.showGrid.hover" : "Show Grid",
"vcmi.adventureOptions.showGrid.help" : "{Show Grid}\n\n Shows grid overlay, showing borders between adventure map tiles.",
"vcmi.adventureOptions.mapScrollSpeed4.hover": "",
"vcmi.adventureOptions.mapScrollSpeed5.hover": "",
"vcmi.adventureOptions.mapScrollSpeed6.hover": "",
@ -57,28 +61,28 @@
"vcmi.adventureOptions.mapScrollSpeed5.help": "Set map scrolling speed to extremely fast",
"vcmi.adventureOptions.mapScrollSpeed6.help": "Set map scrolling speed to fast, very fast.",
"vcmi.battleOptions.queueSizeLabel.hover": "Queue size (takes effect on next battle)",
"vcmi.battleOptions.queueSizeLabel.hover": "Battle Queue Size",
"vcmi.battleOptions.queueSizeNoneButton.hover": "OFF",
"vcmi.battleOptions.queueSizeNoneButton.help": "Disables visibility of stack queue in battle",
"vcmi.battleOptions.queueSizeAutoButton.hover": "AUTO",
"vcmi.battleOptions.queueSizeAutoButton.help": "Sets queue size depending on game resolution (small if width < 700 pixels, big otherwise)",
"vcmi.battleOptions.queueSizeSmallButton.hover": "SMALL",
"vcmi.battleOptions.queueSizeSmallButton.help": "Sets queue size to small",
"vcmi.battleOptions.queueSizeBigButton.hover": "BIG",
"vcmi.battleOptions.queueSizeNoneButton.help": "Disables visibility of stack queue in battle",
"vcmi.battleOptions.queueSizeAutoButton.help": "Sets queue size depending on game resolution (small if width < 700 pixels, big otherwise)",
"vcmi.battleOptions.queueSizeSmallButton.help": "Sets queue size to small",
"vcmi.battleOptions.queueSizeBigButton.help": "Sets queue size to big (not supported if game resolution width < 700 pixels)",
"vcmi.battleOptions.animationsSpeed4.hover": "4",
"vcmi.battleOptions.animationsSpeed4.hover": "",
"vcmi.battleOptions.animationsSpeed5.hover": "",
"vcmi.battleOptions.animationsSpeed6.hover": "",
"vcmi.battleOptions.animationsSpeed4.help": "Sets animation speed to very fast",
"vcmi.battleOptions.animationsSpeed5.hover": "5",
"vcmi.battleOptions.animationsSpeed5.help": "Sets animation speed to super fast",
"vcmi.battleOptions.animationsSpeed6.hover": "6",
"vcmi.battleOptions.animationsSpeed6.help": "Sets animation speed to extremely fast",
"vcmi.battleOptions.skipBattleIntroMusic.hover": "Skip intro music",
"vcmi.battleOptions.skipBattleIntroMusic.help": "{Skip intro music}\n\n Skip short music that plays at beginning of each battle before action starts. Can also be skipped by pressing ESC key.",
"vcmi.battleOptions.skipBattleIntroMusic.hover": "Skip Intro Music",
"vcmi.battleOptions.skipBattleIntroMusic.help": "{Skip Intro Music}\n\n Skip short music that plays at beginning of each battle before action starts. Can also be skipped by pressing ESC key.",
"vcmi.otherOptions.availableCreaturesAsDwellingLabel.hover" : "Show available creatures in town summary",
"vcmi.otherOptions.availableCreaturesAsDwellingLabel.help" : "{Show available creatures in town summary}\n\n Shows creatures available to purchase instead of their growth in town summary (bottom-left corner).",
"vcmi.otherOptions.compactTownCreatureInfo.hover": "Compact creature info in town summary",
"vcmi.otherOptions.compactTownCreatureInfo.help": "{Compact creature info in town summary}\n\n Smaller town creatures information in town summary.",
"vcmi.otherOptions.availableCreaturesAsDwellingLabel.hover" : "Show Available Creatures in Town",
"vcmi.otherOptions.availableCreaturesAsDwellingLabel.help" : "{Show Available Creatures in Town}\n\n Shows creatures available to purchase instead of their growth in town summary (bottom-left corner).",
"vcmi.otherOptions.compactTownCreatureInfo.hover": "Compact Creature Info in Town",
"vcmi.otherOptions.compactTownCreatureInfo.help": "{Compact Creature Info in Town}\n\n Smaller town creatures information in town summary.",
"vcmi.townHall.missingBase" : "Base building %s must be built first",
"vcmi.townHall.noCreaturesToRecruit" : "There are no creatures to recruit!",

View File

@ -19,8 +19,7 @@
#include "../../widgets/Buttons.h"
#include "../../widgets/TextControls.h"
BattleOptionsTab::BattleOptionsTab(BattleInterface * owner):
InterfaceObjectConfigurable()
BattleOptionsTab::BattleOptionsTab(BattleInterface * owner)
{
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
@ -45,9 +44,9 @@ BattleOptionsTab::BattleOptionsTab(BattleInterface * owner):
{
showQueueChangedCallback(value, owner);
});
addCallback("queueSizeChanged", [this](int value)
addCallback("queueSizeChanged", [this, owner](int value)
{
queueSizeChangedCallback(value);
queueSizeChangedCallback(value, owner);
});
addCallback("skipBattleIntroMusicChanged", [this](bool value)
{
@ -155,11 +154,19 @@ void BattleOptionsTab::showQueueChangedCallback(bool value, BattleInterface * pa
}
}
void BattleOptionsTab::queueSizeChangedCallback(int value)
void BattleOptionsTab::queueSizeChangedCallback(int value, BattleInterface * parentBattleInterface)
{
if (value == -1)
{
showQueueChangedCallback(false, parentBattleInterface);
return;
}
std::string stringifiedValue = getQueueSizeStringFromId(value);
Settings size = settings.write["battle"]["queueSize"];
size->String() = stringifiedValue;
showQueueChangedCallback(true, parentBattleInterface);
}
void BattleOptionsTab::skipBattleIntroMusicChangedCallback(bool value)

View File

@ -22,12 +22,12 @@ private:
int getAnimSpeed() const;
int getQueueSizeId() const;
std::string getQueueSizeStringFromId(int value) const;
void viewGridChangedCallback(bool value, BattleInterface * parentBattleInterface = nullptr);
void movementShadowChangedCallback(bool value, BattleInterface * parentBattleInterface = nullptr);
void viewGridChangedCallback(bool value, BattleInterface * parentBattleInterface);
void movementShadowChangedCallback(bool value, BattleInterface * parentBattleInterface);
void mouseShadowChangedCallback(bool value);
void animationSpeedChangedCallback(int value);
void showQueueChangedCallback(bool value, BattleInterface * parentBattleInterface = nullptr);
void queueSizeChangedCallback(int value);
void showQueueChangedCallback(bool value, BattleInterface * parentBattleInterface);
void queueSizeChangedCallback(int value, BattleInterface * parentBattleInterface);
void skipBattleIntroMusicChangedCallback(bool value);
public:
BattleOptionsTab(BattleInterface * owner = nullptr);

View File

@ -39,7 +39,12 @@ static void setBoolSetting(std::string group, std::string field, bool value)
static std::string resolutionToString(int w, int h)
{
return std::to_string(w) + 'x' + std::to_string(h);
auto string = CGI->generaltexth->translate("vcmi.systemOptions.resolutionButton.hover");
boost::replace_all(string, "%w", std::to_string(w));
boost::replace_all(string, "%h", std::to_string(h));
return string;
}
GeneralOptionsTab::GeneralOptionsTab()
@ -173,11 +178,7 @@ void GeneralOptionsTab::setGameResolution(int index)
gameRes["width"].Float() = resolution.x;
gameRes["height"].Float() = resolution.y;
std::string resText;
resText += std::to_string(resolution.x);
resText += "x";
resText += std::to_string(resolution.y);
widget<CLabel>("resolutionLabel")->setText(resText);
widget<CLabel>("resolutionLabel")->setText(resolutionToString(resolution.x, resolution.y));
}
void GeneralOptionsTab::setFullscreenMode(bool on)
@ -226,4 +227,4 @@ void GeneralOptionsTab::fillSelectableResolutions()
{
return left.x * left.y < right.x * right.y;
});
}
}

View File

@ -1,12 +1,6 @@
{
"items":
[
{
"name": "lineMovementEnd",
"type": "texture",
"image": "settingsWindow/lineHorizontal",
"rect": { "x" : 5, "y" : 22, "w": 365, "h": 3}
},
{
"name": "lineLabelsEnd",
"type": "texture",
@ -54,6 +48,16 @@
}
]
},
{
"name": "heroSpeedLabel",
"type": "label",
"font": "medium",
"alignment": "center",
"color": "yellow",
"text" : "800%",
"position": {"x": 324, "y": 90}
},
{
"name": "heroMovementSpeedPicker",
@ -78,14 +82,14 @@
{
"index": 100,
"type": "toggleButton",
"image": "sysopb2",
"image": "sysopb5",
"help": "core.help.350",
"position": {"x": 96, "y": 0}
},
{
"index": 50,
"type": "toggleButton",
"image": "sysopb3",
"image": "sysopb6",
"help": "core.help.351",
"position": {"x": 144, "y": 0}
},
@ -116,7 +120,7 @@
{
"index": 150,
"type": "toggleButton",
"image": "sysopb5",
"image": "sysopb1",
"help": "core.help.353",
"position": {"x": 0, "y": 0}
},
@ -124,7 +128,7 @@
{
"index": 100,
"type": "toggleButton",
"image": "sysopb6",
"image": "sysopb5",
"help": "core.help.353",
"position": {"x": 48, "y": 0}
},
@ -140,7 +144,7 @@
{
"index": 25,
"type": "toggleButton",
"image": "sysopb7",
"image": "sysopb3",
"help": "core.help.354",
"position": {"x": 144, "y": 0}
},

View File

@ -8,17 +8,13 @@
"rect": { "x" : 5, "y" : 289, "w": 365, "h": 3}
},
{
"name": "settingGroupTitles",
"name": "settingAudioTitles",
"type": "labelGroup",
"font": "medium",
"alignment": "center",
"color": "yellow",
"items":
[
{
"position": {"x": 100, "y": 60},
"text": "vcmi.systemOptions.resolutionButton.hover"
},
{
"position": {"x": 460, "y": 98},
"text": "core.genrltxt.394" // Music Volume
@ -29,24 +25,90 @@
}
]
},
{
"name": "resolutionButton",
"type": "button",
"position": {"x": 10, "y": 70},
"image": "buttons/resolution",
"help": "vcmi.systemOptions.resolutionButton",
"callback": "setGameResolution",
"hotkey": "g"
"name": "settingGroupTitles",
"type": "labelGroup",
"font": "medium",
"alignment": "left",
"color": "yellow",
"items":
[
{
"position": {"x": 10, "y": 55},
"text": "vcmi.systemOptions.videoGroup"
}
{
"position": {"x": 380, "y": 55},
"text": "vcmi.systemOptions.audioGroup"
}
{
"position": {"x": 10, "y": 295},
"text": "vcmi.systemOptions.otherGroup"
}
]
},
{
"name": "resolutionLabel",
"type": "label",
"font": "medium",
"alignment": "center",
"color": "yellow",
"position": {"x": 160, "y": 85}
"alignment": "left",
"color": "white",
"position": {"x": 45, "y": 85},
"text": "vcmi.systemOptions.resolutionButton.hover"
},
{
"name": "resolutionButton",
"type": "button",
"position": {"x": 10, "y": 82},
"image": "settingsWindow/button32",
"help": "vcmi.systemOptions.resolutionButton",
"callback": "setGameResolution",
"hotkey": "g",
"items":
[
{
"name": "gearIcon",
"type": "picture",
"image": "settingsWindow/gear",
"position": {"x": 0, "y": 0 }
}
]
},
{
"name": "topCheckboxesLabels",
"type": "labelGroup",
"font": "medium",
"alignment": "left",
"color": "white",
"items":
[
{
"position": {"x": 45, "y": 115},
"text": "vcmi.systemOptions.fullscreenButton.hover"
},
{
"position": {"x": 45, "y": 145},
"text": "vcmi.systemOptions.framerateButton.hover"
}
]
},
{
"name": "fullscreenCheckbox",
"type": "toggleButton",
"image": "sysopchk.def",
"help": "vcmi.systemOptions.fullscreenButton",
"position": {"x": 10, "y": 112},
"callback": "fullscreenChanged"
},
{
"name": "framerateCheckbox",
"type": "toggleButton",
"image": "sysopchk.def",
"help": "vcmi.systemOptions.framerateButton",
"position": {"x": 10, "y": 142},
"callback": "framerateChanged"
},
{
@ -55,7 +117,6 @@
"image": "settingsWindow/frameAudio",
"position": {"x": 380, "y": 80 }
},
{
"name": "musicSlider",
"type": "slider",
@ -67,6 +128,15 @@
"itemsTotal": 100,
"callback": "setMusic"
},
{
"name": "musicValueLabel",
"type": "label",
"font": "medium",
"alignment": "center",
"color": "yellow",
"text" : "10%",
"position": {"x": 565, "y": 98}
},
{
"name": "frameSound",
@ -86,6 +156,15 @@
"itemsTotal": 100,
"callback": "setVolume"
},
{
"name": "soundValueLabel",
"type": "label",
"font": "medium",
"alignment": "center",
"color": "yellow",
"text" : "10%",
"position": {"x": 565, "y": 158}
},
{
"name": "bottomCheckboxesLabels",
@ -99,21 +178,13 @@
"position": {"x": 45, "y": 325},
"text": "core.genrltxt.577"
},
{
"position": {"x": 45, "y": 355},
"text": "vcmi.systemOptions.fullscreenButton.hover"
},
{
"position": {"x": 45, "y": 385},
"text": "vcmi.systemOptions.framerateButton.hover"
},
{
"text": "vcmi.otherOptions.availableCreaturesAsDwellingLabel.hover",
"position": {"x": 45, "y": 415}
"position": {"x": 45, "y": 355}
},
{
"text": "vcmi.otherOptions.compactTownCreatureInfo.hover",
"position": {"x": 45, "y": 445}
"position": {"x": 45, "y": 385}
}
]
},
@ -126,40 +197,20 @@
"position": {"x": 10, "y": 323},
"callback": "spellbookAnimationChanged"
},
{
"name": "fullscreenCheckbox",
"type": "toggleButton",
"image": "sysopchk.def",
"help": "vcmi.systemOptions.fullscreenButton",
"position": {"x": 10, "y": 353},
"callback": "fullscreenChanged"
},
{
"name": "framerateCheckbox",
"type": "toggleButton",
"image": "sysopchk.def",
"help": "vcmi.systemOptions.framerateButton",
"position": {"x": 10, "y": 383},
"callback": "framerateChanged"
},
{
"name": "availableCreaturesAsDwellingLabelCheckbox",
"type": "toggleButton",
"image": "sysopchk.def",
"help": "vcmi.otherOptions.availableCreaturesAsDwellingLabel",
"position": {"x": 10, "y": 413},
"position": {"x": 10, "y": 353},
"callback": "availableCreaturesAsDwellingLabelChanged"
},
{
"name": "compactTownCreatureInfoCheckbox",
"type": "toggleButton",
"image": "sysopchk.def",
"help": "vcmi.otherOptions.compactTownCreatureInfo",
"position": {"x": 10, "y": 443},
"position": {"x": 10, "y": 383},
"callback": "compactTownCreatureInfoChanged"
}
]