Cutscenes are now integrated into the game. LONG LIVE THE RAT KING!

This commit is contained in:
Zed A. Shaw 2025-11-14 01:25:10 -05:00
parent fa4573be7b
commit 8fdaadaf12
5 changed files with 30 additions and 17 deletions

View file

@ -213,6 +213,9 @@ namespace gui {
void FSM::BOSS_FIGHT(Event ev, std::any data) {
dbc::check($boss_fight != nullptr, "$boss_fight not initialized");
if($boss_scene->playing()) return;
$boss_fight->mouse_pos = mouse_position();
if(ev == gui::Event::QUIT) {
@ -380,31 +383,31 @@ namespace gui {
}
void FSM::draw_gui() {
if(in_state(State::BOSS_FIGHT)) {
$boss_fight->render($window);
if($debug_ui.active) {
debug_render();
} else {
if($debug_ui.active) {
debug_render();
} else {
$main_ui.render();
}
$main_ui.render();
}
$status_ui.render($window);
$combat_ui.render($window);
if($loot_ui.active) $loot_ui.render($window);
$status_ui.render($window);
$combat_ui.render($window);
if($loot_ui.active) $loot_ui.render($window);
if(in_state(State::LOOTING)) $dnd_loot.render();
if(in_state(State::LOOTING)) $dnd_loot.render();
if($map_open) {
$map_ui.render($window, $main_ui.$compass_dir);
}
if($map_open) {
$map_ui.render($window, $main_ui.$compass_dir);
}
}
void FSM::render() {
if(in_state(State::BOSS_FIGHT)) {
$window.clear();
$boss_fight->render($window);
if($boss_scene->playing()) {
$boss_scene->render($window);
} else {
$boss_fight->render($window);
}
} else {
draw_gui();
}
@ -538,7 +541,10 @@ namespace gui {
void FSM::next_level(bool bossfight) {
if(bossfight) {
$boss_scene = std::make_shared<storyboard::UI>("rat_king");
$boss_fight = boss::System::create_bossfight();
$boss_scene->init();
dbc::check($boss_scene->playing(), "boss scene doesn't play");
} else {
GameDB::create_level();
$status_ui.update_level();