add ikachan title theme (fixes #85) (#87)

This commit is contained in:
József Sallai 2022-03-13 21:58:22 +02:00 committed by GitHub
parent 8fd0a814e9
commit 2dadbdb905
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -1609,6 +1609,7 @@ impl EngineConstants {
"toroko".to_owned(),
"white".to_owned(),
"kaze".to_owned(),
"ika".to_owned(),
],
organya_paths: vec![
"/org/".to_owned(), // NXEngine

View File

@ -13,7 +13,7 @@ use crate::menu::settings_menu::SettingsMenu;
use crate::menu::{Menu, MenuEntry, MenuSelectionResult};
use crate::scene::jukebox_scene::JukeboxScene;
use crate::scene::Scene;
use crate::shared_game_state::{GameDifficulty, MenuCharacter, ReplayState, SharedGameState, TileSize};
use crate::shared_game_state::{GameDifficulty, MenuCharacter, ReplayState, Season, SharedGameState, TileSize};
use crate::stage::{BackgroundType, NpcType, Stage, StageData, StageTexturePaths, Tileset};
#[derive(PartialEq, Eq, Copy, Clone)]
@ -99,7 +99,7 @@ impl TitleScene {
pub fn update_menu_cursor(&self, state: &mut SharedGameState, ctx: &mut Context) -> GameResult {
let minutes = self.nikumaru_rec.tick / (60 * state.settings.timing_mode.get_tps());
let song_id: usize;
let mut song_id: usize;
if self.nikumaru_rec.shown && minutes < 3 {
state.menu_character = MenuCharacter::Sue;
@ -118,6 +118,10 @@ impl TitleScene {
song_id = 24;
}
if state.settings.soundtrack == "New" && Season::current() == Season::PixelBirthday {
song_id = 43;
}
if song_id != state.sound_manager.current_song() {
state.sound_manager.play_song(song_id, &state.constants, &state.settings, ctx)?;
}

View File

@ -109,6 +109,7 @@ pub enum Season {
None,
Halloween,
Christmas,
PixelBirthday,
}
impl Season {
@ -119,6 +120,8 @@ impl Season {
Season::Halloween
} else if (now.month() == 12 && now.day() > 23) || (now.month() == 0 && now.day() < 7) {
Season::Christmas
} else if (now.month() == 4 && now.day() == 29) {
Season::PixelBirthday
} else {
Season::None
}