Exemple #1
0
        internal override int OnEnter()
        {
            int id, jd, title_id;

            Video.video_clr_grab();

            //  Build the pause GUI

            if ((id = gui.gui_vstack(0)) != 0)
            {
                title_id = gui.gui_label(id, "Paused", gui.GUI_LRG, gui.GUI_ALL, null, null);

                gui.gui_space(id);

                if ((jd = gui.gui_harray(id)) != 0)
                {
                    gui.gui_state(jd, "Quit", gui.GUI_SML, st_pause.PAUSE_EXIT, 0);

                    if (Progress.progress_same_avail() != 0)
                    {
                        gui.gui_state(jd, "Restart", gui.GUI_SML, st_pause.PAUSE_RESTART, 0);
                    }

                    gui.gui_start(jd, "Continue", gui.GUI_SML, st_pause.PAUSE_CONTINUE, 1);
                }

                gui.gui_pulse(title_id, 1.2f);
                gui.gui_layout(id, 0, 0);
            }

            hud.hud_update(0);

            return(id);
        }
Exemple #2
0
 internal override int OnKeybd(Alt.GUI.Keys c, int d)
 {
     if (d != 0)
     {
         if (Config.config_tst_d(Config.CONFIG_KEY_RESTART, c) != 0 &&
             Progress.progress_same_avail() != 0)
         {
             if (Progress.progress_same() != 0)
             {
                 State.goto_state(st_play.get_st_play_ready());
             }
         }
     }
     return(1);
 }
Exemple #3
0
        internal override int OnKeybd(Alt.GUI.Keys c, int d)
        {
            if (d != 0)
            {
                if (Config.config_tst_d(Config.CONFIG_KEY_PAUSE, c) != 0)
                {
                    return(st_pause.pause_action(st_pause.PAUSE_CONTINUE));
                }

                if (Config.config_tst_d(Config.CONFIG_KEY_RESTART, c) != 0 &&
                    Progress.progress_same_avail() != 0)
                {
                    return(st_pause.pause_action(st_pause.PAUSE_RESTART));
                }
            }
            return(1);
        }
Exemple #4
0
        internal override int OnKeybd(Alt.GUI.Keys c, int d)
        {
            if (d != 0)
            {
                if (Config.config_tst_d(Config.CONFIG_KEY_SCORE_NEXT, c) != 0)
                {
                    return(st_goal.goal_action(Util.gui_score_next(Util.gui_score_get())));
                }

                if (Config.config_tst_d(Config.CONFIG_KEY_RESTART, c) != 0 &&
                    Progress.progress_same_avail() != 0)
                {
                    return(st_goal.goal_action(st_goal.GOAL_SAME));
                }
            }

            return(1);
        }
Exemple #5
0
        internal override int OnEnter()
        {
            int id, jd, kd;

            /* Reset hack. */
            st_fall_out.resume = 0;

            if ((id = gui.gui_vstack(0)) != 0)
            {
                kd = gui.gui_label(id, "Fall-out!", gui.GUI_LRG, gui.GUI_ALL, widget.gui_gry, widget.gui_red);

                gui.gui_space(id);

                if ((jd = gui.gui_harray(id)) != 0)
                {
                    if (Progress.progress_dead() != 0)
                    {
                        gui.gui_start(jd, "Exit", gui.GUI_SML, st_fall_out.FALL_OUT_OVER, 0);
                    }

                    if (Progress.progress_next_avail() != 0)
                    {
                        gui.gui_start(jd, "Next Level", gui.GUI_SML, st_fall_out.FALL_OUT_NEXT, 0);
                    }

                    if (Progress.progress_same_avail() != 0)
                    {
                        gui.gui_start(jd, "Retry Level", gui.GUI_SML, st_fall_out.FALL_OUT_SAME, 0);
                    }
                }

                gui.gui_space(id);

                gui.gui_pulse(kd, 1.2f);
                gui.gui_layout(id, 0, 0);
            }

            Audio.audio_music_fade_out(2.0f);

            Video.video_clr_grab();

            return(id);
        }
Exemple #6
0
        internal override int OnEnter()
        {
            string s1 = "New Record";
            string s2 = "GOAL";

            int id, jd, kd, ld, md;

            Level l = Set.get_level(Progress.curr_level());

            int high = Progress.progress_lvl_high();

            if (st_goal.new_name != 0)
            {
                Progress.progress_rename(0);
                st_goal.new_name = 0;
            }

            if ((id = gui.gui_vstack(0)) != 0)
            {
                int gid;

                if (high != 0)
                {
                    gid = gui.gui_label(id, s1, gui.GUI_MED, gui.GUI_ALL, widget.gui_grn, widget.gui_grn);
                }
                else
                {
                    gid = gui.gui_label(id, s2, gui.GUI_LRG, gui.GUI_ALL, widget.gui_blu, widget.gui_grn);
                }

                gui.gui_space(id);

                if (Progress.curr_mode() == MODE.MODE_CHALLENGE)
                {
                    int coins, score, balls;
                    int i;

                    /* Reverse-engineer initial score and balls. */

                    if (st_goal.resume != 0)
                    {
                        coins = 0;
                        score = Progress.curr_score();
                        balls = Progress.curr_balls();
                    }
                    else
                    {
                        coins = game_client.curr_coins();
                        score = Progress.curr_score() - coins;
                        balls = Progress.curr_balls();

                        for (i = Progress.curr_score(); i > score; i--)
                        {
                            if (Progress.progress_reward_ball(i) != 0)
                            {
                                balls--;
                            }
                        }
                    }

                    string msg = Progress.curr_bonus().ToString() +
                                 (Progress.curr_bonus() == 1 ? " new bonus level" : " new bonus levels");

                    if ((jd = gui.gui_hstack(id)) != 0)
                    {
                        gui.gui_filler(jd);

                        if ((kd = gui.gui_vstack(jd)) != 0)
                        {
                            if ((ld = gui.gui_hstack(kd)) != 0)
                            {
                                if ((md = gui.gui_harray(ld)) != 0)
                                {
                                    st_goal.balls_id = gui.gui_count(md, 100, gui.GUI_MED, gui.GUI_NE);
                                    gui.gui_label(md, "Balls", gui.GUI_SML, 0,
                                                  widget.gui_wht, widget.gui_wht);
                                }
                                if ((md = gui.gui_harray(ld)) != 0)
                                {
                                    st_goal.score_id = gui.gui_count(md, 1000, gui.GUI_MED, 0);
                                    gui.gui_label(md, "Score", gui.GUI_SML, 0,
                                                  widget.gui_wht, widget.gui_wht);
                                }
                                if ((md = gui.gui_harray(ld)) != 0)
                                {
                                    st_goal.coins_id = gui.gui_count(md, 100, gui.GUI_MED, 0);
                                    gui.gui_label(md, "Coins", gui.GUI_SML, gui.GUI_NW,
                                                  widget.gui_wht, widget.gui_wht);
                                }

                                gui.gui_set_count(st_goal.balls_id, balls);
                                gui.gui_set_count(st_goal.score_id, score);
                                gui.gui_set_count(st_goal.coins_id, coins);
                            }

                            gui.gui_label(kd, msg, gui.GUI_SML, gui.GUI_BOT, null, null);
                        }

                        gui.gui_filler(jd);
                    }

                    gui.gui_space(id);
                }
                else
                {
                    st_goal.balls_id = st_goal.score_id = st_goal.coins_id = 0;
                }

                Util.gui_score_board(id, (Util.GUI_MOST_COINS |
                                          Util.GUI_BEST_TIMES |
                                          Util.GUI_FAST_UNLOCK), 1, high);

                gui.gui_space(id);

                if ((jd = gui.gui_harray(id)) != 0)
                {
                    if (Progress.progress_done() != 0)
                    {
                        gui.gui_start(jd, "Finish", gui.GUI_SML, st_goal.GOAL_DONE, 0);
                    }
                    else if (Progress.progress_last() != 0)
                    {
                        gui.gui_start(jd, "Finish", gui.GUI_SML, st_goal.GOAL_LAST, 0);
                    }

                    if (Progress.progress_next_avail() != 0)
                    {
                        gui.gui_start(jd, "Next Level", gui.GUI_SML, st_goal.GOAL_NEXT, 0);
                    }

                    if (Progress.progress_same_avail() != 0)
                    {
                        gui.gui_start(jd, "Retry Level", gui.GUI_SML, st_goal.GOAL_SAME, 0);
                    }
                }

                if (st_goal.resume == 0)
                {
                    gui.gui_pulse(gid, 1.2f);
                }

                gui.gui_layout(id, 0, 0);
            }

            Util.set_score_board(l.most_coins, Progress.progress_coin_rank(),
                                 l.best_times, Progress.progress_time_rank(),
                                 l.fast_unlock, Progress.progress_goal_rank());

            Audio.audio_music_fade_out(2.0f);

            Video.video_clr_grab();

            /* Reset hack. */
            st_goal.resume = 0;

            return(id);
        }
Exemple #7
0
        internal override int OnKeybd(Alt.GUI.Keys c, int d)
        {
            if (d != 0)
            {
                if (Config.config_tst_d(Config.CONFIG_KEY_CAMERA_R, c) != 0)
                {
                    st_play.view_rotate = +1;
                }

                if (Config.config_tst_d(Config.CONFIG_KEY_CAMERA_L, c) != 0)
                {
                    st_play.view_rotate = -1;
                }

                if (Config.config_tst_d(Config.CONFIG_KEY_ROTATE_FAST, c) != 0)
                {
                    st_play.fast_rotate = 1;
                }

                st_play.keybd_camera(c);

                if (Config.config_tst_d(Config.CONFIG_KEY_RESTART, c) != 0 &&
                    Progress.progress_same_avail() != 0)
                {
                    if (Progress.progress_same() != 0)
                    {
                        State.goto_state(st_play.get_st_play_ready());
                    }
                }

                if (Config.config_tst_d(Config.CONFIG_KEY_PAUSE, c) != 0)
                {
                    st_pause.goto_pause();
                }
            }
            else
            {
                if (Config.config_tst_d(Config.CONFIG_KEY_CAMERA_R, c) != 0)
                {
                    st_play.view_rotate = 0;
                }

                if (Config.config_tst_d(Config.CONFIG_KEY_CAMERA_L, c) != 0)
                {
                    st_play.view_rotate = 0;
                }

                if (Config.config_tst_d(Config.CONFIG_KEY_ROTATE_FAST, c) != 0)
                {
                    st_play.fast_rotate = 0;
                }
            }

            if (d != 0 &&
                c == Alt.GUI.Keys.F12 &&
                Config.config_cheat() != 0)
            {
                return(State.goto_state(st_play.get_st_look()));
            }

            if (d != 0 &&
                c == Alt.GUI.Keys.F6)
            {
                st_play.show_hud =
                    //!st_play.show_hud;
                    st_play.show_hud == 0 ? 1 : 0;
            }

            if (d != 0 &&
                c == Alt.GUI.Keys.C &&
                Config.config_cheat() != 0)
            {
                Progress.progress_stat(GAME.GAME_GOAL);
                return(State.goto_state(st_goal.get_st_ball_goal()));
            }

            return(1);
        }