Skip to content

Commit

Permalink
skibidi crabs 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhelvetican committed Aug 15, 2024
1 parent 4434324 commit ed22a7b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions prts-server/src/models/account/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub mod skin;
pub mod social;
pub mod status;
pub mod sync;
pub mod theme;

pub use sync::*;

Expand Down
36 changes: 36 additions & 0 deletions prts-server/src/models/account/theme.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
use std::collections::HashMap;

use serde::{Deserialize, Serialize};

use crate::utils::time::time;

#[derive(Deserialize, Serialize, Default)]
pub struct HomeTheme {
selected: String,
themes: HashMap<String, Theme>,
}

impl HomeTheme {
pub fn new() -> Self {
Self::default()
}

pub fn select_theme(&mut self, id: String) {
self.selected = id
}

pub fn set_theme(&mut self, id: String) {
self.themes.insert(id, Theme::default());
}
}

#[derive(Deserialize, Serialize)]
pub struct Theme {
unlock: u64,
}

impl Default for Theme {
fn default() -> Self {
Self { unlock: time() }
}
}

0 comments on commit ed22a7b

Please sign in to comment.