Exemplo n.º 1
0
        private void Start()
        {
            // Get References
            ui_manager = FindObjectOfType <UIManager>();

            // Get Current Options Settings
            options            = new Options();
            options.text_speed = ui_manager.text_speed;
            // TODO get other current option settings
            options.menu_frame    = ui_manager.menu_frame;
            options.message_frame = ui_manager.message_frame;

            // Set Windowskin and Text Color
            title_panel.sprite                 = ui_manager.GetCurrentMenuSkin();
            title_text_field.color             = ui_manager.GetBestTextColor(title_panel);
            options_panel.sprite               = ui_manager.GetCurrentMenuSkin();
            options_text_field.color           = ui_manager.GetBestTextColor(options_panel);
            options_selection_text_field.color = ui_manager.GetBestTextColor(options_panel);
            message_panel.sprite               = ui_manager.GetCurrentMessageSkin();
            message_text_field.color           = ui_manager.GetBestTextColor(message_panel);

            // Build Menu
            num_options       = MENU_OPTIONS.Length;
            current_selection = 0;
            BuildMenuText();
            message_text_field.text = GetMessageText(current_selection);
            setting_changed         = false;
            awaiting_input          = true;
        }
Exemplo n.º 2
0
        private void Start()
        {
            // Get references
            ui_manager = FindObjectOfType <UIManager>();

            // Get current party info
            player = ui_manager.GetPlayerTrainer();
            party  = player.party;

            // Set windowskin and text color
            message_panel.sprite     = ui_manager.GetCurrentMenuSkin();
            message_text_field.color = ui_manager.GetBestTextColor(message_panel);
            button_text.color        = CANCEL_TEXT_COLOR;

            // Show pokemon info and build rest of scene
            BuildPokemonPanels();
            message_text_field.text = WELCOME_MESSAGE;
            button_text.text        = CANCEL_TEXT;

            // Ready for interaction
            anim_time         = 0;
            anim_frame        = 0;
            temp_pokemon      = null;
            current_selection = 0;
            swapping          = false;
            awaiting_input    = true;
        }
Exemplo n.º 3
0
        private void Start()
        {
            // Get references
            ui_manager    = FindObjectOfType <UIManager>();
            event_manager = FindObjectOfType <EventManager>();
            player        = ui_manager.GetPlayerTrainer();

            // Pause Game
            event_manager.DisablePlayerControl();
            event_manager.DisableAllEvents();

            // Set Windowskin and Text Color
            panel.sprite     = ui_manager.GetCurrentMenuSkin();
            text_field.color = ui_manager.GetBestTextColor(panel);

            // Build Menu
            BuildMenuOptions();
            if (ui_manager.pause_menu_selection != null)
            {
                current_selection = menu_options.IndexOf((PauseMenuOptions)ui_manager.pause_menu_selection);
            }
            else
            {
                current_selection = 0;
            }
            BuildMenuText();
            BuildMenuIcons();
            interactable = true;
        }
Exemplo n.º 4
0
        private void Start()
        {
            // Get References
            ui_manager = FindObjectOfType <UIManager>();

            // Set Windowskin and Text Color
            panel.sprite     = ui_manager.GetCurrentMenuSkin();
            text_field.color = ui_manager.GetBestTextColor(panel);
            if (ui_manager.IsDarkBG(panel))
            {
                sel_arrow.enabled = false;
            }
            else
            {
                sel_arrow_white.enabled = false;
            }

            // Initialize View Settings
            choices         = text_field.text.Split('\n');
            text_field.text = null;
            BuildChoicePanel();

            // Ready for Interaction
            choice_package    = ui_manager.choice_package;
            current_selection = choice_package.starting_choice;
            SetPointerStartPos();
            finished = false;
        }
Exemplo n.º 5
0
        private void Update()
        {
            // Get player input
            if (interactable)
            {
                if (Input.GetKeyDown(KeyCode.DownArrow))
                {
                    if (current_selection == menu_options.Count - 1)
                    {
                        current_selection = 0;
                    }
                    else
                    {
                        current_selection += 1;
                    }
                }
                else if (Input.GetKeyDown(KeyCode.UpArrow))
                {
                    if (current_selection == 0)
                    {
                        current_selection = menu_options.Count - 1;
                    }
                    else
                    {
                        current_selection -= 1;
                    }
                }
                else if (Input.GetKeyDown(KeyCode.X))
                {
                    CloseMenu();
                }
                else if (Input.GetKeyDown(KeyCode.Z))
                {
                    OpenMenuOption(current_selection);
                }
            }

            // Check if open menu scene was closed
            if (!interactable && open_menu == null)
            {
                panel.sprite     = ui_manager.GetCurrentMenuSkin();
                text_field.color = ui_manager.GetBestTextColor(panel);
                interactable     = true;
            }

            // Update icons based on selection and gender
            for (int i = 0; i < menu_options.Count; i++)
            {
                if (i == current_selection && player.gender == Pokemon.Genders.Female && f_selected[(int)menu_options[i]] != null)
                {
                    menu_icons[i].sprite = f_selected[(int)menu_options[i]];
                }
                else if (i == current_selection)
                {
                    menu_icons[i].sprite = selected[(int)menu_options[i]];
                }
                else
                {
                    menu_icons[i].sprite = non_selected[(int)menu_options[i]];
                }
            }
        }