Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Engel Simulator 2020
Engel Simulator 2020
Commits
66ecefe3
Commit
66ecefe3
authored
Dec 29, 2020
by
Rahix
🦀
Browse files
heaven: Show remaining player sanity
Display how much sanity the player has left.
parent
d0e87714
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/states/heaven.rs
View file @
66ecefe3
...
...
@@ -27,6 +27,9 @@ impl HeavenState {
});
// Update the angel stats GUI elements
utils
::
get_element_by_id
::
<
web_sys
::
Element
>
(
"heaven-sanity"
)
.unwrap
()
.set_inner_html
(
&
format!
(
"{}%"
,
(
player
.sanity
*
100.0
)
.round
()
as
usize
));
utils
::
get_element_by_id
::
<
web_sys
::
Element
>
(
"heaven-collected-hours"
)
.unwrap
()
.set_inner_html
(
&
format!
(
"{}"
,
player
.collected_hours
));
...
...
www/src/index.html
View file @
66ecefe3
...
...
@@ -60,10 +60,12 @@
<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>
<text
x=
"30"
y=
"30"
class=
"stats-label"
>
Sanity remaining:
</text>
<text
x=
"450"
y=
"30"
class=
"stats-number health"
id=
"heaven-sanity"
>
?
</text>
<text
x=
"30"
y=
"80"
class=
"stats-label"
>
Collected hours:
</text>
<text
x=
"450"
y=
"80"
class=
"stats-number positive"
id=
"heaven-collected-hours"
>
?
</text>
<text
x=
"30"
y=
"130"
class=
"stats-label"
>
Hours still needed:
</text>
<text
x=
"450"
y=
"130"
class=
"stats-number negative"
id=
"heaven-needed-hours"
>
?
</text>
</g>
<g
transform=
"translate(1100, 300)"
>
...
...
www/src/styles.scss
View file @
66ecefe3
...
...
@@ -130,6 +130,10 @@ div.game {
fill
:
#ffffff
;
&
.health
{
fill
:
$typography-1
;
}
&
.positive
{
fill
:
$typography-2
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment