Skip to content

Commit

Permalink
game: Hide mech in sim view
Browse files Browse the repository at this point in the history
  • Loading branch information
mrannanj committed Nov 25, 2024
1 parent 4803f55 commit e89db44
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/game/scenes/mechlab.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ typedef struct {
dashboard_widgets dw;
newplayer_widgets nw;
trnselect_widgets tw;
bool hide_mech;
bool selling;
component *hint;
} mechlab_local;
Expand Down Expand Up @@ -196,12 +197,17 @@ void mechlab_update(scene *scene) {
lab_dash_main_update(scene, &local->dw);
}

void mechlab_hide_mech(scene *scene) {
mechlab_local *local = scene_get_userdata(scene);
local->hide_mech = true;
}

void mechlab_tick(scene *scene, int paused) {
mechlab_local *local = scene_get_userdata(scene);

guiframe_tick(local->frame);
guiframe_tick(local->dashboard);
if(local->mech != NULL) {
if(!local->hide_mech && local->mech != NULL) {
object_dynamic_tick(local->mech);
}

Expand Down
1 change: 1 addition & 0 deletions src/game/scenes/mechlab.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ typedef enum

int mechlab_create(scene *scene);
void mechlab_update(scene *scene);
void mechlab_hide_mech(scene *scene);

void mechlab_enter_trnselect_menu(scene *s);
component *mechlab_chrload_menu_create(scene *scene);
Expand Down
1 change: 1 addition & 0 deletions src/game/scenes/mechlab/lab_dash_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ void lab_dash_sim_init(component *menu, component *submenu) {
dashboard_widgets *dw = trnmenu_get_userdata(submenu);
game_player *p1 = game_state_get_player(dw->scene->gs, 0);
dw->sim_rank = p1->pilot->rank;
mechlab_hide_mech(dw->scene);
}

void lab_dash_sim_done(component *menu, component *submenu) {
Expand Down

0 comments on commit e89db44

Please sign in to comment.