-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from SnowdenWintermute/feature
0.2.0
- Loading branch information
Showing
68 changed files
with
1,129 additions
and
498 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
Multiplayer turn based game in the spirit of For the King, Diablo and Final Fantasy. | ||
# Roguelike Racing | ||
|
||
A multiplayer turn based game in the spirit of For the King, Diablo and Final Fantasy. | ||
|
||
UI written with the Yew frontend framework, backend uses websockets via Actix. | ||
|
||
To compile tailwind: | ||
From the client directory run npx tailwindcss -i ./input.css -o ./style/output.css --watch | ||
From the client directory run `npx tailwindcss -i ./input.css -o ./style/output.css --watch` | ||
|
||
To run the server: | ||
From the server directory run cargo-watch -x run | ||
From the server directory run `cargo-watch -x run` | ||
|
||
To run the frontend: | ||
From the client directory run trunk serve | ||
From the client directory run `TRUNK_PROD=false trunk serve` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# both | ||
|
||
- check the dockerfile to see how dummy directories are used to cache dependencies before | ||
actually building | ||
|
||
# client | ||
|
||
- set env variables in trunk like TRUNK_PROD=true trunk build --release | ||
- access env variables in Yew like : | ||
let in_production = std::env!("TRUNK_PROD"); | ||
- websocket address should be in the format wss://domainname.com/ws | ||
|
||
# server | ||
|
||
- actix address must be changed to 0.0.0.0:port in order to serve from inside | ||
a docker container | ||
- nginx should be configured like shown in the config file in same directory | ||
- in order to ensure the docker container exits on panic set | ||
RUST_BACKTRACE=1 env to in server dockerfile and make sure the s | ||
erver Cargo.toml sets the behavior of : | ||
[profile.release] | ||
panic = 'abort' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
client/src/components/game/action_menu/action_button_hover_handlers/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use super::enums::GameActions; | ||
use crate::store::game_store::get_item_owned_by_focused_character; | ||
use crate::store::game_store::DetailableEntities; | ||
use crate::store::game_store::GameStore; | ||
use std::rc::Rc; | ||
use yewdux::prelude::Dispatch; | ||
|
||
pub fn create_action_mouse_enter_handler( | ||
action: GameActions, | ||
game_dispatch: Dispatch<GameStore>, | ||
game_state: Rc<GameStore>, | ||
) -> Box<dyn Fn()> { | ||
match action { | ||
GameActions::SelectItem(id) => Box::new(move || { | ||
let item = get_item_owned_by_focused_character(&id, game_state.clone()) | ||
.expect("a character should only be able to select their own items"); | ||
game_dispatch | ||
.reduce_mut(|store| store.hovered_entity = Some(DetailableEntities::Item(item))); | ||
}), | ||
_ => Box::new(|| ()), | ||
} | ||
} | ||
|
||
pub fn create_action_mouse_leave_handler( | ||
action: GameActions, | ||
game_dispatch: Dispatch<GameStore>, | ||
_game_state: Rc<GameStore>, | ||
) -> Box<dyn Fn()> { | ||
match action { | ||
GameActions::SelectItem(_id) => Box::new(move || { | ||
game_dispatch.reduce_mut(|store| store.hovered_entity = None); | ||
}), | ||
_ => Box::new(|| ()), | ||
} | ||
} |
3 changes: 0 additions & 3 deletions
3
client/src/components/game/action_menu/action_handlers/mod.rs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...ts/game/action_menu/action_menu_button.rs → ...ame/action_menu/action_menu_button/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.