1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-15 20:03:15 +02:00

Implemented layout for simturn/timer presets

This commit is contained in:
Ivan Savenko
2023-11-23 17:20:32 +02:00
parent 1f0bcbc194
commit cb8e9e633a
9 changed files with 717 additions and 33 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 485 B

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 400 B

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1,8 @@
{
"basepath" : "lobby/",
"images" :
[
{ "frame" : 0, "file" : "dropdownNormal.png"},
{ "frame" : 1, "file" : "dropdownPressed.png"}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,129 @@
{
"items":
[
{
"name": "background",
"type": "picture",
"image": "ADVOPTBK",
"position": {"x": 0, "y": 6}
},
{
"name": "labelTitle",
"type": "label",
"font": "big",
"alignment": "center",
"color": "yellow",
"text": "core.genrltxt.515",
"position": {"x": 222, "y": 36}
},
{
"name": "labelSubTitle",
"type": "multiLineLabel",
"font": "small",
"alignment": "center",
"color": "white",
"text": "core.genrltxt.516",
"rect": {"x": 60, "y": 50, "w": 320, "h": 0},
"adoptHeight": true
},
{
"name": "labelPlayerNameAndHandicap",
"type": "multiLineLabel",
"font": "small",
"alignment": "center",
"color": "yellow",
"text": "core.genrltxt.517",
"rect": {"x": 58, "y": 92, "w": 100, "h": 0},
"adoptHeight": true
},
{
"name": "labelStartingTown",
"type": "multiLineLabel",
"font": "small",
"alignment": "center",
"color": "yellow",
"text": "core.genrltxt.518",
"rect": {"x": 163, "y": 92, "w": 70, "h": 0},
"adoptHeight": true
},
{
"name": "labelStartingHero",
"type": "multiLineLabel",
"font": "small",
"alignment": "center",
"color": "yellow",
"text": "core.genrltxt.519",
"rect": {"x": 239, "y": 92, "w": 70, "h": 0},
"adoptHeight": true
},
{
"name": "labelStartingBonus",
"type": "multiLineLabel",
"font": "small",
"alignment": "center",
"color": "yellow",
"text": "core.genrltxt.520",
"rect": {"x": 315, "y": 92, "w": 70, "h": 0},
"adoptHeight": true
},
// timer
{
"type": "label",
"font": "small",
"alignment": "center",
"color": "yellow",
"text": "core.genrltxt.521",
"position": {"x": 222, "y": 544}
},
{
"name": "labelTurnDurationValue",
"type": "label",
"font": "small",
"alignment": "center",
"color": "white",
"text": "",
"position": {"x": 319, "y": 565}
},
{
"name": "sliderTurnDuration",
"type": "slider",
"orientation": "horizontal",
"position": {"x": 55, "y": 557},
"size": 194,
"callback": "setTimerPreset",
"itemsVisible": 1,
"itemsTotal": 11,
"selected": 11,
"style": "blue",
"scrollBounds": {"x": -3, "y": -25, "w": 337, "h": 43},
"panningStep": 20
},
],
"variables":
{
"timerPresets" :
[
[0, 60, 0, 0],
[0, 120, 0, 0],
[0, 240, 0, 0],
[0, 360, 0, 0],
[0, 480, 0, 0],
[0, 600, 0, 0],
[0, 900, 0, 0],
[0, 1200, 0, 0],
[0, 1500, 0, 0],
[0, 1800, 0, 0],
[0, 0, 0, 0],
]
}
}

View File

@@ -1,4 +1,5 @@
{
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
@@ -72,41 +73,19 @@
"rect": {"x": 315, "y": 92, "w": 70, "h": 0},
"adoptHeight": true
},
// timer
{
"type": "label",
"font": "small",
"alignment": "center",
"color": "yellow",
"text": "core.genrltxt.521",
"position": {"x": 222, "y": 544}
"type" : "dropDownTimers",
"name": "timerPresetSelector",
"position": {"x": 56, "y": 535},
"dropDownPosition": {"x": 0, "y": -260}
},
{
"name": "labelTurnDurationValue",
"type": "label",
"font": "small",
"alignment": "center",
"color": "white",
"text": "",
"position": {"x": 319, "y": 565}
},
{
"name": "sliderTurnDuration",
"type": "slider",
"orientation": "horizontal",
"position": {"x": 55, "y": 557},
"size": 194,
"callback": "setTimerPreset",
"itemsVisible": 1,
"itemsTotal": 11,
"selected": 11,
"style": "blue",
"scrollBounds": {"x": -3, "y": -25, "w": 337, "h": 43},
"panningStep": 20
},
"type" : "dropDownSimturns",
"name": "simturnsPresetSelector",
"position": {"x": 56, "y": 555},
"dropDownPosition": {"x": 0, "y": -160}
}
],
"variables":

View File

@@ -0,0 +1,520 @@
{
"dropDownBackground" :
{
"type": "transparentFilledRectangle",
"visible": false,
"rect": {"x": 1, "y": 1, "w": 219, "h": 19},
"color": [0, 0, 0, 128],
"colorLine": [0, 0, 0, 128]
},
"dropDownLabel":
{
"type": "label",
"font": "small",
"alignment": "left",
"color": "white",
"position": {"x": 4, "y": 0}
},
"dropDownHover":
{
"type": "transparentFilledRectangle",
"visible": false,
"rect": {"x": 2, "y": 2, "w": 216, "h": 16},
"color": [0, 0, 0, 0],
"colorLine": [255, 255, 0, 255]
},
"dropDownTimers" :
{
"name": "timerPresetSelector",
"type": "comboBox",
"image": "lobby/dropdown",
"imageOrder": [0, 0, 0, 0],
"items":
[
{
"name": "timer",
"type": "label",
"font": "small",
"alignment": "left",
"color": "white",
"text": "Custom turn time"
}
],
"dropDown":
{
"items":
[
{
"type": "texture",
"image": "DiBoxBck",
"color" : "blue",
"rect": {"x": 0, "y": 0, "w": 220, "h": 260}
},
{
"type": "transparentFilledRectangle",
"visible": false,
"rect": {"x": 0, "y": 0, "w": 220, "h": 260},
"color": [0, 0, 0, 0],
"colorLine": [64, 80, 128, 128]
},
{
"type": "item",
"position": {"x": 0, "y": 0},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Unlimited turn time"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 20},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Classic timer: 1 minute"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 40},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Classic timer: 2 minutes"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 60},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Classic timer: 5 minutes"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 80},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Classic timer: 10 minutes"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 100},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Classic timer: 20 minutes"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 120},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Classic timer: 30 minutes"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 140},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Chess: 16:00 + 08:00 + 02:00 + 00:00"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 160},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Chess: 16:00 + 08:00 + 01:15 + 00:00"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 180},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Chess: 08:00 + 04:00 + 01:00 + 00:00"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 200},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Chess: 02:00 + 01:30 + 01:00 + 00:00"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 220},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Chess: 02:00 + 01:00 + 00:15 + 00:00"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 240},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Chess: 01:00 + 01:00 + 00:00 + 00:00"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
}
]
}
},
"dropDownSimturns" :
{
"name": "timerPresetSelector",
"type": "comboBox",
"image": "lobby/dropdown",
"imageOrder": [0, 0, 0, 0],
"items":
[
{
"name": "timer",
"type": "label",
"font": "small",
"alignment": "left",
"color": "white",
"text": "Custom simultaneous turns"
}
],
"dropDown":
{
"items":
[
{
"type": "texture",
"image": "DiBoxBck",
"color" : "blue",
"rect": {"x": 0, "y": 0, "w": 220, "h": 160}
},
{
"type": "transparentFilledRectangle",
"visible": false,
"rect": {"x": 0, "y": 0, "w": 220, "h": 160},
"color": [0, 0, 0, 0],
"colorLine": [64, 80, 128, 128]
},
{
"type": "item",
"position": {"x": 0, "y": 0},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "No simultaneous turns"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 20},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Simturns: Until contact"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 40},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Simturns: 1 week, break on contact"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 60},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Simturns: 2 weeks, break on contact"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 80},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Simturns: 1 month, break on contact"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 100},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Simturns: 1 week, contacts blocked"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 120},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Simturns: 2 weeks, contacts blocked"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
},
{
"type": "item",
"position": {"x": 0, "y": 140},
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"items":
[
{
"type": "dropDownBackground"
},
{
"type": "dropDownLabel",
"name": "labelName",
"text": "Simturns: 1 month, contacts blocked"
},
{
"type": "dropDownHover",
"name": "hoverImage"
}
]
}
]
}
}
}

View File

@@ -1,4 +1,6 @@
{
"library" : "config/widgets/turnOptionsDropdownLibrary.json",
"customTypes" : {
"verticalLayout66" : {
"type" : "layout",
@@ -64,6 +66,28 @@
"rect": {"x": 60, "y": 48, "w": 320, "h": 0},
"adoptHeight": true
},
{
"type": "label",
"font": "medium",
"alignment": "center",
"color": "yellow",
"text": "Select preset",
"position": {"x": 105, "y": 100}
},
{
"type" : "dropDownTimers",
"name": "timerPresetSelector",
"position": {"x": 160, "y": 78},
"dropDownPosition": {"x": 0, "y": 20}
},
{
"type" : "dropDownSimturns",
"name": "simturnsPresetSelector",
"position": {"x": 160, "y": 98},
"dropDownPosition": {"x": 0, "y": 20}
},
{
"type": "texture",
"image": "DiBoxBck",
@@ -103,7 +127,7 @@
{
"type" : "verticalLayout66",
"customType" : "labelTitle",
"position": {"x": 70, "y": 134},
"position": {"x": 70, "y": 133},
"items":
[
{
@@ -144,6 +168,30 @@
}
]
},
{
"name": "buttonTurnTimerAccumulate",
"position": {"x": 160, "y": 195},
"type": "toggleButton",
"image": "lobby/checkbox"
},
{
"name": "buttonUnitTimerAccumulate",
"position": {"x": 160, "y": 327},
"type": "toggleButton",
"image": "lobby/checkbox"
},
{
"type" : "labelTitle",
"position": {"x": 195, "y": 199},
"text" : "Accumulate"
},
{
"type" : "labelTitle",
"position": {"x": 195, "y": 331},
"text" : "Accumulate"
},
{
"type" : "verticalLayout66",