-
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.
Add feature to force the state of stage hazards
- Loading branch information
1 parent
e7d71df
commit 5c4d9e4
Showing
4 changed files
with
31 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
mod gimmick; | ||
mod gravity; | ||
mod ground; | ||
mod settings; | ||
|
||
pub(crate) use gimmick::*; | ||
pub(crate) use gravity::*; | ||
pub(crate) use ground::*; | ||
pub(crate) use settings::*; |
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,21 @@ | ||
use serde::Deserialize; | ||
use smash_stage::app::GlobalStageParameter; | ||
|
||
use crate::config::Config; | ||
|
||
/// The parameters for stage hazards. | ||
#[derive(Deserialize)] | ||
pub struct GimmickParam { | ||
/// Determines if stage hazards should be enabled. | ||
#[serde(default)] | ||
is_gimmick: bool, | ||
} | ||
|
||
/// Updates the parameters for stage hazards if the given stage identifier is assigned specialized parameters. | ||
pub fn try_set_gimmick_param(stage_parameter: &mut GlobalStageParameter) { | ||
let stage_id = stage_parameter.stage_id(); | ||
|
||
if let Some(param) = Config::get().gimmick_param.get(&stage_id) { | ||
stage_parameter.is_gimmick = param.is_gimmick; | ||
} | ||
} |