Commit 58105613 authored by Rahix's avatar Rahix 🦀
Browse files

heaven: Show collected angel hours

Display a cound of collected angel hours and the amount of hours still
needed for getting a shirt (currently hard-coded to 30h).
parent 9e304fe4
......@@ -24,6 +24,14 @@ impl HeavenState {
components::Player::new()
});
// Update the angel stats GUI elements
utils::get_element_by_id::<web_sys::Element>("heaven-collected-hours")
.unwrap()
.set_inner_html(&format!("{}", player.collected_hours));
utils::get_element_by_id::<web_sys::Element>("heaven-needed-hours")
.unwrap()
.set_inner_html(&format!("{}", 30 - player.collected_hours));
HeavenState {
gui_svg: utils::get_element_by_id("heaven-ui").unwrap(),
node_world,
......
......@@ -20,6 +20,15 @@
<rect x="0" y="0" width="1920" height="1080" class="transparent-background" />
<text x="960" y="140" class="header">Welcome to HEAVEN</text>
<g transform="translate(250, 800)">
<text x="0" y="-15" class="group-box-label">ANGEL STATS:</text>
<text x="30" y="30" class="stats-label">Collected hours:</text>
<text x="450" y="30" class="stats-number positive" id="heaven-collected-hours">?</text>
<text x="30" y="80" class="stats-label">Hours still needed:</text>
<text x="450" y="80" class="stats-number negative" id="heaven-needed-hours">?</text>
</g>
<g transform="translate(1100, 300)">
<text x="0" y="-15" class="group-box-label">ASSIGNED SHIFT:</text>
<rect x="0" y="0" width="600" height="500" class="group-box" />
......
......@@ -86,6 +86,32 @@ div.game {
}
}
text.stats-label {
fill: #ffffff;
font-family: "Montserrat";
font-weight: 700;
font-size: 24pt;
dominant-baseline: hanging;
}
text.stats-number {
font-family: "Orbitron";
font-weight: 900;
font-size: 24pt;
dominant-baseline: hanging;
text-anchor: end;
&.positive {
fill: $typography-2;
}
&.negative {
fill: $typography-3;
}
}
text.group-box-label {
font-family: "Orbitron";
font-weight: 900;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment