This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Opened 20 months ago

Last modified 20 months ago

#6692 new defect

Open the correct structure tree when you click on the emblem — at Version 2

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

Description (last modified by Freagarach)

reported by RangerK in the forum: resourcesUsed counter bug (21/Dec/22)

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 (not from 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[Math.max(g_ViewedPlayer, 1)].civ,
    4141
    4242                // TODO add info about researched techs and unlocked entities
    4343            },

Change History (3)

by Langbart, 20 months ago

Attachment: struct.png added

comment:1 by Langbart, 20 months ago

Description: modified (diff)

Set date and title of the link to the forum

comment:2 by Freagarach, 20 months ago

Description: modified (diff)

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

Note: See TracTickets for help on using tickets.