Opened 21 months ago

Closed 18 months ago

Last modified 14 months 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 18 months ago.
reset.png (3.0 KB) - added by Lionkanzen 18 months ago.
reset256x256.png (15.7 KB) - added by Lionkanzen 18 months ago.
resetcivsbutton_v2.patch (3.1 KB) - added by Sandarac 18 months ago.
reset256x256.2.png (14.0 KB) - added by elexis 18 months ago.
Horizontally mirrored version (as used in the commit, besides the higher res)
resetcivsbutton_v3.patch (823 bytes) - added by Sandarac 18 months ago.
Right side of button is not selectable. This fixes that.
reset256x256 - 3.png (15.1 KB) - added by Lionkanzen 18 months ago.

Download all attachments as: .zip

Change History (26)

Changed 18 months ago by Sandarac

Attachment: resetcivsbutton.patch added

comment:1 Changed 18 months ago by Sandarac

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

comment:2 Changed 18 months ago by elexis

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 Changed 18 months ago by Lionkanzen

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

comment:4 Changed 18 months ago by elexis

Right beside the civilization info button, above the dropdowns.

comment:5 Changed 18 months ago by Lionkanzen

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 Changed 18 months ago by elexis

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 Changed 18 months ago by Lionkanzen

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.

Changed 18 months ago by Lionkanzen

Attachment: reset.png added

Changed 18 months ago by Lionkanzen

Attachment: reset256x256.png added

Changed 18 months ago by Sandarac

Attachment: resetcivsbutton_v2.patch added

comment:8 Changed 18 months ago by Niek

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 Changed 18 months ago by elexis

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 Changed 18 months ago by elexis

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.

Changed 18 months ago by elexis

Attachment: reset256x256.2.png added

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

comment:11 Changed 18 months ago by Sandarac

Keywords: review added
Resolution: fixed
Status: closedreopened

Changed 18 months ago by Sandarac

Attachment: resetcivsbutton_v3.patch added

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

comment:12 Changed 18 months ago by elexis

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 Changed 18 months ago by elexis

Keywords: review removed
Resolution: fixed
Status: reopenedclosed

comment:14 Changed 18 months ago by Niek

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

Changed 18 months ago by Lionkanzen

Attachment: reset256x256 - 3.png added

comment:15 Changed 18 months ago by Lionkanzen

updated version 3

comment:16 Changed 18 months ago by elexis

In 18244:

Rotate icon, refs #3805.

comment:17 Changed 17 months ago by elexis

In 18459:

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

comment:18 Changed 14 months ago by elexis

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 Changed 14 months ago by elexis

In 18745:

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

Note: See TracTickets for help on using tickets.