-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pal4: implement wait, flash_in_black, flash_out_black
- Loading branch information
1 parent
1ec67d3
commit 9bc34cd
Showing
7 changed files
with
123 additions
and
41 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
use imgui::Ui; | ||
|
||
use super::interp_value::InterpValue; | ||
|
||
pub struct ActDrop { | ||
darkness: InterpValue<f32>, | ||
} | ||
|
||
impl ActDrop { | ||
pub fn new() -> Self { | ||
ActDrop { | ||
darkness: InterpValue::new(0., 0., 0.), | ||
} | ||
} | ||
|
||
pub fn set_darkness(&mut self, darkness: InterpValue<f32>) { | ||
self.darkness = darkness; | ||
} | ||
|
||
pub fn current(&self) -> f32 { | ||
self.darkness.value() | ||
} | ||
|
||
pub fn update(&mut self, ui: &Ui, delta_sec: f32) { | ||
self.darkness.update(delta_sec); | ||
|
||
let value = self.darkness.value(); | ||
if value == 0. { | ||
return; | ||
} | ||
|
||
let [width, height] = ui.io().display_size; | ||
let color = [0., 0., 0., value]; | ||
let style = ui.push_style_color(imgui::StyleColor::WindowBg, color); | ||
ui.window("actdrop") | ||
.position([0., 0.], imgui::Condition::Always) | ||
.size([width, height], imgui::Condition::Always) | ||
.movable(false) | ||
.resizable(false) | ||
.collapsible(false) | ||
.title_bar(false) | ||
.draw_background(true) | ||
.scroll_bar(false) | ||
.nav_focus(false) | ||
.focused(false) | ||
.mouse_inputs(false) | ||
.build(|| {}); | ||
style.pop(); | ||
} | ||
} |
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,3 +1,4 @@ | ||
pub mod act_drop; | ||
pub mod free_view; | ||
pub mod interp_value; | ||
|
||
|
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
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