1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Added additional buttons for movement speeds

This commit is contained in:
Ivan Savenko
2023-03-03 15:23:37 +02:00
parent f09897b2b4
commit c976176453
31 changed files with 287 additions and 155 deletions

View File

Before

Width:  |  Height:  |  Size: 159 KiB

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 902 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -0,0 +1,10 @@
{
"basepath" : "settingsWindow/",
"images" :
[
{ "frame" : 0, "file" : "button190Normal.png"},
{ "frame" : 1, "file" : "button190PressedSelected.png"},
{ "frame" : 2, "file" : "button190Pressed.png"},
{ "frame" : 3, "file" : "button190NormalSelected.png"}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -0,0 +1,10 @@
{
"basepath" : "settingsWindow/",
"images" :
[
{ "frame" : 0, "file" : "button46Normal.png"},
{ "frame" : 1, "file" : "button46PressedSelected.png"},
{ "frame" : 2, "file" : "button46Pressed.png"},
{ "frame" : 3, "file" : "button46NormalSelected.png"}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,10 @@
{
"basepath" : "settingsWindow/",
"images" :
[
{ "frame" : 0, "file" : "button80Normal.png"},
{ "frame" : 1, "file" : "button80PressedSelected.png"},
{ "frame" : 2, "file" : "button80Pressed.png"},
{ "frame" : 3, "file" : "button80NormalSelected.png"}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

View File

@@ -55,9 +55,9 @@
"vcmi.adventureOptions.mapScrollSpeed5.hover": "5",
"vcmi.adventureOptions.mapScrollSpeed5.help": "Set map scrolling speed to extremely fast",
"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 (takes effect on next battle)",
"vcmi.battleOptions.queueSizeNoneButton.hover": "NONE",
"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",

View File

@@ -593,7 +593,9 @@ void CGuiHandler::handleMouseMotion(const SDL_Event & current)
{
//sending active, hovered hoverable objects hover() call
std::vector<CIntObject*> hlp;
for(auto & elem : hoverable)
auto hoverableCopy = hoverable;
for(auto & elem : hoverableCopy)
{
if(elem->pos.isInside(getCursorPosition()))
{
@@ -606,6 +608,8 @@ void CGuiHandler::handleMouseMotion(const SDL_Event & current)
(elem)->hovered = false;
}
}
assert(hoverableCopy == hoverable);
for(auto & elem : hlp)
{
elem->hover(true);

View File

@@ -70,9 +70,6 @@ BattleOptionsTab::BattleOptionsTab(BattleInterface * owner):
std::shared_ptr<CToggleButton> mouseShadowCheckbox = widget<CToggleButton>("mouseShadowCheckbox");
mouseShadowCheckbox->setSelected(settings["battle"]["mouseShadow"].Bool());
std::shared_ptr<CToggleButton> showQueueCheckbox = widget<CToggleButton>("showQueueCheckbox");
showQueueCheckbox->setSelected(settings["battle"]["showQueue"].Bool());
std::shared_ptr<CToggleButton> skipBattleIntroMusicCheckbox = widget<CToggleButton>("skipBattleIntroMusicCheckbox");
skipBattleIntroMusicCheckbox->setSelected(settings["gameTweaks"]["skipBattleIntroMusic"].Bool());
}
@@ -88,11 +85,13 @@ int BattleOptionsTab::getAnimSpeed() const
int BattleOptionsTab::getQueueSizeId() const
{
std::string text = settings["battle"]["queueSize"].String();
if(text == "none")
return -1;
if(text == "auto")
return 0;
else if(text == "small")
if(text == "small")
return 1;
else if(text == "big")
if(text == "big")
return 2;
return 0;
@@ -102,6 +101,8 @@ std::string BattleOptionsTab::getQueueSizeStringFromId(int value) const
{
switch(value)
{
case -1:
return "none";
case 0:
return "auto";
case 1:

View File

@@ -74,26 +74,34 @@
{
"index": 100,
"type": "toggleButton",
"image": "sysopb3",
"help": "core.help.351",
"image": "sysopb2",
"help": "core.help.350",
"position": {"x": 96, "y": 0}
},
{
"index": 50,
"type": "toggleButton",
"image": "sysopb3",
"help": "core.help.351",
"position": {"x": 144, "y": 0}
}
{
"index": 25,
"type": "toggleButton",
"image": "sysopb3",
"help": "core.help.351",
"position": {"x": 192, "y": 0}
}
{
"index": 0,
"type": "toggleButton",
"image": "sysopb4",
"help": "core.help.352",
"position": {"x": 144, "y": 0}
"position": {"x": 240, "y": 0}
}
//barely any difference compared to index 16 for now
// {
// "index": 9999,
// "type": "toggleButton",
// "image": "sysopb8",
// "help": "core.help.356",
// "position": {"x": 192, "y": 0}
// }
],
"callback": "playerHeroSpeedChanged"
},
@@ -116,16 +124,32 @@
"index": 100,
"type": "toggleButton",
"image": "sysopb6",
"help": "core.help.354",
"help": "core.help.353",
"position": {"x": 48, "y": 0}
},
{
"index": 50,
"type": "toggleButton",
"image": "sysopb6",
"help": "core.help.354",
"position": {"x": 96, "y": 0}
},
{
"index": 25,
"type": "toggleButton",
"image": "sysopb7",
"help": "core.help.354",
"position": {"x": 144, "y": 0}
},
{
"index": 0,
"type": "toggleButton",
"image": "sysopb7",
"help": "core.help.355",
"position": {"x": 96, "y": 0}
"position": {"x": 192, "y": 0}
},
{
@@ -133,7 +157,7 @@
"type": "toggleButton",
"image": "sysopb8",
"help": "core.help.356",
"position": {"x": 144, "y": 0}
"position": {"x": 240, "y": 0}
}
],
"callback": "enemyHeroSpeedChanged"
@@ -148,64 +172,102 @@
{
"index": 400,
"type": "toggleButton",
"image": "sysopb9",
"image": "settingsWindow/button46",
"help": "core.help.357",
"position": {"x": 0, "y": 0}
"position": {"x": 0, "y": 0},
"items":
[
{
"name": "mapScrollSpeed1",
"type": "picture",
"image": "settingsWindow/scrollSpeed1",
"position": {"x": 0, "y": 0 }
}
]
},
{
"index": 800,
"type": "toggleButton",
"image": "sysob10",
"image": "settingsWindow/button46",
"help": "core.help.358",
"position": {"x": 64, "y": 0}
"position": {"x": 48, "y": 0},
"items":
[
{
"name": "mapScrollSpeed2",
"type": "picture",
"image": "settingsWindow/scrollSpeed2",
"position": {"x": 0, "y": 0 }
}
]
},
{
"index": 3,
"type": "toggleButton",
"image": "settingsWindow/button46",
"help": "core.help.359",
"position": {"x": 96, "y": 0},
"items":
[
{
"name": "mapScrollSpeed3",
"type": "picture",
"image": "settingsWindow/scrollSpeed3",
"position": {"x": 0, "y": 0 }
}
]
},
{
"index": 1200,
"type": "toggleButton",
"image": "sysob11",
"help": "core.help.359",
"position": {"x": 128, "y": 0}
"image": "settingsWindow/button46",
"help": "vcmi.adventureOptions.mapScrollSpeed4",
"position": {"x": 144, "y": 0},
"items":
[
{
"name": "mapScrollSpeed4",
"type": "picture",
"image": "settingsWindow/scrollSpeed4",
"position": {"x": 0, "y": 0 }
}
]
},
{
"index": -1, // TODO
"type": "toggleButton",
"image": "settingsWindow/button46",
"help": "vcmi.adventureOptions.mapScrollSpeed5",
"position": {"x": 192, "y": 0},
"items":
[
{
"name": "mapScrollSpeed5",
"type": "picture",
"image": "settingsWindow/scrollSpeed5",
"position": {"x": 0, "y": 0 }
}
]
},
{
"index": -2, // TODO
"type": "toggleButton",
"image": "settingsWindow/button46",
"help": "vcmi.adventureOptions.mapScrollSpeed6",
"position": {"x": 240, "y": 0},
"items":
[
{
"name": "mapScrollSpeed6",
"type": "picture",
"image": "settingsWindow/scrollSpeed6",
"position": {"x": 0, "y": 0 }
}
]
}
//not really functional yet...
// {
// "index": 6,
// "type": "toggleButton",
// "image": "buttons/square",
// "help": "vcmi.adventureOptions.mapScrollSpeed4",
// "position": {"x": 192, "y": 0},
// "items":
// [
// {
// "name": "mapScrollSpeed4",
// "type": "label",
// "font": "big",
// "alignment": "center",
// "color": "yellow",
// "text": "vcmi.adventureOptions.mapScrollSpeed4.hover"
// }
// ]
// },
// {
// "index": 8,
// "type": "toggleButton",
// "image": "buttons/square",
// "help": "vcmi.adventureOptions.mapScrollSpeed5",
// "position": {"x": 224, "y": 0},
// "items":
// [
// {
// "name": "mapScrollSpeed5",
// "type": "label",
// "font": "big",
// "alignment": "center",
// "color": "yellow",
// "text": "vcmi.adventureOptions.mapScrollSpeed5.hover"
// }
// ]
// }
],
"callback": "mapScrollSpeedChanged"
},

View File

@@ -55,7 +55,7 @@
"alignment": "left",
"color": "white",
"text": "core.genrltxt.398",
"position": {"x": 415, "y": 90}
"position": {"x": 415, "y": 92}
},
{
"name": "spellsAutoCombatLabel",
@@ -64,7 +64,7 @@
"alignment": "left",
"color": "white",
"text": "core.genrltxt.399",
"position": {"x": 415, "y": 120}
"position": {"x": 415, "y": 122}
},
{
"name": "catapultAutoCombatLabel",
@@ -73,7 +73,7 @@
"alignment": "left",
"color": "white",
"text": "core.genrltxt.400",
"position": {"x": 415, "y": 150}
"position": {"x": 415, "y": 152}
},
{
"name": "ballistaAutoCombatLabel",
@@ -82,7 +82,7 @@
"alignment": "left",
"color": "white",
"text": "core.genrltxt.151",
"position": {"x": 415, "y": 180}
"position": {"x": 415, "y": 182}
},
{
"name": "aidTentAutoCombatLabel",
@@ -91,7 +91,7 @@
"alignment": "left",
"color": "white",
"text": "core.genrltxt.401",
"position": {"x": 415, "y": 210}
"position": {"x": 415, "y": 212}
},
{
@@ -101,7 +101,7 @@
"alignment": "left",
"color": "white",
"text": "core.genrltxt.402",
"position": {"x": 45, "y": 240}
"position": {"x": 45, "y": 242}
},
{
"name": "creatureInfoOnlySpellsLabel",
@@ -110,7 +110,7 @@
"alignment": "left",
"color": "white",
"text": "core.genrltxt.403",
"position": {"x": 45, "y": 270}
"position": {"x": 45, "y": 272}
},
{
@@ -120,7 +120,7 @@
"alignment": "left",
"color": "white",
"text": "core.genrltxt.404",
"position": {"x": 45, "y": 60}
"position": {"x": 45, "y": 62}
},
{
"name": "showMovementRangeLabel",
@@ -129,7 +129,7 @@
"alignment": "left",
"color": "white",
"text": "core.genrltxt.405",
"position": {"x": 45, "y": 90}
"position": {"x": 45, "y": 92}
},
{
"name": "mouseShadowLabel",
@@ -138,7 +138,7 @@
"alignment": "left",
"color": "white",
"text": "core.genrltxt.406",
"position": {"x": 45, "y": 120}
"position": {"x": 45, "y": 122}
},
{
"name": "battleCasualtiesLabel",
@@ -147,7 +147,7 @@
"alignment": "left",
"color": "white",
"text": "core.genrltxt.407",
"position": {"x": 45, "y": 150}
"position": {"x": 45, "y": 152}
},
{
@@ -184,77 +184,96 @@
{
"index": 1,
"type": "toggleButton",
"image": "sysopb9",
"image": "settingsWindow/button46",
"help": "core.help.422",
"position": {"x": 0, "y": 0}
"position": {"x": 0, "y": 0},
"items":
[
{
"name": "battleScrollSpeed1",
"type": "picture",
"image": "settingsWindow/scrollSpeed1",
"position": {"x": 0, "y": 0 }
}
]
},
{
"index": 2,
"type": "toggleButton",
"image": "sysob10",
"image": "settingsWindow/button46",
"help": "core.help.423",
"position": {"x": 64, "y": 0}
"position": {"x": 48, "y": 0},
"items":
[
{
"name": "battleScrollSpeed2",
"type": "picture",
"image": "settingsWindow/scrollSpeed2",
"position": {"x": 0, "y": 0 }
}
]
},
{
"index": 3,
"type": "toggleButton",
"image": "sysob11",
"image": "settingsWindow/button46",
"help": "core.help.424",
"position": {"x": 128, "y": 0}
"position": {"x":96, "y": 0},
"items":
[
{
"name": "battleScrollSpeed3",
"type": "picture",
"image": "settingsWindow/scrollSpeed3",
"position": {"x": 0, "y": 0 }
}
]
},
{
"index": 6,
"type": "toggleButton",
"image": "buttons/square",
"image": "settingsWindow/button46",
"help": "vcmi.battleOptions.animationsSpeed4",
"position": {"x": 192, "y": 0},
"position": {"x": 144, "y": 0},
"items":
[
{
"name": "battleAnimationsSpeed4",
"type": "label",
"font": "big",
"alignment": "center",
"color": "yellow",
"text": "vcmi.battleOptions.animationsSpeed4.hover"
"name": "battleScrollSpeed4",
"type": "picture",
"image": "settingsWindow/scrollSpeed4",
"position": {"x": 0, "y": 0 }
}
]
},
{
"index": 12,
"type": "toggleButton",
"image": "buttons/square",
"image": "settingsWindow/button46",
"help": "vcmi.battleOptions.animationsSpeed5",
"position": {"x": 229, "y": 0},
"position": {"x": 192, "y": 0},
"items":
[
{
"name": "battleAnimationsSpeed5",
"type": "label",
"font": "big",
"alignment": "center",
"color": "yellow",
"text": "vcmi.battleOptions.animationsSpeed5.hover"
"name": "battleScrollSpeed5",
"type": "picture",
"image": "settingsWindow/scrollSpeed5",
"position": {"x": 0, "y": 0 }
}
]
},
{
"index": 24,
"type": "toggleButton",
"image": "buttons/square",
"image": "settingsWindow/button46",
"help": "vcmi.battleOptions.animationsSpeed6",
"position": {"x": 266, "y": 0},
"position": {"x": 240, "y": 0},
"items":
[
{
"name": "battleAnimationsSpeed6",
"type": "label",
"font": "big",
"alignment": "center",
"color": "yellow",
"text": "vcmi.battleOptions.animationsSpeed6.hover"
"name": "battleScrollSpeed6",
"type": "picture",
"image": "settingsWindow/scrollSpeed6",
"position": {"x": 0, "y": 0 }
}
]
}
@@ -262,25 +281,6 @@
"callback": "animationSpeedChanged"
},
{
"name": "showQueueLabel",
"type": "label",
"font": "medium",
"alignment": "left",
"color": "white",
"text": "vcmi.battleOptions.showQueue.hover",
"position": {"x": 45, "y": 370}
},
{
"name": "showQueueCheckbox",
"type": "toggleButton",
"image": "sysopchk.def",
"help": "vcmi.battleOptions.showQueue",
"position": {"x": 10, "y": 370},
"callback": "showQueueChanged"
},
{
"name": "queueSizeLabel",
"type": "label",
@@ -298,17 +298,35 @@
"items":
[
{
"index": 0, //auto
"index": -1, //off
"type": "toggleButton",
"image": "buttons/triplewide",
"image": "settingsWindow/button80",
"help": "vcmi.battleOptions.queueSizeAutoButton",
"position": {"x": 0, "y": 0},
"items":
[
{
"name": "queueSizeNoneText",
"type": "label",
"font": "medium",
"alignment": "center",
"color": "yellow",
"text": "vcmi.battleOptions.queueSizeNoneButton.hover"
}
]
},
{
"index": 0, //auto
"type": "toggleButton",
"image": "settingsWindow/button80",
"help": "vcmi.battleOptions.queueSizeAutoButton",
"position": {"x": 85, "y": 0},
"items":
[
{
"name": "queueSizeAutoText",
"type": "label",
"font": "big",
"font": "medium",
"alignment": "center",
"color": "yellow",
"text": "vcmi.battleOptions.queueSizeAutoButton.hover"
@@ -318,15 +336,15 @@
{
"index": 1, //small
"type": "toggleButton",
"image": "buttons/triplewide",
"image": "settingsWindow/button80",
"help": "vcmi.battleOptions.queueSizeSmallButton",
"position": {"x": 113, "y": 0},
"position": {"x": 170, "y": 0},
"items":
[
{
"name": "queueSizeSmallText",
"type": "label",
"font": "big",
"font": "medium",
"alignment": "center",
"color": "yellow",
"text": "vcmi.battleOptions.queueSizeSmallButton.hover"
@@ -336,15 +354,15 @@
{
"index": 2, //large
"type": "toggleButton",
"image": "buttons/triplewide",
"image": "settingsWindow/button80",
"help": "vcmi.battleOptions.queueSizeBigButton",
"position": {"x": 226, "y": 0},
"position": {"x": 255, "y": 0},
"items":
[
{
"name": "queueSizeBigText",
"type": "label",
"font": "big",
"font": "medium",
"alignment": "center",
"color": "yellow",
"text": "vcmi.battleOptions.queueSizeBigButton.hover"
@@ -362,7 +380,7 @@
"alignment": "left",
"color": "white",
"text": "vcmi.battleOptions.skipBattleIntroMusic.hover",
"position": {"x": 45, "y": 180}
"position": {"x": 45, "y": 182}
},
{

View File

@@ -14,11 +14,11 @@
"text": "vcmi.systemOptions.resolutionButton.hover"
},
{
"position": {"x": 100, "y": 130},
"position": {"x": 455, "y": 78},
"text": "core.genrltxt.394"
},
{
"position": {"x": 100, "y": 190},
"position": {"x": 455, "y": 138},
"text": "core.genrltxt.395"
}
]
@@ -43,23 +43,37 @@
"position": {"x": 160, "y": 85}
},
{
"name": "frameMusic",
"type": "picture",
"image": "settingsWindow/frameAudio",
"position": {"x": 375, "y": 60 }
},
{
"name": "musicSlider",
"type": "slider",
"position": {"x": 10, "y": 150},
"size": 190,
"position": {"x": 380, "y": 95},
"size": 200,
"style": "brown",
"orientation": "horizontal",
"itemsVisible": 0,
"itemsTotal": 100,
"callback": "setMusic"
},
{
"name": "frameAudio",
"type": "picture",
"image": "settingsWindow/frameAudio",
"position": {"x": 375, "y": 120 }
},
{
"name": "soundVolumeSlider",
"type": "slider",
"position": {"x": 10, "y": 210},
"size": 190,
"position": {"x": 380, "y": 155},
"size": 200,
"style": "brown",
"orientation": "horizontal",
"itemsVisible": 0,
@@ -76,15 +90,15 @@
"items":
[
{
"position": {"x": 45, "y": 330},
"position": {"x": 45, "y": 332},
"text": "core.genrltxt.577"
},
{
"position": {"x": 45, "y": 360},
"position": {"x": 45, "y": 362},
"text": "vcmi.systemOptions.fullscreenButton.hover"
},
{
"position": {"x": 45, "y": 390},
"position": {"x": 45, "y": 392},
"text": "vcmi.systemOptions.framerateButton.hover"
}
]
@@ -124,7 +138,7 @@
"alignment": "left",
"color": "white",
"text": "vcmi.otherOptions.availableCreaturesAsDwellingLabel.hover",
"position": {"x": 45, "y": 420}
"position": {"x": 45, "y": 422}
},
{
@@ -143,7 +157,7 @@
"alignment": "left",
"color": "white",
"text": "vcmi.otherOptions.compactTownCreatureInfo.hover",
"position": {"x": 45, "y": 450}
"position": {"x": 45, "y": 452}
},
{

View File

@@ -34,7 +34,8 @@
"index": 0,
"type": "toggleButton",
"position": {"x": 10, "y": 5},
"image": "buttons/quadwide",
"image": "settingsWindow/button190",
"transparent" : true,
"help": "vcmi.settingsMainWindow.generalTab",
"items":
[
@@ -52,8 +53,9 @@
{
"index": 1,
"type": "toggleButton",
"position": {"x": 200, "y": 5},
"image": "buttons/quadwide",
"position": {"x": 205, "y": 5},
"image": "settingsWindow/button190",
"transparent" : true,
"help": "vcmi.settingsMainWindow.adventureTab",
"items":
[
@@ -71,8 +73,9 @@
{
"index": 2,
"type": "toggleButton",
"position": {"x": 390, "y": 5},
"image": "buttons/quadwide",
"position": {"x": 400, "y": 5},
"image": "settingsWindow/button190",
"transparent" : true,
"help": "vcmi.settingsMainWindow.battleTab",
"items":
[