Skip to content

Commit

Permalink
fix: compile on latest Fyrox
Browse files Browse the repository at this point in the history
  • Loading branch information
CoreyCole committed Oct 11, 2022
1 parent 083053d commit 25f9f4a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Single player 3d shooter written in Rust and based on [fyrox engine](https://git

## How to build

Cargo.toml contains hardcoded relative path to engine `fyrox = { path = "../fyrox" }`, so you have to change this or put engine folder near the game folder to get game compile, because it always uses latest fyrox which could be not published on crates.io.
Cargo.toml contains hardcoded relative path to engine `fyrox = { path = "../Fyrox" }`, so you have to change this or put engine folder near the game folder to get game compile, because it always uses latest fyrox which could be not published on crates.io.

In other words you can do something like this:
```
Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,8 @@ impl Game {
}
}

self.engine.update(time.delta, control_flow);
let mut lag = 0f32;
self.engine.update(time.delta, control_flow, &mut lag);

if let Some(ref mut level) = self.level {
level.update(&mut self.engine, time);
Expand Down
4 changes: 2 additions & 2 deletions src/match_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ impl MatchMenu {
if message.destination() == self.start_button {
let time_limit_minutes =
if let Some(scroll_bar) = ui.node(self.sb_time_limit).cast::<ScrollBar>() {
scroll_bar.value()
scroll_bar.value
} else {
0.0
};

let frag_limit =
if let Some(scroll_bar) = ui.node(self.sb_frag_limit).cast::<ScrollBar>() {
scroll_bar.value()
scroll_bar.value
} else {
0.0
};
Expand Down
15 changes: 5 additions & 10 deletions src/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ impl Menu {
.on_row(0)
.with_margin(Thickness::uniform(4.0)),
)
.with_text("New Game")
.with_font(font.clone())
.with_text_and_font("New Game", font.clone())
.build(ctx);
btn_new_game
})
Expand All @@ -90,8 +89,7 @@ impl Menu {
.on_row(1)
.with_margin(Thickness::uniform(4.0)),
)
.with_text("Save Game")
.with_font(font.clone())
.with_text_and_font("Save Game", font.clone())
.build(ctx);
btn_save_game
})
Expand All @@ -102,8 +100,7 @@ impl Menu {
.on_row(2)
.with_margin(Thickness::uniform(4.0)),
)
.with_text("Load Game")
.with_font(font.clone())
.with_text_and_font("Load Game", font.clone())
.build(ctx);
btn_load_game
})
Expand All @@ -114,8 +111,7 @@ impl Menu {
.on_row(3)
.with_margin(Thickness::uniform(4.0)),
)
.with_text("Settings")
.with_font(font.clone())
.with_text_and_font("Settings", font.clone())
.build(ctx);
btn_settings
})
Expand All @@ -126,8 +122,7 @@ impl Menu {
.on_row(4)
.with_margin(Thickness::uniform(4.0)),
)
.with_text("Quit")
.with_font(font)
.with_text_and_font("Quit", font.clone())
.build(ctx);
btn_quit_game
}),
Expand Down
6 changes: 3 additions & 3 deletions src/options_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ impl OptionsMenu {
{
if let Some(button) = ui.node(*btn).cast::<Button>() {
ui.send_message(TextMessage::text(
button.content(),
button.content,
MessageDirection::ToWidget,
def.button.name().to_owned(),
));
Expand Down Expand Up @@ -734,7 +734,7 @@ impl OptionsMenu {
.cast::<Button>()
{
engine.user_interface.send_message(TextMessage::text(
button.content(),
button.content,
MessageDirection::ToWidget,
control_button.name().to_owned(),
));
Expand Down Expand Up @@ -812,7 +812,7 @@ impl OptionsMenu {
if message.destination() == *button {
if let Some(button) = engine.user_interface.node(*button).cast::<Button>() {
engine.user_interface.send_message(TextMessage::text(
button.content(),
button.content,
MessageDirection::ToWidget,
"[WAITING INPUT]".to_owned(),
))
Expand Down

0 comments on commit 25f9f4a

Please sign in to comment.