generated from emilk/eframe_template
-
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.
It's beginning to look a lot like xmas. haha
- Loading branch information
Showing
11 changed files
with
404 additions
and
114 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,5 +1,5 @@ | ||
[package] | ||
name = "micronos" | ||
name = "micronos" #Time-hold? | ||
version = "0.2.0" | ||
authors = ["Alejandro R. Buteler <[email protected]>"] | ||
edition = "2021" | ||
|
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,111 @@ | ||
use std::fmt; | ||
use bevy::prelude::*; | ||
|
||
#[derive(Debug)] | ||
pub enum Hour { | ||
Zero, | ||
One, | ||
Two, | ||
Three, | ||
Four, | ||
Five, | ||
Six, | ||
Seven, | ||
Eight, | ||
Nine, | ||
Ten, | ||
Eleven, | ||
Twelve, | ||
Thirteen, | ||
Fourteen, | ||
Fifteen, | ||
Sixteen, | ||
Seventeen, | ||
Eighteen, | ||
Nineteen, | ||
Twenty, | ||
TwentyOne, | ||
TwentyTwo, | ||
TwentyThree | ||
} | ||
|
||
impl Hour { | ||
pub const VALUES: [Self; 24] = [ | ||
Self::Zero, | ||
Self::One, | ||
Self::Two, | ||
Self::Three, | ||
Self::Four, | ||
Self::Five, | ||
Self::Six, | ||
Self::Seven, | ||
Self::Eight, | ||
Self::Nine, | ||
Self::Ten, | ||
Self::Eleven, | ||
Self::Twelve, | ||
Self::Thirteen, | ||
Self::Fourteen, | ||
Self::Fifteen, | ||
Self::Sixteen, | ||
Self::Seventeen, | ||
Self::Eighteen, | ||
Self::Nineteen, | ||
Self::Twenty, | ||
Self::TwentyOne, | ||
Self::TwentyTwo, | ||
Self::TwentyThree | ||
]; | ||
} | ||
|
||
impl fmt::Display for Hour { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
write!( | ||
f, | ||
"{}", | ||
match self { | ||
Self::Zero => "00", | ||
Self::One => "01", | ||
Self::Two => "02", | ||
Self::Three => "03", | ||
Self::Four => "04", | ||
Self::Five => "05", | ||
Self::Six => "06", | ||
Self::Seven => "07", | ||
Self::Eight => "08", | ||
Self::Nine => "09", | ||
Self::Ten => "10", | ||
Self::Eleven => "11", | ||
Self::Twelve => "12", | ||
Self::Thirteen => "13", | ||
Self::Fourteen => "14", | ||
Self::Fifteen => "15", | ||
Self::Sixteen => "16", | ||
Self::Seventeen => "17", | ||
Self::Eighteen => "18", | ||
Self::Nineteen => "19", | ||
Self::Twenty => "20", | ||
Self::TwentyOne => "21", | ||
Self::TwentyTwo => "22", | ||
Self::TwentyThree => "23", | ||
} | ||
) | ||
} | ||
} | ||
|
||
#[derive(Component)] | ||
pub struct HourBox { | ||
pub hour: Hour, | ||
pub active: bool, | ||
} | ||
impl HourBox { | ||
pub fn new(hour: Hour, active: bool) -> Self { | ||
Self { | ||
hour, | ||
active, | ||
} | ||
} | ||
} | ||
|
||
#[derive(Component)] | ||
pub struct CurrentTimeText; |
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,7 @@ | ||
pub mod hour; | ||
|
||
pub use hour::{ | ||
Hour, | ||
HourBox, | ||
CurrentTimeText | ||
}; |
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,13 +1,17 @@ | ||
mod resources; | ||
pub mod components; | ||
pub mod resources; | ||
mod systems; | ||
use systems::layout::spawn_ui; | ||
|
||
use systems::layout::spawn_ui; | ||
use resources::TimelineAssets; | ||
use bevy::prelude::*; | ||
|
||
pub struct Timeline; | ||
|
||
impl Plugin for Timeline { | ||
fn build(&self, app: &mut App) { | ||
app.insert_resource(TimelineAssets::default()); | ||
app.add_systems(Startup, spawn_ui); | ||
app.add_systems(Update, crate::systems::print_chrono_sphere); | ||
} | ||
} | ||
} |
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,6 @@ | ||
use bevy::prelude::*; | ||
|
||
#[derive(Resource, Default)] | ||
pub struct TimelineAssets { | ||
pub background_handle: Option<Handle<Image>>, | ||
} |
Oops, something went wrong.