Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#3805 closed enhancement (fixed)

[PATCH] Gamesetup - reset-civilizations button

Reported by: elexis Owned by: elexis
Priority: Nice to Have Milestone: Alpha 21
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

With persist-matchsettings (which are enabled by default), the chosen civilizations of the previous game are restored on init.

When players join, they immediately pick cvilizations. This leads to a situation where the host can't be sure which cvilizations were restored from the matchsettings, while some were chosen specifically by players.

Hence a good host should reset the civs when not rehosting a match. (Disabling the persist-matchsettings is not preferable, since the options independent from the player-assignments typcially stay the same.)

Therefore, it would be nice to have a button "Reset civilizations" to the default (currently "random").

The button could be placed left besides the "More Options" button. (If more buttons are added later, they can be placed into a separate row).

Attachments (7)

resetcivsbutton.patch (1.8 KB ) - added by Sandarac 8 years ago.
reset.png (3.0 KB ) - added by Lionkanzen 8 years ago.
reset256x256.png (15.7 KB ) - added by Lionkanzen 8 years ago.
resetcivsbutton_v2.patch (3.1 KB ) - added by Sandarac 8 years ago.
reset256x256.2.png (14.0 KB ) - added by elexis 8 years ago.
Horizontally mirrored version (as used in the commit, besides the higher res)
resetcivsbutton_v3.patch (823 bytes ) - added by Sandarac 8 years ago.
Right side of button is not selectable. This fixes that.
reset256x256 - 3.png (15.1 KB ) - added by Lionkanzen 8 years ago.

Download all attachments as: .zip

Change History (27)

by Sandarac, 8 years ago

Attachment: resetcivsbutton.patch added

comment:1 by Sandarac, 8 years ago

Keywords: review patch added
Milestone: BacklogAlpha 21
Summary: Gamesetup - reset-civilizations button[PATCH] Gamesetup - reset-civilizations button

comment:2 by elexis, 8 years ago

Keywords: art added; review removed
  • We probably need an icon.

The button is too small for that much text (especially if you might consider that translations might use more space). But I'm even more concerned about the fact that no matter where we would place the button, it would look ugly unless we use an icon. It could be right beside the "i" icon above the civilizations. Probably not an "r" with a circle around it, as the translation of "reset" might have different initial letters. It could be an arrow, something like http://www.endlessicons.com/free-icons/reset-icon/

  • By implementing #2982, we would eliminate the need for this button. The primary use case for this button is that everytime we start a multiplayergame (with persist-match-settings enabled), the civs of the last match are restored while the joining players actually want something else. If we remember which playername had which civ and assign the default otherwise, we wouldn't need the button as often anymore. Also if we can allow players to pick their own civs, the host doesn't have to reset them either #3806. However if someone finds / makes a nice icon and a working patch, I might be inclined to commit it.

Code:

  • parenthesis in L1806 + 1808 not needed
  • updateGUIObjects => I'm pretty sure that this won't be enough for multiplayer, you will most certainly have to call updateGameAttributes instead (if you're not on windows you can test by starting 0AD twice, hosting with one instance and joining with the other)

Thanks writing patches for 0 A.D.!

comment:3 by Lionkanzen, 8 years ago

Where you can use/place this icon? I can use the same modificated by the screen where you want reset/revert...

comment:4 by elexis, 8 years ago

Right beside the civilization info button, above the dropdowns.

comment:5 by Lionkanzen, 8 years ago

The icon will be over a button right? Similar to gear for Ai setup?

My idea is do an white or kind of golden version . Need be same size as info icon right?

comment:6 by elexis, 8 years ago

Yes, the icon would be used as a button, like the civinfo thing and would be displayed with the same size. However having icons of bigger sizes would be better for high resolution displays and also means that someone can reuse the icon somewhere else. Just make sure that it will look ok when scaled to the size of the civ-info icon.

comment:7 by Lionkanzen, 8 years ago

ok i take the example in the page http://www.endlessicons.com/free-icons/reset-icon/ I try to give the same feeling like info.png ,I do two version 16x16 and 256x256 I preserved the svg file for me and here is.

by Lionkanzen, 8 years ago

Attachment: reset.png added

by Lionkanzen, 8 years ago

Attachment: reset256x256.png added

by Sandarac, 8 years ago

Attachment: resetcivsbutton_v2.patch added

comment:8 by Niek, 8 years ago

If I may add a comment: I think it would be more logical to mirror the icon horizontally since it now associates with the 'redo' function in MS Office. (While an association with the undo function might be more fitting). Nice icon nonetheless!

comment:9 by elexis, 8 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 18239:

Add a button to the gamesetup to reset the selected civilizations of all players to random.
Code by Sandarac, icon by Lionkanzen, fixes #3805.

comment:10 by elexis, 8 years ago

Keywords: simple art removed

Thanks for the patch Sandarac!

Notice there were two missing semicolons in JS and XML, some trailing whitespace in the XML and JS and using the variable notScenario few lines below made the code a bit shorter and more consistent.

Thanks to Lionkanzen for providing an icon quickly which was essential to finish the ticket! I will ask our artists if they can commit the 256px version to art_source.

by elexis, 8 years ago

Attachment: reset256x256.2.png added

Horizontally mirrored version (as used in the commit, besides the higher res)

comment:11 by Sandarac, 8 years ago

Keywords: review added
Resolution: fixed
Status: closedreopened

by Sandarac, 8 years ago

Attachment: resetcivsbutton_v3.patch added

Right side of button is not selectable. This fixes that.

comment:12 by elexis, 8 years ago

In 18240:

Reduce the size of the "Team" label to not overlap the reset-civ button when using 1024x768. Patch by Sandarac, refs #3805.

comment:13 by elexis, 8 years ago

Keywords: review removed
Resolution: fixed
Status: reopenedclosed

comment:14 by Niek, 8 years ago

Hehe, that's the vertically mirrored version that's committed :D

by Lionkanzen, 8 years ago

Attachment: reset256x256 - 3.png added

comment:15 by Lionkanzen, 8 years ago

updated version 3

comment:16 by elexis, 8 years ago

In 18244:

Rotate icon, refs #3805.

comment:17 by elexis, 8 years ago

In 18459:

Also add a reset-teams button for consistency, refs #3805.

comment:18 by elexis, 8 years ago

In 18739:

Gamesetup player assignment column header position adjustment for the smallest supported resolution 1024x768.

Increase the size of the color label by stealing some space from neighboring fields,
so it works for all translations with the minimum resolution, fixes #3761, refs #1580.

Right-align civ-info and reset buttons with the dropdowns for consistent appearance, refs #3805.
Ensure column headers/buttons can't overlap by giving neighboring fields identical left/right values.

comment:19 by elexis, 8 years ago

In 18745:

Add click button sound to the gamesetup icon buttons and credits page. Patch by Vladislav, fixes #4222, refs #3805, #3744.

comment:20 by elexis, 5 years ago

In 22827:

Gamesetup OOP refactoring, refs #5322.

Move rightAlignCancelButton from rP18701 to g_MiscControls from D322 / rP19504.
Move civResetButton from rP18239 and teamResetButton from rP18459 to g_MiscControls, refs #3805.
The constant string and constant function value assignment can be reverted if performance is valued over code structuring.

Note: See TracTickets for help on using tickets.