Merge lp:~widelands-dev/widelands/map-filter-dropdowns into lp:widelands

Proposed by GunChleoc
Status: Work in progress
Proposed branch: lp:~widelands-dev/widelands/map-filter-dropdowns
Merge into: lp:widelands
Diff against target: 961 lines (+284/-101)
44 files modified
data/maps/Archipelago_Sea.wmf/elemental (+1/-1)
data/maps/Calvisson.wmf/elemental (+1/-1)
data/maps/Checkmate.wmf/elemental (+1/-1)
data/maps/Crater.wmf/elemental (+1/-1)
data/maps/Crossing_the_Horizon_v2.wmf/elemental (+1/-1)
data/maps/Desert_Tournament.wmf/elemental (+1/-1)
data/maps/Dolomites_v2.wmf/elemental (+1/-1)
data/maps/Elven_Forests.wmf/elemental (+1/-1)
data/maps/Fellowships_v2.wmf/elemental (+1/-1)
data/maps/Four_Castles.wmf/elemental (+1/-1)
data/maps/Four_Mountains.wmf/elemental (+1/-1)
data/maps/Full_Moon_v2.wmf/elemental (+1/-1)
data/maps/Glacier_Lake_v2.wmf/elemental (+1/-1)
data/maps/Golden_Peninsula.wmf/elemental (+1/-1)
data/maps/Ice_wars.wmf/elemental (+1/-1)
data/maps/Lake_of_Tranquility.wmf/elemental (+1/-1)
data/maps/Last_Bastion_v2.wmf/elemental (+1/-1)
data/maps/Last_Survivors.wmf/elemental (+1/-1)
data/maps/MP_Scenarios/Island_Hopping.wmf/elemental (+1/-1)
data/maps/MP_Scenarios/Smugglers.wmf/elemental (+1/-1)
data/maps/Rendez-Vous.wmf/elemental (+1/-1)
data/maps/Sun_of_Fire.wmf/elemental (+1/-1)
data/maps/Swamp_Monks.wmf/elemental (+1/-1)
data/maps/The_Far_North.wmf/elemental (+1/-1)
data/maps/The_Green_Plateau.wmf/elemental (+1/-1)
data/maps/The_Nile_v2.wmf/elemental (+1/-1)
data/maps/The_Oasis_Triangle.wmf/elemental (+1/-1)
data/maps/The_Pass_Through_the_Mountains.wmf/elemental (+1/-1)
data/maps/The_Thaw.wmf/elemental (+1/-1)
data/maps/Three_Warriors.wmf/elemental (+1/-1)
data/maps/Together_We're_Strong.wmf/elemental (+1/-1)
data/maps/Trident_of_Fire.wmf/elemental (+1/-1)
data/maps/Twin_Lagoons_v2.wmf/elemental (+1/-1)
data/maps/Two_Frontiers.wmf/elemental (+1/-1)
data/maps/Volcanic_Winter.wmf/elemental (+1/-1)
data/maps/Wideworld.wmf/elemental (+1/-1)
src/editor/ui_menus/main_menu_map_options.cc (+21/-3)
src/editor/ui_menus/main_menu_map_options.h (+5/-1)
src/ui_basic/button.cc (+16/-6)
src/ui_basic/dropdown.cc (+18/-3)
src/ui_basic/dropdown.h (+5/-0)
src/ui_fsmenu/mapselect.cc (+168/-51)
src/ui_fsmenu/mapselect.h (+11/-1)
src/wui/map_tags.cc (+4/-0)
To merge this branch: bzr merge lp:~widelands-dev/widelands/map-filter-dropdowns
Reviewer Review Type Date Requested Status
Widelands Developers Pending
Review via email: mp+372159@code.launchpad.net

Commit message

Redesign filters in Mapselect
- Add autofit text width capabilities to buttons and dropdowns
- Replace broken "Show all maps" checkbox with button
- Replace team-related checkboxes with dropdown
- New map tag "balanced" to complement "unbalanced", because the
  "balanced" state is the one that should be marked explicitly

To post a comment you must log in.
Revision history for this message
GunChleoc (gunchleoc) wrote :

With the upcoming ferry branch, we will run out of screen space for map tags. So, I have grouped them into dropdown menus.

Revision history for this message
GunChleoc (gunchleoc) wrote :

I have marked all official maps that didn't have an "unbalanced" tag as "balanced"

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/maps/Archipelago_Sea.wmf/elemental'
--- data/maps/Archipelago_Sea.wmf/elemental 2016-04-01 09:21:48 +0000
+++ data/maps/Archipelago_Sea.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="King of nowhere"9author="King of nowhere"
10descr=_"Between Sweden and Finland lies the archipelago sea. This place of incredible beauty is not land, and it is not sea, but it is both. Within a few hundred kilometers, there are no less than 50,000 islands and islets, most no more than a few acres across. The climate is quite mild for its latitude; farming thrives, berries are abundant, and fish plentiful. The small human population of this place never knew famine. You warlording bastards just couldn’t leave this little paradise in peace, could you?"10descr=_"Between Sweden and Finland lies the archipelago sea. This place of incredible beauty is not land, and it is not sea, but it is both. Within a few hundred kilometers, there are no less than 50,000 islands and islets, most no more than a few acres across. The climate is quite mild for its latitude; farming thrives, berries are abundant, and fish plentiful. The small human population of this place never knew famine. You warlording bastards just couldn’t leave this little paradise in peace, could you?"
11hint=_"Large plots are rare on those small islands. Prioritize construction of large buildings on them. Sometimes you will need big military buildings to expand all the way to the next island. The AI will perform poorly."11hint=_"Large plots are rare on those small islands. Prioritize construction of large buildings on them. Sometimes you will need big military buildings to expand all the way to the next island. The AI will perform poorly."
12tags="official"12tags="balanced,official"
1313
=== modified file 'data/maps/Calvisson.wmf/elemental'
--- data/maps/Calvisson.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/Calvisson.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,7 +9,7 @@
9author="Kristin"9author="Kristin"
10descr=_"It’s a pleasure to settle in the beauty of this fissured countryside. But the ways to encompass these large territories are long and meandering, so it is easy to err into the land of the foreign clans."10descr=_"It’s a pleasure to settle in the beauty of this fissured countryside. But the ways to encompass these large territories are long and meandering, so it is easy to err into the land of the foreign clans."
11hint=11hint=
12tags="2teams,official,seafaring"12tags="2teams,balanced,official,seafaring"
1313
14[teams00]14[teams00]
15team1="0"15team1="0"
1616
=== modified file 'data/maps/Checkmate.wmf/elemental'
--- data/maps/Checkmate.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/Checkmate.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="Winterwind"9author="Winterwind"
10descr=_"Whether just one of nature’s strangest features or the creation of a mad (and game-hungry) god, this weird battleground awaits two opponents for another confrontation."10descr=_"Whether just one of nature’s strangest features or the creation of a mad (and game-hungry) god, this weird battleground awaits two opponents for another confrontation."
11hint=11hint=
12tags="1v1,artifacts,official"12tags="1v1,artifacts,balanced,official"
1313
=== modified file 'data/maps/Crater.wmf/elemental'
--- data/maps/Crater.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/Crater.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="Tarrei"9author="Tarrei"
10descr=_"Long after a meteor crashed into a couple of mountains, life blossoms in the crater. Two tribes are now fighting for the rich resources."10descr=_"Long after a meteor crashed into a couple of mountains, life blossoms in the crater. Two tribes are now fighting for the rich resources."
11hint=11hint=
12tags="1v1,artifacts,official"12tags="1v1,artifacts,balanced,official"
1313
=== modified file 'data/maps/Crossing_the_Horizon_v2.wmf/elemental'
--- data/maps/Crossing_the_Horizon_v2.wmf/elemental 2018-02-16 11:34:08 +0000
+++ data/maps/Crossing_the_Horizon_v2.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="Kristin – edited by 3plus4i"9author="Kristin – edited by 3plus4i"
10descr=_"Man your ship and sail to the horizon."10descr=_"Man your ship and sail to the horizon."
11hint=11hint=
12tags="2teams,artifacts,ffa,official,seafaring"12tags="2teams,artifacts,balanced,ffa,official,seafaring"
1313
=== modified file 'data/maps/Desert_Tournament.wmf/elemental'
--- data/maps/Desert_Tournament.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/Desert_Tournament.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,7 +9,7 @@
9author="ivh"9author="ivh"
10descr=_"Four tribes struggle with their nearest neighbor to be the first to reach the mountain of gold that promises riches beyond belief. But can the two remaining ones share the resources wisely?"10descr=_"Four tribes struggle with their nearest neighbor to be the first to reach the mountain of gold that promises riches beyond belief. But can the two remaining ones share the resources wisely?"
11hint=11hint=
12tags="2teams,artifacts,ffa,official"12tags="2teams,artifacts,balanced,ffa,official"
1313
14[teams00]14[teams00]
15team1="0,1"15team1="0,1"
1616
=== modified file 'data/maps/Dolomites_v2.wmf/elemental'
--- data/maps/Dolomites_v2.wmf/elemental 2016-04-04 17:04:56 +0000
+++ data/maps/Dolomites_v2.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="King of nowhere"9author="King of nowhere"
10descr=_"The jewel of the Alps, the Dolomites mountain range has been declared a World Heritage Site for its pristine beauty. This map is an as-faithful-as-reasonable reconstruction of the area delimited by Cortina d’Ampezzo in the north-east and Canazei in the south-west. If you have to be pitted in a duel to the death against your enemies, it may as well be in a beautiful place."10descr=_"The jewel of the Alps, the Dolomites mountain range has been declared a World Heritage Site for its pristine beauty. This map is an as-faithful-as-reasonable reconstruction of the area delimited by Cortina d’Ampezzo in the north-east and Canazei in the south-west. If you have to be pitted in a duel to the death against your enemies, it may as well be in a beautiful place."
11hint=_"There is lot of flat ground on the mountains. Unfortunately, most of it is vertical. Use the little building space that you have wisely. A fortress at the mouth of a narrow mountain pass can be a formidable obstacle to an enemy army. Use the terrain to your advantage."11hint=_"There is lot of flat ground on the mountains. Unfortunately, most of it is vertical. Use the little building space that you have wisely. A fortress at the mouth of a narrow mountain pass can be a formidable obstacle to an enemy army. Use the terrain to your advantage."
12tags="1v1,2teams,3teams,official"12tags="1v1,2teams,3teams,balanced,official"
1313
=== modified file 'data/maps/Elven_Forests.wmf/elemental'
--- data/maps/Elven_Forests.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/Elven_Forests.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,7 +9,7 @@
9author="Winterwind"9author="Winterwind"
10descr=_"The breath-taking beauty of these emerald lands has lured many tribes into an attempt to take them for themselves."10descr=_"The breath-taking beauty of these emerald lands has lured many tribes into an attempt to take them for themselves."
11hint=11hint=
12tags="2teams,artifacts,ffa,official"12tags="2teams,artifacts,balanced,ffa,official"
1313
14[teams00]14[teams00]
15team1="0,1"15team1="0,1"
1616
=== modified file 'data/maps/Fellowships_v2.wmf/elemental'
--- data/maps/Fellowships_v2.wmf/elemental 2016-03-29 18:29:13 +0000
+++ data/maps/Fellowships_v2.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="Teppo"9author="Teppo"
10descr=_"Ships are your best fellows. Starting positions are similar, so the map should be fair."10descr=_"Ships are your best fellows. Starting positions are similar, so the map should be fair."
11hint=_"This is a somewhat technical map, and it is best suited for two or three human players. Coal is hard to find – consider making some. There is gold near the starting point – do you see it?"11hint=_"This is a somewhat technical map, and it is best suited for two or three human players. Coal is hard to find – consider making some. There is gold near the starting point – do you see it?"
12tags="ffa,seafaring,official"12tags="balanced,ffa,seafaring,official"
1313
=== modified file 'data/maps/Four_Castles.wmf/elemental'
--- data/maps/Four_Castles.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/Four_Castles.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,7 +9,7 @@
9author="Winterwind"9author="Winterwind"
10descr=_"Well protected in their mighty fortresses, four power-hungry warlords are completing their schemes to dominate these lands…"10descr=_"Well protected in their mighty fortresses, four power-hungry warlords are completing their schemes to dominate these lands…"
11hint=11hint=
12tags="2teams,artifacts,ffa,official"12tags="2teams,artifacts,balanced,ffa,official"
1313
14[teams00]14[teams00]
15team1="0,1"15team1="0,1"
1616
=== modified file 'data/maps/Four_Mountains.wmf/elemental'
--- data/maps/Four_Mountains.wmf/elemental 2016-03-31 07:40:54 +0000
+++ data/maps/Four_Mountains.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,7 +9,7 @@
9author="Quappo"9author="Quappo"
10descr=_"Each tribe is surrounded by four mighty mountains. Who will first conquer them and claim the resources for his own tribe?"10descr=_"Each tribe is surrounded by four mighty mountains. Who will first conquer them and claim the resources for his own tribe?"
11hint=_"I: Water can be found along the river. II: Snowmen mark additional water sources. III: Each mountain contains only one resource."11hint=_"I: Water can be found along the river. II: Snowmen mark additional water sources. III: Each mountain contains only one resource."
12tags="2teams,artifacts,ffa,official"12tags="2teams,artifacts,balanced,ffa,official"
1313
14[teams00]14[teams00]
15team1="0,1"15team1="0,1"
1616
=== modified file 'data/maps/Full_Moon_v2.wmf/elemental'
--- data/maps/Full_Moon_v2.wmf/elemental 2016-03-29 18:29:13 +0000
+++ data/maps/Full_Moon_v2.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,7 +9,7 @@
9author="fk"9author="fk"
10descr=_"Whether it is the latest solstice, or lunar illness, something moves these tribes towards their final ordeal."10descr=_"Whether it is the latest solstice, or lunar illness, something moves these tribes towards their final ordeal."
11hint=11hint=
12tags="2teams,ffa,official"12tags="2teams,balanced,ffa,official"
1313
14[teams00]14[teams00]
15team1="0,1"15team1="0,1"
1616
=== modified file 'data/maps/Glacier_Lake_v2.wmf/elemental'
--- data/maps/Glacier_Lake_v2.wmf/elemental 2016-03-29 18:29:13 +0000
+++ data/maps/Glacier_Lake_v2.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author=_"Nasenbaer – edited by king_of_nowhere"9author=_"Nasenbaer – edited by king_of_nowhere"
10descr=_"Your tribe has dwelt on this beautiful and lonely glacier lake for a long time. No one disturbed you and the resources were sufficient for your whole tribe, but a few months ago another tribe came over the mountains and settled down. And you are sure that there is only enough space for one tribe."10descr=_"Your tribe has dwelt on this beautiful and lonely glacier lake for a long time. No one disturbed you and the resources were sufficient for your whole tribe, but a few months ago another tribe came over the mountains and settled down. And you are sure that there is only enough space for one tribe."
11hint=11hint=
12tags="1v1,artifacts,official"12tags="1v1,artifacts,balanced,official"
1313
=== modified file 'data/maps/Golden_Peninsula.wmf/elemental'
--- data/maps/Golden_Peninsula.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/Golden_Peninsula.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="Winterwind"9author="Winterwind"
10descr=_"Two empires race for the treasures of a legendary peninsula…"10descr=_"Two empires race for the treasures of a legendary peninsula…"
11hint=11hint=
12tags="1v1,artifacts,official"12tags="1v1,artifacts,balanced,official"
1313
=== modified file 'data/maps/Ice_wars.wmf/elemental'
--- data/maps/Ice_wars.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/Ice_wars.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="Einstein13"9author="Einstein13"
10descr=_"Autumn became winter. Some things are frozen, but not the war."10descr=_"Autumn became winter. Some things are frozen, but not the war."
11hint=_"Start positions are clockwise"11hint=_"Start positions are clockwise"
12tags="2teams,3teams,4teams,official,seafaring"12tags="2teams,3teams,4teams,balanced,official,seafaring"
1313
=== modified file 'data/maps/Lake_of_Tranquility.wmf/elemental'
--- data/maps/Lake_of_Tranquility.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/Lake_of_Tranquility.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="Winterwind"9author="Winterwind"
10descr=_"This lake, deep in the most ancient forests, has long been known for its beauty and idyllic peace. However, its sanctity has been disturbed now, as two hostile tribes have arrived at its shores…"10descr=_"This lake, deep in the most ancient forests, has long been known for its beauty and idyllic peace. However, its sanctity has been disturbed now, as two hostile tribes have arrived at its shores…"
11hint=11hint=
12tags="1v1,artifacts,official"12tags="1v1,artifacts,balanced,official"
1313
=== modified file 'data/maps/Last_Bastion_v2.wmf/elemental'
--- data/maps/Last_Bastion_v2.wmf/elemental 2018-02-14 18:29:07 +0000
+++ data/maps/Last_Bastion_v2.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author=_"Another Barbarian – edited by king_of_nowhere"9author=_"Another Barbarian – edited by king_of_nowhere"
10descr=_"The whimsical Gods didn’t answer our prayers. Instead, the increasing sunlight heated up the Earth a thousandfold and melted glaciers and people were plunged into the deep. But now – high in the majestic mountains, on the last scrap of land – two surviving tribes are sheltering. Even though the Gods showed mercy and the climate thus turned cooler again, the water is still rising and rising. Onto the last secure place – the highest mountain range where the amount of gold and the space to live merely suffice for one tribe – only two opposite paths lead. But remember, be careful… this last living space is also a hard and small place to live."10descr=_"The whimsical Gods didn’t answer our prayers. Instead, the increasing sunlight heated up the Earth a thousandfold and melted glaciers and people were plunged into the deep. But now – high in the majestic mountains, on the last scrap of land – two surviving tribes are sheltering. Even though the Gods showed mercy and the climate thus turned cooler again, the water is still rising and rising. Onto the last secure place – the highest mountain range where the amount of gold and the space to live merely suffice for one tribe – only two opposite paths lead. But remember, be careful… this last living space is also a hard and small place to live."
11hint=_"Don’t forget to take care of your timber supplies, you’ll need them."11hint=_"Don’t forget to take care of your timber supplies, you’ll need them."
12tags="1v1,artifacts,official"12tags="1v1,artifacts,balanced,official"
1313
=== modified file 'data/maps/Last_Survivors.wmf/elemental'
--- data/maps/Last_Survivors.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/Last_Survivors.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,7 +9,7 @@
9author="fk"9author="fk"
10descr=_"Four tribes fighting for dominance in a stark area. Resources are scattered all over the map."10descr=_"Four tribes fighting for dominance in a stark area. Resources are scattered all over the map."
11hint=11hint=
12tags="2teams,ffa,official"12tags="2teams,balanced,ffa,official"
1313
14[teams00]14[teams00]
15team1="0,2"15team1="0,2"
1616
=== modified file 'data/maps/MP_Scenarios/Island_Hopping.wmf/elemental'
--- data/maps/MP_Scenarios/Island_Hopping.wmf/elemental 2014-10-08 10:38:57 +0000
+++ data/maps/MP_Scenarios/Island_Hopping.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -7,4 +7,4 @@
7name=_"Island Hopping"7name=_"Island Hopping"
8author="SirVer,Nasenbaer"8author="SirVer,Nasenbaer"
9descr=_"A special tournament in Atlantean culture is the so-called ‘Island Hopping’, where two or more groups try to reach the center island as fast as possible, to be the first erecting a castle on the top of the central mountain."9descr=_"A special tournament in Atlantean culture is the so-called ‘Island Hopping’, where two or more groups try to reach the center island as fast as possible, to be the first erecting a castle on the top of the central mountain."
10tags="official"10tags="official,balanced"
1111
=== modified file 'data/maps/MP_Scenarios/Smugglers.wmf/elemental'
--- data/maps/MP_Scenarios/Smugglers.wmf/elemental 2015-03-24 08:16:52 +0000
+++ data/maps/MP_Scenarios/Smugglers.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,7 +9,7 @@
9name=_"Smugglers"9name=_"Smugglers"
10author="Nasenbaer,SirVer"10author="Nasenbaer,SirVer"
11descr=_"Your well established smuggling routes suddenly got busy: two other tribes have appeared and now a rivalry among smugglers has started. Which team will be the first to smuggle a certain number of wares?"11descr=_"Your well established smuggling routes suddenly got busy: two other tribes have appeared and now a rivalry among smugglers has started. Which team will be the first to smuggle a certain number of wares?"
12tags="official"12tags="official,balanced"
1313
14[teams00]14[teams00]
15team1=0,115team1=0,1
1616
=== modified file 'data/maps/Rendez-Vous.wmf/elemental'
--- data/maps/Rendez-Vous.wmf/elemental 2016-09-18 07:01:55 +0000
+++ data/maps/Rendez-Vous.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="Quappo"9author="Quappo"
10descr=_"Only a small hill in the centre of the map connects these four competing tribes. Lead your army to this hill right away and build a giant stronghold as a sign of your superiority!"10descr=_"Only a small hill in the centre of the map connects these four competing tribes. Lead your army to this hill right away and build a giant stronghold as a sign of your superiority!"
11hint=_"There is space for only one stronghold in the centre. Water can be found everywhere, so there is no need to send out geologists."11hint=_"There is space for only one stronghold in the centre. Water can be found everywhere, so there is no need to send out geologists."
12tags="2teams,ffa,official"12tags="2teams,ffa,balanced,official"
1313
=== modified file 'data/maps/Sun_of_Fire.wmf/elemental'
--- data/maps/Sun_of_Fire.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/Sun_of_Fire.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="Nasenbaer"9author="Nasenbaer"
10descr=_"For hundreds of years, this island was kept as a sanctuary of the Gods. No human ever ventured to set a foot on it. But now that a tribe had finally been barefaced enough to settle on the coast of that island, a lot of others followed in its wake."10descr=_"For hundreds of years, this island was kept as a sanctuary of the Gods. No human ever ventured to set a foot on it. But now that a tribe had finally been barefaced enough to settle on the coast of that island, a lot of others followed in its wake."
11hint=_"Start positions are clockwise"11hint=_"Start positions are clockwise"
12tags="2teams,3teams,4teams,ffa,official"12tags="2teams,3teams,4teams,balanced,ffa,official"
1313
=== modified file 'data/maps/Swamp_Monks.wmf/elemental'
--- data/maps/Swamp_Monks.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/Swamp_Monks.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,7 +9,7 @@
9author="Nasenbaer"9author="Nasenbaer"
10descr=_"It is said that the old war monks, living in the even older swamps, are the key to control over the whole island."10descr=_"It is said that the old war monks, living in the even older swamps, are the key to control over the whole island."
11hint=11hint=
12tags="2teams,artifacts,official"12tags="2teams,artifacts,balanced,official"
1313
14[teams00]14[teams00]
15team1="0,1"15team1="0,1"
1616
=== modified file 'data/maps/The_Far_North.wmf/elemental'
--- data/maps/The_Far_North.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/The_Far_North.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="Another Barbarian"9author="Another Barbarian"
10descr=_"Some say that impenetrable lands to the far north scared away even the most courageous settlers and the bravest of the brave warriors. Big and old forests, full of big and predatory game, cut across by wetlands and hills were shrouded in mystery. The ones who had managed to come back mentioned tremendous buildings, decorated with carvings and gold from majestic mountain ranges somewhere amongst the wilderness. Dozens of years after only some crumbly ruins remain of these good old times, covered with moss and trees. Their shapes give only an idea about the craftsmanship of ancient constructors. Nobody knows why they (have) disappeared. Nobody knows why. People say that now nothing is blocking the road to wealth. But many will die pulled apart by wolves, engulfed by swamp… encircled by hostile tribes."10descr=_"Some say that impenetrable lands to the far north scared away even the most courageous settlers and the bravest of the brave warriors. Big and old forests, full of big and predatory game, cut across by wetlands and hills were shrouded in mystery. The ones who had managed to come back mentioned tremendous buildings, decorated with carvings and gold from majestic mountain ranges somewhere amongst the wilderness. Dozens of years after only some crumbly ruins remain of these good old times, covered with moss and trees. Their shapes give only an idea about the craftsmanship of ancient constructors. Nobody knows why they (have) disappeared. Nobody knows why. People say that now nothing is blocking the road to wealth. But many will die pulled apart by wolves, engulfed by swamp… encircled by hostile tribes."
11hint=11hint=
12tags="1v1,artifacts,official"12tags="1v1,artifacts,balanced,official"
1313
=== modified file 'data/maps/The_Green_Plateau.wmf/elemental'
--- data/maps/The_Green_Plateau.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/The_Green_Plateau.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,7 +9,7 @@
9author="Nasenbaer"9author="Nasenbaer"
10descr=_"You are standing on an island, crowned by mighty mountains which keep a wonderful and mighty treasure in their middle – The Green Plateau, which is hard to conquer but easy to lose. So, if you want it, be aware of the other clans."10descr=_"You are standing on an island, crowned by mighty mountains which keep a wonderful and mighty treasure in their middle – The Green Plateau, which is hard to conquer but easy to lose. So, if you want it, be aware of the other clans."
11hint=11hint=
12tags="1v1,artifacts,official"12tags="1v1,artifacts,balanced,official"
1313
14[teams00]14[teams00]
15team1="0"15team1="0"
1616
=== modified file 'data/maps/The_Nile_v2.wmf/elemental'
--- data/maps/The_Nile_v2.wmf/elemental 2016-03-29 18:29:13 +0000
+++ data/maps/The_Nile_v2.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -10,7 +10,7 @@
10descr=_"The river has always provided food and communication. This time, eight empires will fight for control over this land."10descr=_"The river has always provided food and communication. This time, eight empires will fight for control over this land."
11hint=_"Use the river wisely. Your opponents will do the same. You will find the main ore resources deep in the desert."11hint=_"Use the river wisely. Your opponents will do the same. You will find the main ore resources deep in the desert."
12hint=12hint=
13tags="1v1,2teams,3teams,4teams,seafaring,official"13tags="1v1,2teams,3teams,4teams,balanced,seafaring,official"
1414
15[teams00]15[teams00]
16team1="0"16team1="0"
1717
=== modified file 'data/maps/The_Oasis_Triangle.wmf/elemental'
--- data/maps/The_Oasis_Triangle.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/The_Oasis_Triangle.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="Nasenbaer"9author="Nasenbaer"
10descr=_"There is something mystical like a gray atmosphere around these three oases, which no one has found out about yet. Perhaps you will be the one, but be aware of the others who are searching too!"10descr=_"There is something mystical like a gray atmosphere around these three oases, which no one has found out about yet. Perhaps you will be the one, but be aware of the others who are searching too!"
11hint=11hint=
12tags="artifacts,ffa,official"12tags="artifacts,balanced,ffa,official"
1313
=== modified file 'data/maps/The_Pass_Through_the_Mountains.wmf/elemental'
--- data/maps/The_Pass_Through_the_Mountains.wmf/elemental 2016-10-31 09:34:27 +0000
+++ data/maps/The_Pass_Through_the_Mountains.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="Quappo"9author="Quappo"
10descr=_"In this mountainous area two princes have settled. Now they are expanding their territories, unaware of the fact that they are not alone!"10descr=_"In this mountainous area two princes have settled. Now they are expanding their territories, unaware of the fact that they are not alone!"
11hint=11hint=
12tags="1v1,artifacts,official"12tags="1v1,artifacts,balanced,official"
1313
=== modified file 'data/maps/The_Thaw.wmf/elemental'
--- data/maps/The_Thaw.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/The_Thaw.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="Another Barbarian"9author="Another Barbarian"
10descr=_"Another thaw set in. Three tribes were sheltering from severe winter among majestic mountains. At the time of the solstice they listened to the oracle and went to war. The only survivor will sacrifice his enemies’ treasures on the ancient altar, build there a splendid castle and gain the goodwill and respect of the Gods."10descr=_"Another thaw set in. Three tribes were sheltering from severe winter among majestic mountains. At the time of the solstice they listened to the oracle and went to war. The only survivor will sacrifice his enemies’ treasures on the ancient altar, build there a splendid castle and gain the goodwill and respect of the Gods."
11hint=11hint=
12tags="artifacts,ffa,official"12tags="artifacts,balanced,ffa,official"
1313
=== modified file 'data/maps/Three_Warriors.wmf/elemental'
--- data/maps/Three_Warriors.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/Three_Warriors.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="Quappo"9author="Quappo"
10descr=_"Mighty mountains divide this land into three fertile valleys. But a path connects the valleys and thus a fight seems inescapable!"10descr=_"Mighty mountains divide this land into three fertile valleys. But a path connects the valleys and thus a fight seems inescapable!"
11hint=_"Water can be found around the lakes."11hint=_"Water can be found around the lakes."
12tags="ffa,official"12tags="ffa,balanced,official"
1313
=== modified file 'data/maps/Together_We're_Strong.wmf/elemental'
--- data/maps/Together_We're_Strong.wmf/elemental 2016-03-29 18:23:38 +0000
+++ data/maps/Together_We're_Strong.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="Nasenbaer"9author="Nasenbaer"
10descr=_"The four mighty harbors of the Craw Islands have been trading their goods among each other for ages. All of them needed resources that they could not produce in their own territory and in exchange provided other resources to those that could not produce them. Based on these trades, a very friendly commerce was common between the four harbors and the people living on the Craw Islands – until recently, when two of the harbors united to form an exclusive trade alliance, forcing the other two to do the same. Suddenly, it seems only a matter of time before the first fights between the harbors will shatter the peaceful life that has lasted for so long…"10descr=_"The four mighty harbors of the Craw Islands have been trading their goods among each other for ages. All of them needed resources that they could not produce in their own territory and in exchange provided other resources to those that could not produce them. Based on these trades, a very friendly commerce was common between the four harbors and the people living on the Craw Islands – until recently, when two of the harbors united to form an exclusive trade alliance, forcing the other two to do the same. Suddenly, it seems only a matter of time before the first fights between the harbors will shatter the peaceful life that has lasted for so long…"
11hint=11hint=
12tags="1v1,artifacts,seafaring,official"12tags="1v1,artifacts,balanced,seafaring,official"
1313
=== modified file 'data/maps/Trident_of_Fire.wmf/elemental'
--- data/maps/Trident_of_Fire.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/Trident_of_Fire.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,7 +9,7 @@
9author="Robnick"9author="Robnick"
10descr=_"In the vicinity of three major volcanoes, six lovely islands are inviting settlers to start a new life. Deserts and a quickly growing forest wait to be discovered. But only by becoming a naval power will your tribe be able to explore enough resources to compete with its opponents."10descr=_"In the vicinity of three major volcanoes, six lovely islands are inviting settlers to start a new life. Deserts and a quickly growing forest wait to be discovered. But only by becoming a naval power will your tribe be able to explore enough resources to compete with its opponents."
11hint=11hint=
12tags="1v1,2teams,3teams,official,seafaring"12tags="1v1,2teams,3teams,balanced,official,seafaring"
1313
14[teams00]14[teams00]
15team1="1"15team1="1"
1616
=== modified file 'data/maps/Twin_Lagoons_v2.wmf/elemental'
--- data/maps/Twin_Lagoons_v2.wmf/elemental 2016-03-29 18:29:13 +0000
+++ data/maps/Twin_Lagoons_v2.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="fk"9author="fk"
10descr=_"When the wind swelled up and the first dunes were formed on these abandoned twin lagoons, nobody could have expected that two tribes that are desperately searching for more resources to support their endlessly ongoing wars, would end up in this forgotten place at the same time and for the same well-known reason."10descr=_"When the wind swelled up and the first dunes were formed on these abandoned twin lagoons, nobody could have expected that two tribes that are desperately searching for more resources to support their endlessly ongoing wars, would end up in this forgotten place at the same time and for the same well-known reason."
11hint=_"Defend your transport lines, or use ships to bypass the opponent. Then remove all enemy activity."11hint=_"Defend your transport lines, or use ships to bypass the opponent. Then remove all enemy activity."
12tags="1v1,seafaring,official"12tags="1v1,balanced,seafaring,official"
1313
=== modified file 'data/maps/Two_Frontiers.wmf/elemental'
--- data/maps/Two_Frontiers.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/Two_Frontiers.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="ISCH"9author="ISCH"
10descr=_"A multiplayer battle map on a small circle-shaped island."10descr=_"A multiplayer battle map on a small circle-shaped island."
11hint=11hint=
12tags="ffa,official"12tags="balanced,ffa,official"
1313
=== modified file 'data/maps/Volcanic_Winter.wmf/elemental'
--- data/maps/Volcanic_Winter.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/Volcanic_Winter.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="Nasenbaer"9author="Nasenbaer"
10descr=_"In the middle of summer, a series of volcanic eruptions drew the winter in. Suddenly, the sun seemed to be gone and the only light and heat sources left were those that enforced this dramatic change. Continents, oceans and seas are frozen now, only the volcanic islands seem to be left as habitable land."10descr=_"In the middle of summer, a series of volcanic eruptions drew the winter in. Suddenly, the sun seemed to be gone and the only light and heat sources left were those that enforced this dramatic change. Continents, oceans and seas are frozen now, only the volcanic islands seem to be left as habitable land."
11hint=11hint=
12tags="1v1,artifacts,official,seafaring"12tags="1v1,artifacts,balanced,official,seafaring"
1313
=== modified file 'data/maps/Wideworld.wmf/elemental'
--- data/maps/Wideworld.wmf/elemental 2016-03-25 09:45:18 +0000
+++ data/maps/Wideworld.wmf/elemental 2019-09-08 20:22:47 +0000
@@ -9,4 +9,4 @@
9author="Einstein13"9author="Einstein13"
10descr=_"The world is not enough! If you want to win, you have to send some ships. But remember: your opponents are very close to you."10descr=_"The world is not enough! If you want to win, you have to send some ships. But remember: your opponents are very close to you."
11hint=11hint=
12tags="seafaring,official"12tags="seafaring,official,balanced"
1313
=== modified file 'src/editor/ui_menus/main_menu_map_options.cc'
--- src/editor/ui_menus/main_menu_map_options.cc 2019-08-25 14:50:16 +0000
+++ src/editor/ui_menus/main_menu_map_options.cc 2019-09-08 20:22:47 +0000
@@ -78,10 +78,18 @@
78 name_(&main_box_, 0, 0, max_w_, UI::PanelStyle::kWui),78 name_(&main_box_, 0, 0, max_w_, UI::PanelStyle::kWui),
79 author_(&main_box_, 0, 0, max_w_, UI::PanelStyle::kWui),79 author_(&main_box_, 0, 0, max_w_, UI::PanelStyle::kWui),
80 size_(&main_box_, 0, 0, max_w_ - indent_, labelh_, ""),80 size_(&main_box_, 0, 0, max_w_ - indent_, labelh_, ""),
8181 balancing_dropdown_(&tags_box_,
82 "dropdown_balancing",
83 0,
84 0,
85 200,
86 50,
87 24,
88 "",
89 UI::DropdownType::kTextual,
90 UI::PanelStyle::kWui, UI::ButtonStyle::kWuiSecondary),
82 teams_list_(91 teams_list_(
83 &teams_box_, 0, 0, max_w_, 60, UI::PanelStyle::kWui, UI::ListselectLayout::kShowCheck),92 &teams_box_, 0, 0, max_w_, 60, UI::PanelStyle::kWui, UI::ListselectLayout::kShowCheck),
84
85 registry_(registry) {93 registry_(registry) {
8694
87 tab_box_.set_size(max_w_, get_inner_h() - labelh_ - 2 * padding_);95 tab_box_.set_size(max_w_, get_inner_h() - labelh_ - 2 * padding_);
@@ -120,13 +128,18 @@
120 main_box_.add_space(indent_);128 main_box_.add_space(indent_);
121129
122 tags_box_.add(new UI::Textarea(&tags_box_, 0, 0, max_w_, labelh_, _("Tags:")));130 tags_box_.add(new UI::Textarea(&tags_box_, 0, 0, max_w_, labelh_, _("Tags:")));
123 add_tag_checkbox(&tags_box_, "unbalanced", localize_tag("unbalanced"));
124 add_tag_checkbox(&tags_box_, "ffa", localize_tag("ffa"));131 add_tag_checkbox(&tags_box_, "ffa", localize_tag("ffa"));
125 add_tag_checkbox(&tags_box_, "1v1", localize_tag("1v1"));132 add_tag_checkbox(&tags_box_, "1v1", localize_tag("1v1"));
126 add_tag_checkbox(&tags_box_, "2teams", localize_tag("2teams"));133 add_tag_checkbox(&tags_box_, "2teams", localize_tag("2teams"));
127 add_tag_checkbox(&tags_box_, "3teams", localize_tag("3teams"));134 add_tag_checkbox(&tags_box_, "3teams", localize_tag("3teams"));
128 add_tag_checkbox(&tags_box_, "4teams", localize_tag("4teams"));135 add_tag_checkbox(&tags_box_, "4teams", localize_tag("4teams"));
129136
137 balancing_dropdown_.set_autoexpand_display_button();
138 balancing_dropdown_.add(localize_tag("balanced"), "balanced");
139 balancing_dropdown_.add(localize_tag("unbalanced"), "unbalanced");
140
141 tags_box_.add(&balancing_dropdown_);
142
130 teams_box_.add(new UI::Textarea(&teams_box_, 0, 0, max_w_, labelh_, _("Suggested Teams:")));143 teams_box_.add(new UI::Textarea(&teams_box_, 0, 0, max_w_, labelh_, _("Suggested Teams:")));
131 teams_box_.add(&teams_list_);144 teams_box_.add(&teams_list_);
132 // TODO(GunChleoc): We need team images in the listselect here,145 // TODO(GunChleoc): We need team images in the listselect here,
@@ -156,6 +169,8 @@
156 tag.second->changed.connect(boost::bind(&MainMenuMapOptions::changed, this));169 tag.second->changed.connect(boost::bind(&MainMenuMapOptions::changed, this));
157 }170 }
158171
172 balancing_dropdown_.selected.connect([this] { changed(); });
173
159 ok_.sigclicked.connect(boost::bind(&MainMenuMapOptions::clicked_ok, boost::ref(*this)));174 ok_.sigclicked.connect(boost::bind(&MainMenuMapOptions::clicked_ok, boost::ref(*this)));
160 cancel_.sigclicked.connect(boost::bind(&MainMenuMapOptions::clicked_cancel, boost::ref(*this)));175 cancel_.sigclicked.connect(boost::bind(&MainMenuMapOptions::clicked_cancel, boost::ref(*this)));
161176
@@ -183,6 +198,8 @@
183 for (auto tag : tags_checkboxes_) {198 for (auto tag : tags_checkboxes_) {
184 tag.second->set_state(tags.count(tag.first) > 0);199 tag.second->set_state(tags.count(tag.first) > 0);
185 }200 }
201
202 balancing_dropdown_.select(tags.count("balanced") ? "balanced" : "unbalanced");
186}203}
187204
188/**205/**
@@ -205,6 +222,7 @@
205 eia().egbase().mutable_map()->add_tag(tag.first);222 eia().egbase().mutable_map()->add_tag(tag.first);
206 }223 }
207 }224 }
225 eia().egbase().mutable_map()->add_tag(balancing_dropdown_.get_selected());
208 Notifications::publish(NoteMapOptions());226 Notifications::publish(NoteMapOptions());
209 registry_.destroy();227 registry_.destroy();
210}228}
211229
=== modified file 'src/editor/ui_menus/main_menu_map_options.h'
--- src/editor/ui_menus/main_menu_map_options.h 2019-06-01 09:55:57 +0000
+++ src/editor/ui_menus/main_menu_map_options.h 2019-09-08 20:22:47 +0000
@@ -24,6 +24,7 @@
24#include "ui_basic/box.h"24#include "ui_basic/box.h"
25#include "ui_basic/button.h"25#include "ui_basic/button.h"
26#include "ui_basic/checkbox.h"26#include "ui_basic/checkbox.h"
27#include "ui_basic/dropdown.h"
27#include "ui_basic/editbox.h"28#include "ui_basic/editbox.h"
28#include "ui_basic/listselect.h"29#include "ui_basic/listselect.h"
29#include "ui_basic/multilineeditbox.h"30#include "ui_basic/multilineeditbox.h"
@@ -63,10 +64,13 @@
63 UI::Textarea size_;64 UI::Textarea size_;
64 UI::MultilineEditbox* descr_;65 UI::MultilineEditbox* descr_;
65 UI::MultilineEditbox* hint_;66 UI::MultilineEditbox* hint_;
66 UI::Listselect<std::string> teams_list_;
6767
68 // Tag, Checkbox68 // Tag, Checkbox
69 std::map<std::string, UI::Checkbox*> tags_checkboxes_;69 std::map<std::string, UI::Checkbox*> tags_checkboxes_;
70 UI::Dropdown<std::string> balancing_dropdown_;
71
72 UI::Listselect<std::string> teams_list_;
73
70 UI::UniqueWindow::Registry& registry_;74 UI::UniqueWindow::Registry& registry_;
71};75};
7276
7377
=== modified file 'src/ui_basic/button.cc'
--- src/ui_basic/button.cc 2019-06-25 08:03:30 +0000
+++ src/ui_basic/button.cc 2019-09-08 20:22:47 +0000
@@ -63,7 +63,8 @@
63 assert(!get_can_focus());63 assert(!get_can_focus());
64}64}
6565
66Button::Button // for textual buttons. If h = 0, h will resize according to the font's height.66/// For textual buttons. If h = 0, h will resize according to the font's height. If both h = 0 and w = 0, will resize for text width as well.
67Button::Button
67 (Panel* const parent,68 (Panel* const parent,
68 const std::string& name,69 const std::string& name,
69 int32_t const x,70 int32_t const x,
@@ -86,12 +87,21 @@
86 tooltip_text,87 tooltip_text,
87 init_state,88 init_state,
88 UI::Button::ImageMode::kShrink) {89 UI::Button::ImageMode::kShrink) {
89 // Automatically resize for font height and give it a margin.90 if (h == 0) {
90 if (h < 1) {91 // Automatically resize for font height and give it a margin.
92 int new_width = get_w();
91 const int new_height =93 const int new_height =
92 text_height(g_gr->styles().button_style(init_style).enabled().font()) + 4;94 std::max(text_height(g_gr->styles().button_style(init_style).enabled().font()),
93 set_desired_size(w, new_height);95 text_height(g_gr->styles().button_style(init_style).disabled().font()))
94 set_size(w, new_height);96 + 4 * kButtonImageMargin;
97 if (w == 0) {
98 // Automatically resize for text width too.
99 new_width = std::max(text_width(richtext_escape(title_), style_->enabled().font()),
100 text_width(richtext_escape(title_), style_->disabled().font()))
101 + 8 * kButtonImageMargin;
102 }
103 set_desired_size(new_width, new_height);
104 set_size(new_width, new_height);
95 }105 }
96}106}
97107
98108
=== modified file 'src/ui_basic/dropdown.cc'
--- src/ui_basic/dropdown.cc 2019-07-28 11:33:50 +0000
+++ src/ui_basic/dropdown.cc 2019-09-08 20:22:47 +0000
@@ -98,7 +98,9 @@
98 label),98 label),
99 label_(label),99 label_(label),
100 type_(type),100 type_(type),
101 is_enabled_(true) {101 is_enabled_(true),
102 button_style_(button_style),
103 autoexpand_display_button_(false) {
102 if (label.empty()) {104 if (label.empty()) {
103 set_tooltip(pgettext("dropdown", "Select Item"));105 set_tooltip(pgettext("dropdown", "Select Item"));
104 } else {106 } else {
@@ -213,17 +215,30 @@
213 layout();215 layout();
214}216}
215217
218void BaseDropdown::set_autoexpand_display_button() {
219 autoexpand_display_button_ = true;
220}
221
216void BaseDropdown::add(const std::string& name,222void BaseDropdown::add(const std::string& name,
217 const uint32_t value,223 const uint32_t value,
218 const Image* pic,224 const Image* pic,
219 const bool select_this,225 const bool select_this,
220 const std::string& tooltip_text,226 const std::string& tooltip_text, const std::string& hotkey) {
221 const std::string& hotkey = std::string()) {
222 assert(pic != nullptr || type_ != DropdownType::kPictorial);227 assert(pic != nullptr || type_ != DropdownType::kPictorial);
223 list_->add(name, value, pic, select_this, tooltip_text, hotkey);228 list_->add(name, value, pic, select_this, tooltip_text, hotkey);
224 if (select_this) {229 if (select_this) {
225 set_value();230 set_value();
226 }231 }
232
233 if (autoexpand_display_button_) {
234 /// Fit width of display button to make enough room for the entry's text
235 const std::string fitme = label_.empty() ? name : (boost::format(_("%1%: %2%")) % label_ % name).str();
236 const int new_width = text_width(richtext_escape(fitme), g_gr->styles().button_style(button_style_).enabled().font()) + 8;
237 if (new_width > display_button_.get_w()) {
238 set_desired_size(get_w() + new_width - display_button_.get_w(), get_h());
239 set_size(get_w() + new_width - display_button_.get_w(), get_h());
240 }
241 }
227 layout();242 layout();
228}243}
229244
230245
=== modified file 'src/ui_basic/dropdown.h'
--- src/ui_basic/dropdown.h 2019-06-25 08:03:30 +0000
+++ src/ui_basic/dropdown.h 2019-09-08 20:22:47 +0000
@@ -141,6 +141,9 @@
141 void set_size(int nw, int nh) override;141 void set_size(int nw, int nh) override;
142 void set_desired_size(int w, int h) override;142 void set_desired_size(int w, int h) override;
143143
144 /// Expand display button to make enough room for each entry's text. Call this before adding yna entries.
145 void set_autoexpand_display_button();
146
144protected:147protected:
145 /// Add an element to the list148 /// Add an element to the list
146 /// \param name the display name of the entry149 /// \param name the display name of the entry
@@ -213,6 +216,8 @@
213 uint32_t current_selection_;216 uint32_t current_selection_;
214 DropdownType type_;217 DropdownType type_;
215 bool is_enabled_;218 bool is_enabled_;
219 ButtonStyle button_style_;
220 bool autoexpand_display_button_;
216};221};
217222
218/// A dropdown menu that lets the user select a value of the datatype 'Entry'.223/// A dropdown menu that lets the user select a value of the datatype 'Entry'.
219224
=== modified file 'src/ui_fsmenu/mapselect.cc'
--- src/ui_fsmenu/mapselect.cc 2019-05-26 17:21:15 +0000
+++ src/ui_fsmenu/mapselect.cc 2019-09-08 20:22:47 +0000
@@ -42,7 +42,7 @@
42FullscreenMenuMapSelect::FullscreenMenuMapSelect(GameSettingsProvider* const settings,42FullscreenMenuMapSelect::FullscreenMenuMapSelect(GameSettingsProvider* const settings,
43 GameController* const ctrl)43 GameController* const ctrl)
44 : FullscreenMenuLoadMapOrGame(),44 : FullscreenMenuLoadMapOrGame(),
45 checkbox_space_(25),45 checkbox_space_(20),
46 // Less padding for big fonts; space is tight.46 // Less padding for big fonts; space is tight.
47 checkbox_padding_(UI::g_fh->fontset()->size_offset() > 0 ? 0 : 2 * padding_),47 checkbox_padding_(UI::g_fh->fontset()->size_offset() > 0 ? 0 : 2 * padding_),
4848
@@ -68,7 +68,8 @@
68 basedir_(kMapsDir),68 basedir_(kMapsDir),
69 settings_(settings),69 settings_(settings),
70 ctrl_(ctrl),70 ctrl_(ctrl),
71 has_translated_mapname_(false) {71 has_translated_mapname_(false),
72 unspecified_balancing_found_(false) {
72 curdir_ = basedir_;73 curdir_ = basedir_;
73 if (settings_->settings().multiplayer) {74 if (settings_->settings().multiplayer) {
74 back_.set_tooltip(_("Return to the multiplayer game setup"));75 back_.set_tooltip(_("Return to the multiplayer game setup"));
@@ -89,52 +90,114 @@
8990
90 UI::Box* hbox = new UI::Box(&checkboxes_, 0, 0, UI::Box::Horizontal, checkbox_space_, get_w());91 UI::Box* hbox = new UI::Box(&checkboxes_, 0, 0, UI::Box::Horizontal, checkbox_space_, get_w());
9192
92 // Must be initialized before tag checkboxes93 show_all_maps_ = new UI::Button(hbox, "show_all_maps", 0, 0, 0, 0, UI::ButtonStyle::kFsMenuSecondary, _("Show all maps"));
93 cb_dont_localize_mapnames_ =94 cb_dont_localize_mapnames_ =
94 new UI::Checkbox(hbox, Vector2i::zero(), _("Show original map names"));95 new UI::Checkbox(hbox, Vector2i::zero(), _("Show original map names"));
95 cb_dont_localize_mapnames_->set_state(false);96 cb_dont_localize_mapnames_->set_state(false);
96 cb_dont_localize_mapnames_->changedto.connect(97
97 boost::bind(&FullscreenMenuMapSelect::fill_table, boost::ref(*this)));98 hbox->add(show_all_maps_, UI::Box::Resizing::kFullSize);
9899 hbox->add_space(checkbox_space_);
99 cb_show_all_maps_ = add_tag_checkbox(hbox, "blumba", _("Show all maps"));
100 tags_checkboxes_.clear(); // Remove this again, it is a special tag checkbox
101 cb_show_all_maps_->set_state(true);
102
103 hbox->add(cb_dont_localize_mapnames_, UI::Box::Resizing::kFullSize);100 hbox->add(cb_dont_localize_mapnames_, UI::Box::Resizing::kFullSize);
104 checkboxes_.add(hbox, UI::Box::Resizing::kFullSize);101 hbox->add_inf_space();
105102 checkboxes_.add(hbox, UI::Box::Resizing::kFullSize);
106 hbox = new UI::Box(&checkboxes_, 0, 0, UI::Box::Horizontal, checkbox_space_, get_w());103
107 add_tag_checkbox(hbox, "official", localize_tag("official"));104 // Row with dropdowns
108 add_tag_checkbox(hbox, "unbalanced", localize_tag("unbalanced"));105
106 hbox = new UI::Box(&checkboxes_, 0, 0, UI::Box::Horizontal, checkbox_space_, get_w());
107
108 official_tags_dropdown_ = new UI::Dropdown<std::string>(hbox,
109 "dropdown_official_tags",
110 0,
111 0,
112 200,
113 50,
114 24,
115 "",
116 UI::DropdownType::kTextual,
117 UI::PanelStyle::kFsMenu, UI::ButtonStyle::kFsMenuMenu);
118 official_tags_dropdown_->set_autoexpand_display_button();
119 official_tags_dropdown_->add(_("Official & Unofficial"), "");
120 official_tags_dropdown_->add(localize_tag("official"), "official");
121 official_tags_dropdown_->add(localize_tag("unofficial"), "unofficial");
122
123 hbox->add(official_tags_dropdown_, UI::Box::Resizing::kFullSize);
124
125 hbox->add_space(checkbox_space_);
126
127 team_tags_dropdown_ = new UI::Dropdown<std::string>(hbox,
128 "dropdown_team_tags",
129 0,
130 0,
131 200,
132 50,
133 24,
134 "",
135 UI::DropdownType::kTextual,
136 UI::PanelStyle::kFsMenu, UI::ButtonStyle::kFsMenuMenu);
137 team_tags_dropdown_->set_autoexpand_display_button();
138 team_tags_dropdown_->add(_("Any Teams"), "");
139 team_tags_dropdown_->add(localize_tag("ffa"), "ffa");
140 team_tags_dropdown_->add(localize_tag("1v1"), "1v1");
141 team_tags_dropdown_->add(localize_tag("2teams"), "2teams");
142 team_tags_dropdown_->add(localize_tag("3teams"), "3teams");
143 team_tags_dropdown_->add(localize_tag("4teams"), "4teams");
144
145 hbox->add(team_tags_dropdown_, UI::Box::Resizing::kFullSize);
146
147 hbox->add_space(checkbox_space_);
148
149 balancing_tags_dropdown_ = new UI::Dropdown<std::string>(hbox,
150 "dropdown_balancing",
151 0,
152 0,
153 200,
154 50,
155 24,
156 "",
157 UI::DropdownType::kTextual,
158 UI::PanelStyle::kFsMenu, UI::ButtonStyle::kFsMenuMenu);
159 balancing_tags_dropdown_->set_autoexpand_display_button();
160 rebuild_balancing_dropdown();
161
162 hbox->add(balancing_tags_dropdown_, UI::Box::Resizing::kFullSize);
163
164 checkboxes_.add(hbox, UI::Box::Resizing::kFullSize);
165
166 // Row with checkboxes
167
168 hbox = new UI::Box(&checkboxes_, 0, 0, UI::Box::Horizontal, checkbox_space_, get_w());
109 add_tag_checkbox(hbox, "seafaring", localize_tag("seafaring"));169 add_tag_checkbox(hbox, "seafaring", localize_tag("seafaring"));
110 add_tag_checkbox(hbox, "artifacts", localize_tag("artifacts"));170 add_tag_checkbox(hbox, "artifacts", localize_tag("artifacts"));
111 add_tag_checkbox(hbox, "scenario", localize_tag("scenario"));171 add_tag_checkbox(hbox, "scenario", localize_tag("scenario"));
112 checkboxes_.add(hbox, UI::Box::Resizing::kFullSize);172 hbox->add_inf_space();
113
114 hbox = new UI::Box(&checkboxes_, 0, 0, UI::Box::Horizontal, checkbox_space_, get_w());
115 add_tag_checkbox(hbox, "ffa", localize_tag("ffa"));
116 add_tag_checkbox(hbox, "1v1", localize_tag("1v1"));
117 checkboxes_.add(hbox, UI::Box::Resizing::kFullSize);
118
119 hbox = new UI::Box(&checkboxes_, 0, 0, UI::Box::Horizontal, checkbox_space_, get_w());
120 add_tag_checkbox(hbox, "2teams", localize_tag("2teams"));
121 add_tag_checkbox(hbox, "3teams", localize_tag("3teams"));
122 add_tag_checkbox(hbox, "4teams", localize_tag("4teams"));
123 checkboxes_.add(hbox, UI::Box::Resizing::kFullSize);173 checkboxes_.add(hbox, UI::Box::Resizing::kFullSize);
124174
125 table_.focus();175 table_.focus();
126 fill_table();176 clear_filter();
127177
128 // We don't need the unlocalizing option if there is nothing to unlocalize.178 // We don't need the unlocalizing option if there is nothing to unlocalize.
129 // We know this after the list is filled.179 // We know this after the list is filled.
130 cb_dont_localize_mapnames_->set_visible(has_translated_mapname_);180 cb_dont_localize_mapnames_->set_visible(has_translated_mapname_);
181
182 cb_dont_localize_mapnames_->changedto.connect(
183 boost::bind(&FullscreenMenuMapSelect::fill_table, boost::ref(*this)));
184
185 for (size_t i = 0; i < tags_checkboxes_.size(); ++i) {
186 tags_checkboxes_.at(i)->changedto.connect(boost::bind(&FullscreenMenuMapSelect::tagbox_changed, this, i, _1));
187 }
188
189 balancing_tags_dropdown_->selected.connect([this] { fill_table(); });
190 official_tags_dropdown_->selected.connect([this] { fill_table(); });
191 team_tags_dropdown_->selected.connect([this] { fill_table(); });
192 show_all_maps_->sigclicked.connect([this] { clear_filter(); });
193
131 layout();194 layout();
132}195}
133196
134void FullscreenMenuMapSelect::layout() {197void FullscreenMenuMapSelect::layout() {
135 title_.set_size(get_w(), title_.get_h());198 title_.set_size(get_w(), title_.get_h());
136 FullscreenMenuLoadMapOrGame::layout();199 FullscreenMenuLoadMapOrGame::layout();
137 checkboxes_y_ = tabley_ - 4 * (cb_show_all_maps_->get_h() + checkbox_padding_) - 2 * padding_;200 checkboxes_y_ = tabley_ - 3 * (team_tags_dropdown_->get_h() + checkbox_padding_) - 2 * padding_;
138 title_.set_pos(Vector2i(0, checkboxes_y_ / 3));201 title_.set_pos(Vector2i(0, checkboxes_y_ / 3));
139 checkboxes_.set_pos(Vector2i(tablex_, checkboxes_y_));202 checkboxes_.set_pos(Vector2i(tablex_, checkboxes_y_));
140 checkboxes_.set_size(get_w() - 2 * tablex_, tabley_ - checkboxes_y_);203 checkboxes_.set_size(get_w() - 2 * tablex_, tabley_ - checkboxes_y_);
@@ -222,6 +285,7 @@
222 */285 */
223void FullscreenMenuMapSelect::fill_table() {286void FullscreenMenuMapSelect::fill_table() {
224 has_translated_mapname_ = false;287 has_translated_mapname_ = false;
288 bool unspecified_balancing_found = false;
225289
226 maps_data_.clear();290 maps_data_.clear();
227291
@@ -272,9 +336,45 @@
272 has_translated_mapname_ || (mapdata.name != mapdata.localized_name);336 has_translated_mapname_ || (mapdata.name != mapdata.localized_name);
273337
274 bool has_all_tags = true;338 bool has_all_tags = true;
339 if (team_tags_dropdown_->has_selection()) {
340 const std::string selected_tag = team_tags_dropdown_->get_selected();
341 if (!selected_tag.empty()) {
342 has_all_tags &= mapdata.tags.count(selected_tag);
343 }
344 }
345 if (official_tags_dropdown_->has_selection()) {
346 const std::string selected_tag = official_tags_dropdown_->get_selected();
347 if (!selected_tag.empty()) {
348 if (selected_tag == "official") {
349 has_all_tags &= mapdata.tags.count("official");
350 } else {
351 has_all_tags &= !mapdata.tags.count("official");
352 }
353 }
354 }
355 if (balancing_tags_dropdown_->has_selection()) {
356 const std::string selected_tag = balancing_tags_dropdown_->get_selected();
357 if (!selected_tag.empty()) {
358 if (selected_tag == "unspecified") {
359 has_all_tags &= !mapdata.tags.count("balanced");
360 has_all_tags &= !mapdata.tags.count("unbalanced");
361 } else {
362 has_all_tags &= mapdata.tags.count(selected_tag);
363 }
364 }
365 }
366 // Backwards compatibility
367 if (!mapdata.tags.count("balanced") && !mapdata.tags.count("unbalanced")) {
368 unspecified_balancing_found = true;
369 } else if (mapdata.tags.count("balanced") && mapdata.tags.count("unbalanced")) {
370 log("WARNING: Map '%s' is both balanced and unbalanced - please fix the 'elemental' packet\n", mapfilename.c_str());
371 }
372
275 for (std::set<uint32_t>::const_iterator it = req_tags_.begin(); it != req_tags_.end();373 for (std::set<uint32_t>::const_iterator it = req_tags_.begin(); it != req_tags_.end();
276 ++it)374 ++it) {
277 has_all_tags &= mapdata.tags.count(tags_ordered_[*it]);375 has_all_tags &= mapdata.tags.count(tags_ordered_[*it]);
376 }
377
278 if (!has_all_tags) {378 if (!has_all_tags) {
279 continue;379 continue;
280 }380 }
@@ -298,6 +398,10 @@
298 table_.select(0);398 table_.select(0);
299 }399 }
300 set_has_selection();400 set_has_selection();
401 if (unspecified_balancing_found != unspecified_balancing_found_) {
402 unspecified_balancing_found_ = unspecified_balancing_found;
403 rebuild_balancing_dropdown();
404 }
301}405}
302406
303/*407/*
@@ -305,11 +409,9 @@
305 */409 */
306UI::Checkbox*410UI::Checkbox*
307FullscreenMenuMapSelect::add_tag_checkbox(UI::Box* box, std::string tag, std::string displ_name) {411FullscreenMenuMapSelect::add_tag_checkbox(UI::Box* box, std::string tag, std::string displ_name) {
308 int32_t id = tags_ordered_.size();
309 tags_ordered_.push_back(tag);412 tags_ordered_.push_back(tag);
310413
311 UI::Checkbox* cb = new UI::Checkbox(box, Vector2i::zero(), displ_name);414 UI::Checkbox* cb = new UI::Checkbox(box, Vector2i::zero(), displ_name);
312 cb->changedto.connect(boost::bind(&FullscreenMenuMapSelect::tagbox_changed, this, id, _1));
313415
314 box->add(cb, UI::Box::Resizing::kFullSize);416 box->add(cb, UI::Box::Resizing::kFullSize);
315 box->add_space(checkbox_space_);417 box->add_space(checkbox_space_);
@@ -322,24 +424,39 @@
322 * One of the tagboxes has changed424 * One of the tagboxes has changed
323 */425 */
324void FullscreenMenuMapSelect::tagbox_changed(int32_t id, bool to) {426void FullscreenMenuMapSelect::tagbox_changed(int32_t id, bool to) {
325 if (id == 0) { // Show all maps checbox427 if (to) {
326 if (to) {428 req_tags_.insert(id);
327 for (UI::Checkbox* checkbox : tags_checkboxes_) {429 } else {
328 checkbox->set_state(false);430 req_tags_.erase(id);
329 }431 }
330 }432
331 } else { // Any tag433 fill_table();
332 if (to) {434}
333 req_tags_.insert(id);435
334 } else {436void FullscreenMenuMapSelect::clear_filter() {
335 req_tags_.erase(id);437 req_tags_.clear();
336 }438 for (UI::Checkbox* checkbox : tags_checkboxes_) {
337 }439 checkbox->set_state(false);
338 if (req_tags_.empty()) {440 }
339 cb_show_all_maps_->set_state(true);441
340 } else {442 balancing_tags_dropdown_->select("");
341 cb_show_all_maps_->set_state(false);443 official_tags_dropdown_->select("");
342 }444 team_tags_dropdown_->select("");
343445 fill_table();
344 fill_table();446}
447
448void FullscreenMenuMapSelect::rebuild_balancing_dropdown() {
449 const std::string selected = balancing_tags_dropdown_->has_selection() ? balancing_tags_dropdown_->get_selected() : "";
450 balancing_tags_dropdown_->clear();
451 balancing_tags_dropdown_->add(_("Balanced & Unbalanced"), "");
452 balancing_tags_dropdown_->add(localize_tag("balanced"), "balanced");
453 balancing_tags_dropdown_->add(localize_tag("unbalanced"), "unbalanced");
454 if (unspecified_balancing_found_) {
455 // Backwards compatibility with old maps
456 balancing_tags_dropdown_->add(pgettext("balancing", "Unspecified"), "unspecified");
457 balancing_tags_dropdown_->select(selected);
458 } else {
459 balancing_tags_dropdown_->select(selected == "unspecified" ? "" : selected);
460 fill_table();
461 }
345}462}
346463
=== modified file 'src/ui_fsmenu/mapselect.h'
--- src/ui_fsmenu/mapselect.h 2019-02-23 11:00:49 +0000
+++ src/ui_fsmenu/mapselect.h 2019-09-08 20:22:47 +0000
@@ -25,6 +25,7 @@
2525
26#include "ui_basic/box.h"26#include "ui_basic/box.h"
27#include "ui_basic/checkbox.h"27#include "ui_basic/checkbox.h"
28#include "ui_basic/dropdown.h"
28#include "ui_basic/textarea.h"29#include "ui_basic/textarea.h"
29#include "ui_fsmenu/base.h"30#include "ui_fsmenu/base.h"
30#include "ui_fsmenu/load_map_or_game.h"31#include "ui_fsmenu/load_map_or_game.h"
@@ -62,6 +63,8 @@
62 bool set_has_selection();63 bool set_has_selection();
63 UI::Checkbox* add_tag_checkbox(UI::Box*, std::string, std::string);64 UI::Checkbox* add_tag_checkbox(UI::Box*, std::string, std::string);
64 void tagbox_changed(int32_t, bool);65 void tagbox_changed(int32_t, bool);
66 void clear_filter();
67 void rebuild_balancing_dropdown();
6568
66 int32_t const checkbox_space_;69 int32_t const checkbox_space_;
67 const int checkbox_padding_;70 const int checkbox_padding_;
@@ -84,9 +87,16 @@
84 UI::Checkbox* cb_dont_localize_mapnames_;87 UI::Checkbox* cb_dont_localize_mapnames_;
85 bool has_translated_mapname_;88 bool has_translated_mapname_;
8689
87 UI::Checkbox* cb_show_all_maps_;90 UI::Button* show_all_maps_;
88 std::vector<UI::Checkbox*> tags_checkboxes_;91 std::vector<UI::Checkbox*> tags_checkboxes_;
8992
93 UI::Dropdown<std::string>* official_tags_dropdown_;
94
95 UI::Dropdown<std::string>* balancing_tags_dropdown_;
96 bool unspecified_balancing_found_; // Backwards compatibility
97
98 UI::Dropdown<std::string>* team_tags_dropdown_;
99
90 std::vector<std::string> tags_ordered_;100 std::vector<std::string> tags_ordered_;
91 std::set<uint32_t> req_tags_;101 std::set<uint32_t> req_tags_;
92102
93103
=== modified file 'src/wui/map_tags.cc'
--- src/wui/map_tags.cc 2019-02-23 11:00:49 +0000
+++ src/wui/map_tags.cc 2019-09-08 20:22:47 +0000
@@ -27,6 +27,10 @@
27 /** TRANSLATORS: This is a map tag */27 /** TRANSLATORS: This is a map tag */
28 {"official", _("Official")},28 {"official", _("Official")},
29 /** TRANSLATORS: This is a map tag */29 /** TRANSLATORS: This is a map tag */
30 {"unofficial", _("Unofficial")},
31 /** TRANSLATORS: This is a map tag */
32 {"balanced", _("Balanced")},
33 /** TRANSLATORS: This is a map tag */
30 {"unbalanced", _("Unbalanced")},34 {"unbalanced", _("Unbalanced")},
31 /** TRANSLATORS: This is a map tag */35 /** TRANSLATORS: This is a map tag */
32 {"seafaring", _("Seafaring")},36 {"seafaring", _("Seafaring")},

Subscribers

People subscribed via source and target branches

to status/vote changes: