Opened 16 months ago

Last modified 16 months ago

#6692 new defect

Open the correct structure tree when you click on the emblem

Reported by: Langbart Owned by:
Priority: Should Have Milestone: Alpha 27
Component: UI – In-game Keywords: simple
Cc: Patch:

Description (last modified by Langbart)

reported by RangerK in the forum: Alpha26 feedback and suggested changes (5/Jan/23)

When watching a multiplayer replay, when you click on a player's civilization emblem, it opens the structure tree of the previously opened civilization.

to reproduce

  • watch a multiplayer replay
  • switch to observation mode of a player playing, say the the Mauryas
  • In the top-center, you'll see their civilization emblem and you can click it to open their structure tree
  • Close the structure tree and switch to observation mode of a player playing the Roman
  • Click their civilization emblem. It'll open the Mauryas structure tree instead of the Roman one.

expected behavior

  • if you click on the emblem, the correct structure tree should be displayed

answered by s0600204

bisect

Intentional (by design of the session UI, not the Structure Tree), and dates back to this Revision - Phab:D846 (29/Aug/17)

Easily changed by altering this line of code.

gui/session/top_panel/CivIcon.js$40

Line 
35 Engine.PushGuiPage(
36 page,
37 {
38 // If an Observer triggers `openPage()` via hotkey, g_ViewedPlayer could be -1 or 0
39 // (depending on whether they're "viewing" no-one or gaia respectively)
40 "civ": this.dialogSelection.civ || g_Players[Math.max(g_ViewedPlayer, 1)].civ,
41
42 // TODO add info about researched techs and unlocked entities
43 },
44 this.storePageSelection.bind(this));
45 }

possible solution

see comment:4 by s0600204

  • binaries/data/mods/public/gui/session/top_panel/CivIcon.js

    a b class CivIcon  
    3737            {
    3838                // If an Observer triggers `openPage()` via hotkey, g_ViewedPlayer could be -1 or 0
    3939                // (depending on whether they're "viewing" no-one or gaia respectively)
    40                 "civ": this.dialogSelection.civ || g_Players[Math.max(g_ViewedPlayer, 1)].civ,
     40                "civ": g_ViewedPlayer > 0 ? g_Players[g_ViewedPlayer].civ : this.dialogSelection.civ || g_Players[1].civ,
    4141
    4242                // TODO add info about researched techs and unlocked entities
    4343            },

Attachments (1)

struct.png (70.7 KB ) - added by Langbart 16 months ago.

Download all attachments as: .zip

Change History (9)

by Langbart, 16 months ago

Attachment: struct.png added

comment:1 by Langbart, 16 months ago

Description: modified (diff)

Set date and title of the link to the forum

comment:2 by Freagarach, 16 months ago

Description: modified (diff)

Mind that the tooltip should not show "Last opened will be reopened on click." then.

comment:3 by Freagarach, 16 months ago

Description: modified (diff)

Sorry for the diff of the description.

comment:4 by s0600204, 16 months ago

The tooltip refers to the fact the button can also open the "Civilisation History" page, and will reopen that if it was opened last, not that it will show the last civ viewed.

In the possible solution g_Players[Math.max(g_ViewedPlayer, 1)].civ can be reduced down to g_Players[1].civ, as the case of g_Players[g_ViewedPlayer].civ has already been dealt with by that point.

in reply to:  4 comment:5 by Freagarach, 16 months ago

Replying to s0600204:

The tooltip refers to the fact the button can also open the "Civilisation History" page, and will reopen that if it was opened last, not that it will show the last civ viewed.

Depends on how one reads it, I guess. I read it as: The exact same page is openened as was open when you closed it. Which is easy when comparing stuff. Anyway, I don't care much.

comment:6 by Langbart, 16 months ago

Description: modified (diff)
  • update possible solution

comment:7 by Langbart, 16 months ago

Can't you just leave out the last part, people will figure it out for themselves.

  • binaries/data/mods/public/gui/session/top_panel/CivIcon.js

    a b class CivIcon  
    7777}
    7878
    7979CivIcon.prototype.Tooltip =
    80     markForTranslation("%(civ)s\n%(hotkey_civinfo)s / %(hotkey_structree)s: View Civilization Overview / Structure Tree\nLast opened will be reopened on click.");
     80    markForTranslation("%(civ)s\n%(hotkey_civinfo)s / %(hotkey_structree)s: View Civilization Overview / Structure Tree");
    8181
    8282CivIcon.prototype.CivTags = { "font": "sans-bold-stroke-14" };

Up to the patch maker.

comment:8 by Langbart, 16 months ago

Keywords: simple added
Note: See TracTickets for help on using tickets.