Exemplo n.º 1
0
        public static int start_action(int i)
        {
            Audio.audio_play(Common.AUD_MENU, 1.0f);

            switch (i)
            {
            case START_BACK:
                return(State.goto_state(st_set.get_st_set()));

            case START_CHALLENGE:
                if (Config.config_cheat() != 0)
                {
                    Progress.progress_init(Progress.curr_mode() == MODE.MODE_CHALLENGE ?
                                           MODE.MODE_NORMAL : MODE.MODE_CHALLENGE);
                    gui.gui_toggle(challenge_id);
                    return(1);
                }
                else
                {
                    Progress.progress_init(MODE.MODE_CHALLENGE);
                    return(start_action(0));
                }

            case Util.GUI_MOST_COINS:
            case Util.GUI_BEST_TIMES:
            case Util.GUI_FAST_UNLOCK:
                Util.gui_score_set(i);
                return(State.goto_state(get_st_start()));

            case START_OPEN_GOALS:
                Config.config_set_d(Config.CONFIG_LOCK_GOALS, 0);
                return(State.goto_state(get_st_start()));

            case START_LOCK_GOALS:
                Config.config_set_d(Config.CONFIG_LOCK_GOALS, 1);
                return(State.goto_state(get_st_start()));

            default:
                if (Progress.progress_play(i) != 0)
                {
                    return(State.goto_state(st_level.get_st_level()));
                }
                break;
            }

            return(1);
        }
Exemplo n.º 2
0
        internal override int OnEnter()
        {
            int w = Config.config_get_d(Config.CONFIG_WIDTH);
            int h = Config.config_get_d(Config.CONFIG_HEIGHT);
            int i, j;

            int id, jd, kd, ld;

            Progress.progress_init(MODE.MODE_NORMAL);

            if ((id = gui.gui_vstack(0)) != 0)
            {
                if ((jd = gui.gui_hstack(id)) != 0)
                {
                    gui.gui_label(jd, Set.set_name(Set.curr_set()), gui.GUI_SML, gui.GUI_ALL,
                                  widget.gui_yel, widget.gui_red);
                    gui.gui_filler(jd);
                    gui.gui_start(jd, "Back", gui.GUI_SML, st_start.START_BACK, 0);
                }

                gui.gui_space(id);

                if ((jd = gui.gui_harray(id)) != 0)
                {
                    if (Config.config_cheat() != 0)
                    {
                        if ((kd = gui.gui_vstack(jd)) != 0)
                        {
                            st_start.shot_id = gui.gui_image(kd, Set.set_shot(Set.curr_set()), 6 * w / 16, 6 * h / 16);

                            st_start.file_id = gui.gui_label(kd, " ", gui.GUI_SML, gui.GUI_ALL,
                                                             widget.gui_yel, widget.gui_red);
                        }
                    }
                    else
                    {
                        st_start.shot_id = gui.gui_image(jd, Set.set_shot(Set.curr_set()), 7 * w / 16, 7 * h / 16);
                    }

                    if ((kd = gui.gui_varray(jd)) != 0)
                    {
                        for (i = 0; i < 5; i++)
                        {
                            if ((ld = gui.gui_harray(kd)) != 0)
                            {
                                for (j = 4; j >= 0; j--)
                                {
                                    st_start.gui_level(ld, i * 5 + j);
                                }
                            }
                        }

                        st_start.challenge_id = gui.gui_state(kd, "Challenge",
                                                              gui.GUI_SML, st_start.START_CHALLENGE,
                                                              Progress.curr_mode() == MODE.MODE_CHALLENGE ? 1 : 0);
                    }
                }
                gui.gui_space(id);
                Util.gui_score_board(id, (Util.GUI_MOST_COINS |
                                          Util.GUI_BEST_TIMES |
                                          Util.GUI_FAST_UNLOCK), 0, 0);
                gui.gui_space(id);

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

                    if ((kd = gui.gui_harray(jd)) != 0)
                    {
                        /* TODO, replace the whitespace hack with something sane. */

                        gui.gui_state(kd,

                                      /* Translators: adjust the amount of whitespace here
                                       * as necessary for the buttons to look good. */
                                      "   No   ", gui.GUI_SML, st_start.START_OPEN_GOALS,
                                      Config.config_get_d(Config.CONFIG_LOCK_GOALS) == 0 ? 1 : 0);

                        gui.gui_state(kd, "Yes", gui.GUI_SML, st_start.START_LOCK_GOALS,
                                      Config.config_get_d(Config.CONFIG_LOCK_GOALS) == 1 ? 1 : 0);
                    }

                    gui.gui_space(jd);

                    gui.gui_label(jd, "Lock Goals of Completed Levels?",
                                  gui.GUI_SML, gui.GUI_ALL, null, null);

                    gui.gui_filler(jd);
                }

                gui.gui_layout(id, 0, 0);

                Util.set_score_board(null, -1, null, -1, null, -1);
            }

            Audio.audio_music_fade_to(0.5f, "bgm/inter.ogg");

            return(id);
        }