Ticket #3101: structTreeSession.patch

File structTreeSession.patch, 1.9 KB (added by Loïc Lopes, 9 years ago)
  • binaries/data/mods/public/gui/session/civ_icon.js

     
     1function openTreeInSession()
     2{
     3    Engine.PushGuiPage("page_structree.xml", {"defaultSelectedCiv": g_Players[Engine.GetPlayerID()].civ});
     4}
     5 No newline at end of file
  • binaries/data/mods/public/gui/session/top_panel/civ_icon.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    2 <object size="50%-48 -26 50%+48 70" name="civIcon" type="image" tooltip_style="sessionToolTipBold"/>
     2
     3<object type="button"
     4    size="50%-48 -26 50%+48 70"
     5    name="civIcon"
     6    tooltip_style="sessionToolTipBold"
     7>
     8    <action on="Press">openTreeInSession();</action>
     9</object>
  • binaries/data/mods/public/gui/structree/structree.js

     
    1212/**
    1313 * Initialize the dropdown containing all the available civs
    1414 */
    15 function init()
     15function init(data)
    1616{
    1717    g_CivData = loadCivData(true);
    1818
     
    3232    civSelection.list = civListNames;
    3333    civSelection.list_data = civListCodes;
    3434    civSelection.selected = 0;
     35
     36    if(data !== undefined && data.defaultSelectedCiv !== undefined && data.defaultSelectedCiv !== "")
     37    {
     38        civSelection.selected = civListCodes.indexOf(data.defaultSelectedCiv);
     39        selectCiv(data.defaultSelectedCiv);
     40    }
    3541}
    3642
    3743function selectCiv(civCode)