void handle_init(AppContextRef ctx) { (void)ctx; PblTm currentTime; unsigned int unixTime; resource_init_current_app(&APP_RESOURCES); get_time(¤tTime); unixTime = GetUnixTime(¤tTime); SetRandomSeed(unixTime); InitializeExitConfirmationWindow(); handle_minute_tick(ctx, NULL); ResetGame(); ShowAdventureWindow(); }
void handle_init() { INFO_LOG("Starting MiniDungeon"); time_t now = time(NULL); srand(now); DEBUG_LOG("Srand"); handle_minute_tick(NULL, MINUTE_UNIT); DEBUG_LOG("First handle second"); InitializeGameData(); #if ALLOW_WORKER_APP app_worker_message_subscribe(WorkerMessageHandler); AppAwake(); #endif DEBUG_LOG("InitializeGameData"); ShowAdventureWindow(); tick_timer_service_subscribe(MINUTE_UNIT, &handle_minute_tick); app_focus_service_subscribe(focus_handler); }
void ExitWindow_SelectSingleClickHandler(ClickRecognizerRef recognizer, Window *window) { ShowAdventureWindow(); }