Skip to content

Commit

Permalink
Replace whole decimal numbers with f annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
araszka committed Dec 1, 2024
1 parent cf2fb60 commit 75130f5
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 57 deletions.
10 changes: 5 additions & 5 deletions src/Modules/ScoreboardModule/Templates/Components/Body/Legend.mt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<component>
<property type="double" name="width"/>
<property type="double" name="height"/>
<property type="double" name="columnSpacing" default="2.0"/>
<property type="double" name="columnSpacing" default="2f"/>
<property type="double" name="positionBoxWidth" default="9.6"/>
<property type="double" name="flagWidth" default="9.6"/>
<property type="double" name="clubTagWidth" default="9.6"/>
Expand All @@ -13,7 +13,7 @@
/>
<label text="POS"
class="text-primary"
pos="{{ positionBoxWidth/2.0 }} {{ height / -2 + 0.25 }}"
pos="{{ positionBoxWidth/2f }} {{ height / -2 + 0.25 }}"
halign="center"
valign="center"
textsize="{{ Theme.UI_FontSize*0.2 }}"
Expand All @@ -22,7 +22,7 @@
/>
<label text="NAT."
class="text-primary"
pos="{{ positionBoxWidth+columnSpacing+(flagWidth/2.0) }} {{ height / -2 + 0.25 }}"
pos="{{ positionBoxWidth+columnSpacing+(flagWidth/2f) }} {{ height / -2 + 0.25 }}"
halign="center"
valign="center"
textsize="{{ Theme.UI_FontSize*0.2 }}"
Expand All @@ -31,7 +31,7 @@
/>
<label text="CLUB"
class="text-primary"
pos="{{ positionBoxWidth+columnSpacing+flagWidth+columnSpacing+(clubTagWidth/2.0) }} {{ height / -2 + 0.25 }}"
pos="{{ positionBoxWidth+columnSpacing+flagWidth+columnSpacing+(clubTagWidth/2f) }} {{ height / -2 + 0.25 }}"
halign="center"
valign="center"
textsize="{{ Theme.UI_FontSize*0.2 }}"
Expand All @@ -50,7 +50,7 @@
<label id="legend_best_time"
text="BEST TIME"
class="text-primary"
pos="{{ width-columnSpacing - 55.0 }} {{ height / -2 + 0.25 }}"
pos="{{ width-columnSpacing - 55f }} {{ height / -2 + 0.25 }}"
valign="center"
halign="right"
textsize="{{ Theme.UI_FontSize*0.2 }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
<property type="double" name="padding" default="3.4"/>

<template>
<frame id="header_content" pos="{{ width / 2.0 }} {{ height / -2.0 }}">
<frame id="header_content" pos="{{ width / 2f }} {{ height / -2f }}">
<label id="header_text_left"
pos="{{ float.Parse(Theme.ScoreboardModule_Logo_Width, CultureInfo.InvariantCulture) * -0.5 - 4.0 }} 1.75"
size="{{ width/2.0-float.Parse(Theme.ScoreboardModule_Logo_Width, CultureInfo.InvariantCulture)-2.0 }} {{ height }}"
pos="{{ float.Parse(Theme.ScoreboardModule_Logo_Width, CultureInfo.InvariantCulture) * -0.5 - 4f }} 1.75"
size="{{ width/2f-float.Parse(Theme.ScoreboardModule_Logo_Width, CultureInfo.InvariantCulture)-2f }} {{ height }}"
textcolor="{{ Theme.UI_TextPrimary }}"
class="text-lg"
textfont="{{ Font.Regular }}"
halign="right"
valign="center2"
/>
<label id="header_text_left_small"
pos="{{ float.Parse(Theme.ScoreboardModule_Logo_Width, CultureInfo.InvariantCulture) * -0.5 - 4.0 }} -1.75"
size="{{ width/2.0-float.Parse(Theme.ScoreboardModule_Logo_Width, CultureInfo.InvariantCulture)-2.0 }} {{ height }}"
pos="{{ float.Parse(Theme.ScoreboardModule_Logo_Width, CultureInfo.InvariantCulture) * -0.5 - 4f }} -1.75"
size="{{ width/2f-float.Parse(Theme.ScoreboardModule_Logo_Width, CultureInfo.InvariantCulture)-2f }} {{ height }}"
textcolor="{{ Theme.UI_TextPrimary }}"
class="text-primary"
textfont="{{ Font.Regular }}"
Expand All @@ -30,16 +30,16 @@
opacity="0.8"
/>
<label id="header_text_right"
pos="{{ float.Parse(Theme.ScoreboardModule_Logo_Width, CultureInfo.InvariantCulture) * 0.5 + 4.0 }} 1.75"
size="{{ width/2.0-float.Parse(Theme.ScoreboardModule_Logo_Width, CultureInfo.InvariantCulture)-2.0 }} {{ height }}"
pos="{{ float.Parse(Theme.ScoreboardModule_Logo_Width, CultureInfo.InvariantCulture) * 0.5 + 4f }} 1.75"
size="{{ width/2f-float.Parse(Theme.ScoreboardModule_Logo_Width, CultureInfo.InvariantCulture)-2f }} {{ height }}"
textcolor="{{ Theme.UI_TextPrimary }}"
class="text-lg"
textfont="{{ Font.Regular }}"
valign="center2"
/>
<label id="header_text_right_small"
pos="{{ float.Parse(Theme.ScoreboardModule_Logo_Width, CultureInfo.InvariantCulture) * 0.5 + 4.0 }} -1.75"
size="{{ width/2.0-float.Parse(Theme.ScoreboardModule_Logo_Width, CultureInfo.InvariantCulture)-2.0 }} {{ height }}"
pos="{{ float.Parse(Theme.ScoreboardModule_Logo_Width, CultureInfo.InvariantCulture) * 0.5 + 4f }} -1.75"
size="{{ width/2f-float.Parse(Theme.ScoreboardModule_Logo_Width, CultureInfo.InvariantCulture)-2f }} {{ height }}"
textcolor="{{ Theme.UI_TextPrimary }}"
class="text-primary"
textfont="{{ Font.Regular }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component>
<property type="double" name="x" default="0.0"/>
<property type="double" name="y" default="0.0"/>
<property type="double" name="x" default="0f"/>
<property type="double" name="y" default="0f"/>

<template>
<quad pos="{{ x }} {{ y }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<component>
<property type="string" name="id" />
<property type="double" name="x" default="0.0"/>
<property type="double" name="y" default="0.0"/>
<property type="double" name="width" default="0.0"/>
<property type="double" name="height" default="0.0"/>
<property type="double" name="x" default="0f"/>
<property type="double" name="y" default="0f"/>
<property type="double" name="width" default="0f"/>
<property type="double" name="height" default="0f"/>

<template>
<frame id="{{ id }}" pos="{{ x }} {{ y }}">
Expand Down
20 changes: 10 additions & 10 deletions src/Modules/ScoreboardModule/Templates/Components/Row/Framemodel.mt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
height="{{ rowHeight }}"
/>

<frame pos="{{ positionBoxWidth + columnSpacing }} {{ rowHeight / -2.0 }}" z-index="10">
<frame pos="{{ positionBoxWidth + columnSpacing }} {{ rowHeight / -2f }}" z-index="10">
<!-- Flag -->
<Flag height="{{ rowInnerHeight }}" />

Expand All @@ -66,7 +66,7 @@
class="text-primary"
text="CLUB"
pos="{{ rowInnerHeight * 0.75 }} 0"
size="{{ rowInnerHeight * 2.0 }} {{ rowInnerHeight }}"
size="{{ rowInnerHeight * 2f }} {{ rowInnerHeight }}"
valign="center2"
halign="center"
textsize="{{ Theme.UI_FontSize*2 }}"
Expand All @@ -76,8 +76,8 @@

<!-- Player Name -->
<label id="name"
pos="{{ rowInnerHeight * 3.0 + columnSpacing * 2.0 }} 0"
size="{{ w / 3.0 }} {{ rowHeight }}"
pos="{{ rowInnerHeight * 3f + columnSpacing * 2f }} 0"
size="{{ w / 3f }} {{ rowHeight }}"
valign="center2"
textsize="{{ Theme.UI_FontSize*2 }}"
textfont="{{ Font.Regular }}"
Expand All @@ -86,15 +86,15 @@
</frame>
<frame id="details_wrapper" z-index="10">
<!-- Spec/Disconnected -->
<label id="spec_disconnected_label" pos="0 {{ rowHeight / -2.0 }}"
<label id="spec_disconnected_label" pos="0 {{ rowHeight / -2f }}"
class="text-muted"
valign="center2"
halign="right"
textsize="{{ Theme.UI_FontSize*2 }}"
/>

<!-- Round Points -->
<label id="round_points" pos="0 {{ rowHeight / -2.0 }}"
<label id="round_points" pos="0 {{ rowHeight / -2f }}"
class="text-primary"
valign="center2"
halign="right"
Expand All @@ -105,7 +105,7 @@
<!-- Custom Label (FINALIST, etc) -->
<label id="custom_label"
class="text-primary"
pos="0 {{ rowHeight / -2.0 }}"
pos="0 {{ rowHeight / -2f }}"
valign="center2"
halign="right"
textsize="{{ Theme.UI_FontSize*2 }}"
Expand All @@ -115,7 +115,7 @@
<!-- Best Time -->
<label id="best_time"
class="text-primary"
pos="{{ w - columnSpacing - 55.0 }} {{ rowHeight / -2.0 }}"
pos="{{ w - columnSpacing - 55f }} {{ rowHeight / -2f }}"
valign="center2"
halign="right"
textsize="{{ Theme.UI_FontSize*2 }}"
Expand All @@ -126,15 +126,15 @@
<!-- Player Score -->
<label id="score"
class="text-primary"
pos="{{ w - columnSpacing }} {{ rowHeight / -2.0 }}"
pos="{{ w - columnSpacing }} {{ rowHeight / -2f }}"
valign="center2"
halign="right"
textsize="{{ Theme.UI_FontSize*2 }}"
textcolor="{{ Theme.ScoreboardModule_Text_Color }}"
/>
</frame>
<PlayerActions x="{{ w }}"
y="{{ rowHeight / -2.0 }}"
y="{{ rowHeight / -2f }}"
rowHeight="{{ rowHeight }}"
rowSpacing="{{ rowSpacing }}"
textsize="{{ textSize }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<component>
<property type="double" name="x" default="0.0"/>
<property type="double" name="y" default="0.0"/>
<property type="double" name="rowHeight" default="0.0"/>
<property type="double" name="x" default="0f"/>
<property type="double" name="y" default="0f"/>
<property type="double" name="rowHeight" default="0f"/>
<property type="double" name="rowSpacing" default="0.5"/>

<template>
<frame id="player_actions" pos="{{ x - (rowHeight*1.2)/2.0 }} {{ y }}" hidden="1">
<frame id="player_actions" pos="{{ x - (rowHeight*1.2)/2f }} {{ y }}" hidden="1">
<!-- SPECTATE -->
<label id="spectate_player"
class="text-primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
bgcolor="{{ Theme.ScoreboardModule_Background_Row_Color }}"
opacity="{{ Theme.ScoreboardModule_Background_Row_Opacity }}"
/>
<frame pos="{{ w / 2.0 }} {{ h / -2.0 }}">
<frame pos="{{ w / 2f }} {{ h / -2f }}">
<quad id="custom_gradient"
size="{{ h }} {{ w }}"
pos="{{ w / -2.0 }} {{ h / -2.0 }}"
pos="{{ w / -2f }} {{ h / -2f }}"
rot="-90"
image="file:///Media/Painter/Stencils/04-SquareGradient/Brush.tga"
modulatecolor="{{ Theme.UI_AccentPrimary }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<using namespace="EvoSC.Modules.Official.ScoreboardModule.Config"/>

<property type="IScoreboardSettings" name="settings"/>
<property type="double" name="accentBarWidth" default="1.0"/>
<property type="double" name="x" default="0.0"/>
<property type="double" name="y" default="0.0"/>
<property type="double" name="accentBarWidth" default="1f"/>
<property type="double" name="x" default="0f"/>
<property type="double" name="y" default="0f"/>
<property type="double" name="width"/>
<property type="double" name="height"/>

Expand All @@ -23,7 +23,7 @@
opacity="{{ Theme.ScoreboardModule_PositionBox_Opacity }}"
/>
<label id="position_box_position_rank"
pos='{{ (width-(Theme.ScoreboardModule_PositionBox_ShowAccent=="True" ? accentBarWidth : 0)) / 2.0 + (Theme.ScoreboardModule_PositionBox_ShowAccent=="True" ? accentBarWidth : 0) }} {{ height / -2.0 + 0.25 }}'
pos='{{ (width-(Theme.ScoreboardModule_PositionBox_ShowAccent=="True" ? accentBarWidth : 0)) / 2f + (Theme.ScoreboardModule_PositionBox_ShowAccent=="True" ? accentBarWidth : 0) }} {{ height / -2f + 0.25 }}'
valign="center"
halign="center"
textsize="{{ Theme.UI_FontSize*2 }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

<property type="double" name="width"/>
<property type="double" name="height"/>
<property type="double" name="y" default="0.0"/>
<property type="double" name="y" default="0f"/>
<property type="double" name="rowSpacing" default="0.25"/>
<property type="double" name="columnSpacing" default="2.0"/>
<property type="double" name="legendHeight" default="4.0"/>
<property type="double" name="flagWidth" default="4.0"/>
<property type="double" name="clubTagWidth" default="4.0"/>
<property type="double" name="columnSpacing" default="2f"/>
<property type="double" name="legendHeight" default="4f"/>
<property type="double" name="flagWidth" default="4f"/>
<property type="double" name="clubTagWidth" default="4f"/>

<template>
<frame pos="0 {{ y }}">
Expand Down
24 changes: 12 additions & 12 deletions src/Modules/ScoreboardModule/Templates/Scoreboard.mt
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
<property type="IScoreboardSettings" name="settings"/>
<property type="int" name="MaxPlayers" default="0"/>

<property type="double" name="backgroundBorderRadius" default="3.0"/>
<property type="double" name="headerHeight" default="14.0"/>
<property type="double" name="rowHeight" default="8.0"/>
<property type="double" name="rowInnerHeight" default="5.0"/>
<property type="double" name="rowSpacing" default="0.3"/>
<property type="double" name="columnSpacing" default="4.0"/>
<property type="double" name="pointsWidth" default="16.0"/>
<property type="double" name="padding" default="2.0"/>
<property type="double" name="backgroundBorderRadius" default="3f"/>
<property type="double" name="headerHeight" default="14f"/>
<property type="double" name="rowHeight" default="8f"/>
<property type="double" name="rowInnerHeight" default="5f"/>
<property type="double" name="rowSpacing" default="0f"/>
<property type="double" name="columnSpacing" default="4f"/>
<property type="double" name="pointsWidth" default="16f"/>
<property type="double" name="padding" default="2f"/>
<property type="double" name="innerSpacing" default="1.6"/>
<property type="double" name="legendHeight" default="3.8"/>
<property type="int" name="actionButtonCount" default="2"/>
Expand All @@ -41,7 +41,7 @@
/>

<!-- Scoreboard Content -->
<frame pos="{{ settings.Width / -2.0 }} {{ settings.Height / 2.0 }}">
<frame pos="{{ settings.Width / -2f }} {{ settings.Height / 2f }}">
<!-- Background -->
<ScoreboardBg
width="{{ settings.Width }}"
Expand Down Expand Up @@ -353,15 +353,15 @@
declare x = scoreLabel.RelativePosition_V3.X;

if(scoreLabel.Value != ""){
offset += scoreLabel.ComputeWidth(scoreLabel.Value) + {{ columnSpacing / 2.0 }};
offset += scoreLabel.ComputeWidth(scoreLabel.Value) + {{ columnSpacing / 2f }};
}
customLabel.RelativePosition_V3.X = x - offset;
if(customLabel.Value != ""){
offset += customLabel.ComputeWidth(customLabel.Value) + {{ columnSpacing / 2.0 }};
offset += customLabel.ComputeWidth(customLabel.Value) + {{ columnSpacing / 2f }};
}
roundPointsLabel.RelativePosition_V3.X = x - offset;
if(roundPointsLabel.Value != ""){
offset += roundPointsLabel.ComputeWidth(roundPointsLabel.Value) + {{ columnSpacing / 2.0 }};
offset += roundPointsLabel.ComputeWidth(roundPointsLabel.Value) + {{ columnSpacing / 2f }};
}
specDisconnectedLabel.RelativePosition_V3.X = x - offset;
}
Expand Down

0 comments on commit 75130f5

Please sign in to comment.