Skip to content

Commit

Permalink
Hide emblem box if no emblem URL is available for team info
Browse files Browse the repository at this point in the history
  • Loading branch information
araszka committed Jul 27, 2024
1 parent 1999a5d commit d8e599e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
11 changes: 8 additions & 3 deletions src/Modules/TeamInfoModule/Templates/Components/TeamFullName.mt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<component>
<using namespace="GbxRemoteNet.Structs"/>

<import component="EvoSC.Drawing.Rectangle" as="Rectangle"/>

<property type="TmTeamInfo" name="teamInfo"/>
<property type="double" name="width" default="40.0"/>
<property type="double" name="width" default="45.0"/>
<property type="double" name="height" default="10.0"/>
<property type="double" name="barHeight" default="1.0"/>
<property type="double" name="x" default="0.0"/>
Expand All @@ -11,8 +13,11 @@

<template>
<frame pos='{{ x - (halign=="right" ? width : 0) }} {{ y }}'>
<quad size="{{ width }} {{ height }}"
bgcolor="{{ teamInfo.RGB }}"
<Rectangle width="{{ width }}"
height="{{ height }}"
bgColor="{{ teamInfo.RGB }}"
cornerRadius="0.75"
corners='{{ string.IsNullOrEmpty(teamInfo.EmblemUrl) ? (halign=="right" ? "BottomLeft" : "BottomRight") : "" }}'
/>
<quad pos='{{ halign=="right" ? 0 : width }} {{ halign=="right" ? -height : -barHeight }}'
rot='{{ halign=="right" ? -90 : 90 }}'
Expand Down
10 changes: 6 additions & 4 deletions src/Modules/TeamInfoModule/Templates/TeamInfoWidget.mt
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@
teamInfo="{{ team1 }}"
halign="right"
/>
<frame pos="{{ settings.CompactMode ? 0.0 : -40.0 }} 0">
<EmblemBox x="-22.0"
<frame pos="{{ settings.CompactMode ? 0.0 : -45.0 }} 0">
<EmblemBox if="!string.IsNullOrEmpty(team1.EmblemUrl)"
x="-22.0"
teamInfo="{{ team1 }}"
halign="right"
/>
Expand All @@ -68,8 +69,9 @@
x="22.0"
teamInfo="{{ team2 }}"
/>
<frame pos="{{ settings.CompactMode ? 0.0 : 40.0 }} 0">
<EmblemBox x="22.0"
<frame pos="{{ settings.CompactMode ? 0.0 : 45.0 }} 0">
<EmblemBox if="!string.IsNullOrEmpty(team2.EmblemUrl)"
x="22.0"
teamInfo="{{ team2 }}"
/>
<MatchPointBox if="team2MatchPoint"
Expand Down

0 comments on commit d8e599e

Please sign in to comment.