1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-24 03:47:18 +02:00

Adding some settings options, minor UI fixes

This commit is contained in:
Dydzio 2023-02-13 23:53:28 +01:00
parent b28a16ddd4
commit 80a5595d6c
6 changed files with 173 additions and 72 deletions

View File

@ -23,7 +23,17 @@
"vcmi.server.errors.existingProcess" : "Another vcmiserver process is running, please terminate it first",
"vcmi.server.errors.modsIncompatibility" : "Required mods to load game:",
"vcmi.server.confirmReconnect" : "Connect to the last session?",
"vcmi.server.confirmReconnect" : "Connect to the last session?",
"vcmi.settingsMainWindow.battleTab.hover" : "Battle Options", //unused
"vcmi.settingsMainWindow.systemTab.hover" : "System Options", //unused
"vcmi.settingsMainWindow.systemTab.help" : "Switches to System Options tab - these settings are related to general game client behavior",
"vcmi.settingsMainWindow.battleTab.help" : "Switches to Battle Options tab - these settings allow configuring battle interface and related things",
"vcmi.settingsMainWindow.adventureTab.hover" : "Adventure Map",
"vcmi.settingsMainWindow.adventureTab.help" : "Switches to Adventure Map Options tab - adventure map is part of the game where you can move your heroes",
"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.fullscreenButton.hover" : "Fullscreen",
"vcmi.systemOptions.fullscreenButton.help" : "{Fullscreen}\n\n If selected, VCMI will run in fullscreen mode, othervice VCMI will run in window",
@ -32,6 +42,23 @@
"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",
"vcmi.systemOptions.framerateButton.help" : "{Show FPS}\n\n Toggle on/off showing Frames Per Second counter in corner of game window.",
"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.battleOptions.showQueue.hover": "Show queue",
"vcmi.battleOptions.showQueue.help": "{Show queue}\n\n Show queue that displays movement order of creature stacks",
"vcmi.battleOptions.queueSizeLabel.hover": "Queue size",
"vcmi.battleOptions.queueSizeAutoButton.hover": "Automatic",
"vcmi.battleOptions.queueSizeAutoButton.help": "Sets queue size depending on game resolution",
"vcmi.battleOptions.queueSizeSmallButton.hover": "Small",
"vcmi.battleOptions.queueSizeSmallButton.help": "Sets queue size to small",
"vcmi.battleOptions.queueSizeBigButton.hover": "Big",
"vcmi.battleOptions.queueSizeBigButton.help": "Sets queue size to big",
"vcmi.townHall.missingBase" : "Base building %s must be built first",
"vcmi.townHall.noCreaturesToRecruit" : "There are no creatures to recruit!",

View File

@ -40,6 +40,9 @@ AdventureOptionsTab::AdventureOptionsTab()
addCallback("mapScrollSpeedChanged", std::bind(&setIntSetting, "adventure", "scrollSpeed", _1));
addCallback("heroReminderChanged", std::bind(&setBoolSetting, "adventure", "heroReminder", _1));
addCallback("quickCombatChanged", std::bind(&setBoolSetting, "adventure", "quickCombat", _1));
//settings that do not belong to base game:
addCallback("numericQuantitiesChanged", std::bind(&setBoolSetting, "gameTweaks", "numericCreaturesQuantities", _1));
addCallback("forceMovementInfoChanged", std::bind(&setBoolSetting, "gameTweaks", "forceMovementInfo", _1));
build(config);
std::shared_ptr<CToggleGroup> playerHeroSpeedToggle = widget<CToggleGroup>("heroMovementSpeedPicker");
@ -56,4 +59,10 @@ AdventureOptionsTab::AdventureOptionsTab()
std::shared_ptr<CToggleButton> quickCombatCheckbox = widget<CToggleButton>("quickCombatCheckbox");
quickCombatCheckbox->setSelected((bool)settings["adventure"]["quickCombat"].Bool());
std::shared_ptr<CToggleButton> numericQuantitiesCheckbox = widget<CToggleButton>("numericQuantitiesCheckbox");
numericQuantitiesCheckbox->setSelected((bool)settings["gameTweaks"]["numericCreaturesQuantities"].Bool());
std::shared_ptr<CToggleButton> forceMovementInfoCheckbox = widget<CToggleButton>("forceMovementInfoCheckbox");
forceMovementInfoCheckbox->setSelected((bool)settings["gameTweaks"]["forceMovementInfo"].Bool());
}

View File

@ -54,10 +54,12 @@ GeneralOptionsTab::GeneralOptionsTab()
const JsonNode config(ResourceID("config/widgets/settings/generalOptionsTab.json"));
addCallback("spellbookAnimationChanged", std::bind(&setBoolSetting, "video", "spellbookAnimation", _1));
addCallback("fullscreenChanged", std::bind(&GeneralOptionsTab::setFullscreenMode, this, _1));
addCallback("setGameResolution", std::bind(&GeneralOptionsTab::selectGameResolution, this));
addCallback("setMusic", [this](int value) { setIntSetting("general", "music", value); widget<CSlider>("musicSlider")->redraw(); });
addCallback("setVolume", [this](int value) { setIntSetting("general", "sound", value); widget<CSlider>("soundVolumeSlider")->redraw(); });
//settings that do not belong to base game:
addCallback("fullscreenChanged", std::bind(&GeneralOptionsTab::setFullscreenMode, this, _1));
addCallback("setGameResolution", std::bind(&GeneralOptionsTab::selectGameResolution, this));
addCallback("framerateChanged", std::bind(&setBoolSetting, "general", "showfps", _1));
build(config);
std::shared_ptr<CLabel> resolutionLabel = widget<CLabel>("resolutionLabel");
@ -75,6 +77,8 @@ GeneralOptionsTab::GeneralOptionsTab()
widget<CToggleButton>("fullscreenCheckbox")->setSelected(newState.Bool());
});
std::shared_ptr<CToggleButton> framerateCheckbox = widget<CToggleButton>("framerateCheckbox");
framerateCheckbox->setSelected((bool)settings["general"]["showfps"].Bool());
std::shared_ptr<CSlider> musicSlider = widget<CSlider>("musicSlider");
musicSlider->moveTo(CCS->musich->getVolume());

View File

@ -2,7 +2,7 @@
"items":
[
{
"name": "leftSettingsLabels",
"name": "topSettingsLabels",
"type": "labelGroup",
"font": "medium",
"alignment": "center",
@ -24,29 +24,6 @@
]
},
{
"name": "rightSideCheckboxesLabels",
"type": "labelGroup",
"font": "medium",
"alignment": "left",
"color": "white",
"items":
[
{
"position": {"x": 64, "y": 258},
"text": "core.genrltxt.572"
},
{
"position": {"x": 64, "y": 294},
"text": "core.genrltxt.573"
},
{
"position": {"x": 64, "y": 330},
"text": "core.genrltxt.574"
}
]
},
{
"name": "heroMovementSpeedPicker",
"type": "toggleGroup",
@ -185,6 +162,37 @@
"callback": "mapScrollSpeedChanged"
},
{
"name": "bottomCheckboxesLabels",
"type": "labelGroup",
"font": "medium",
"alignment": "left",
"color": "white",
"items":
[
{
"position": {"x": 64, "y": 258},
"text": "core.genrltxt.572"
},
{
"position": {"x": 64, "y": 294},
"text": "core.genrltxt.573"
},
{
"position": {"x": 64, "y": 330},
"text": "core.genrltxt.574"
},
{
"position": {"x": 64, "y": 366},
"text": "vcmi.adventureOptions.numericQuantities.hover"
},
{
"position": {"x": 64, "y": 402},
"text": "vcmi.adventureOptions.forceMovementInfo.hover"
}
]
},
{
"name": "heroReminderCheckbox",
"type": "toggleButton",
@ -201,6 +209,24 @@
"help": "core.help.362",
"position": {"x": 28, "y": 328},
"callback": "quickCombatChanged"
},
{
"name": "numericQuantitiesCheckbox",
"type": "toggleButton",
"image": "sysopchk.def",
"help": "vcmi.adventureOptions.numericQuantities",
"position": {"x": 28, "y": 364},
"callback": "numericQuantitiesChanged"
},
{
"name": "forceMovementInfoCheckbox",
"type": "toggleButton",
"image": "sysopchk.def",
"help": "vcmi.adventureOptions.forceMovementInfo",
"position": {"x": 28, "y": 400},
"callback": "forceMovementInfoChanged"
}
]
}

View File

@ -2,7 +2,7 @@
"items":
[
{
"name": "leftSettingsLabels",
"name": "topSettingsLabels",
"type": "labelGroup",
"font": "medium",
"alignment": "center",
@ -24,43 +24,6 @@
]
},
{
"name": "rightSideCheckboxesLabels",
"type": "labelGroup",
"font": "medium",
"alignment": "left",
"color": "white",
"items":
[
{
"position": {"x": 64, "y": 258},
"text": "core.genrltxt.577"
},
{
"position": {"x": 64, "y": 294},
"text": "vcmi.systemOptions.fullscreenButton.hover"
}
]
},
{
"name": "spellbookAnimationCheckbox",
"type": "toggleButton",
"image": "sysopchk.def",
"help": "core.help.364",
"position": {"x": 28, "y": 256},
"callback": "spellbookAnimationChanged"
},
{
"name": "fullscreenCheckbox",
"type": "toggleButton",
"image": "sysopchk.def",
"help": "vcmi.systemOptions.fullscreenButton",
"position": {"x": 28, "y": 292},
"callback": "fullscreenChanged"
},
{
"name": "resolutionButton",
"type": "button",
@ -102,6 +65,56 @@
"itemsVisible": 0,
"itemsTotal": 100,
"callback": "setVolume"
},
{
"name": "bottomCheckboxesLabels",
"type": "labelGroup",
"font": "medium",
"alignment": "left",
"color": "white",
"items":
[
{
"position": {"x": 64, "y": 258},
"text": "core.genrltxt.577"
},
{
"position": {"x": 64, "y": 294},
"text": "vcmi.systemOptions.fullscreenButton.hover"
},
{
"position": {"x": 64, "y": 330},
"text": "vcmi.systemOptions.framerateButton.hover"
}
]
},
{
"name": "spellbookAnimationCheckbox",
"type": "toggleButton",
"image": "sysopchk.def",
"help": "core.help.364",
"position": {"x": 28, "y": 256},
"callback": "spellbookAnimationChanged"
},
{
"name": "fullscreenCheckbox",
"type": "toggleButton",
"image": "sysopchk.def",
"help": "vcmi.systemOptions.fullscreenButton",
"position": {"x": 28, "y": 292},
"callback": "fullscreenChanged"
},
{
"name": "framerateCheckbox",
"type": "toggleButton",
"image": "sysopchk.def",
"help": "vcmi.systemOptions.framerateButton",
"position": {"x": 28, "y": 328},
"callback": "framerateChanged"
}
]
}

View File

@ -13,7 +13,7 @@
"type": "button",
"position": {"x": 0, "y": 0},
"image": "buttons/vcmisettings",
"help": "TODO",
"help": "vcmi.settingsMainWindow.systemTab",
"callback": "activateGeneralTab",
"items":
[
@ -33,8 +33,19 @@
"type": "button",
"position": {"x": 200, "y": 0},
"image": "buttons/vcmisettings",
"help": "TODO",
"callback": "activateAdventureTab"
"help": "vcmi.settingsMainWindow.adventureTab",
"callback": "activateAdventureTab",
"items":
[
{
"name": "generalTabButtonTitle",
"type": "label",
"font": "big",
"alignment": "center",
"color": "yellow",
"text": "vcmi.settingsMainWindow.adventureTab.hover"
}
]
},
{
@ -42,12 +53,12 @@
"type": "button",
"position": {"x": 400, "y": 0},
"image": "buttons/vcmisettings",
"help": "TODO",
"help": "vcmi.settingsMainWindow.battleTab",
"callback": "activateBattleTab",
"items":
[
{
"name": "battleTabButtonTitle",
"name": "adventureTabButtonTitle",
"type": "label",
"font": "big",
"alignment": "center",
@ -62,8 +73,19 @@
"type": "button",
"position": {"x": 600, "y": 0},
"image": "buttons/vcmisettings",
"help": "TODO",
"callback": "activateVcmiSettingsTab"
"help": "vcmi.settingsMainWindow.otherTab",
"callback": "activateVcmiSettingsTab",
"items":
[
{
"name": "otherTabButtonTitle",
"type": "label",
"font": "big",
"alignment": "center",
"color": "yellow",
"text": "vcmi.settingsMainWindow.otherTab.hover"
}
]
},
{