Civ backgrounds for minimap
Comments by: @marder, @Freagarach Differential Revision: https://code.wildfiregames.com/D4271 This was SVN commit r27169.
This commit is contained in:
parent
5d15f50fa7
commit
dd15a65fcd
@ -13,6 +13,14 @@
|
||||
ghost="true"
|
||||
/>
|
||||
|
||||
<!-- Civ background image -->
|
||||
<object
|
||||
name="minimapBackgroundTexture"
|
||||
type="image"
|
||||
size="4 4 100%-4 100%-4"
|
||||
ghost="true"
|
||||
/>
|
||||
|
||||
<!-- Idle Worker Button -->
|
||||
<object name="idleWorkerButton"
|
||||
type="button"
|
||||
|
@ -9,6 +9,8 @@ class MiniMapPanel
|
||||
this.idleWorkerButton = new MiniMapIdleWorkerButton(playerViewControl, idleWorkerClasses);
|
||||
this.flareButton = new MiniMapFlareButton(playerViewControl);
|
||||
this.miniMap = new MiniMap();
|
||||
playerViewControl.registerViewedPlayerChangeHandler(this.rebuild.bind(this));
|
||||
registerHotkeyChangeHandler(this.rebuild.bind(this));
|
||||
}
|
||||
|
||||
flare(target, playerID)
|
||||
@ -20,4 +22,16 @@ class MiniMapPanel
|
||||
{
|
||||
return this.miniMap.isMouseOverMiniMap();
|
||||
}
|
||||
|
||||
rebuild()
|
||||
{
|
||||
this.setCivBackgroundTexture();
|
||||
}
|
||||
|
||||
setCivBackgroundTexture()
|
||||
{
|
||||
const playerCiv = g_ViewedPlayer > 0 ? g_Players[g_ViewedPlayer].civ : "gaia";
|
||||
const backgroundObject = Engine.GetGUIObjectByName("minimapBackgroundTexture");
|
||||
backgroundObject.sprite = `stretched:session/icons/bkg/background_circle_${playerCiv}.png`;
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@
|
||||
<object size="50%-512 0 50%+512 100%">
|
||||
|
||||
<object size="50%-512 100%-200 50%-312 100%">
|
||||
<include directory="gui/session/minimap/"/>
|
||||
<include file="gui/session/minimap/MiniMap.xml"/>
|
||||
</object>
|
||||
|
||||
<!-- Supplemental Details Panel (left). -->
|
||||
|
Loading…
Reference in New Issue
Block a user