1
0
forked from 0ad/0ad

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:
Stan 2022-10-23 16:50:30 +00:00
parent 5d15f50fa7
commit dd15a65fcd
3 changed files with 23 additions and 1 deletions

View File

@ -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"

View File

@ -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`;
}
}

View File

@ -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). -->