Пример #1
0
    void OnInitialMenuOptionSelect(int option)
    {
        menu.FinalizarHud();

        switch (option)
        {
        case 0:
            menuDoNovo.IniciarHud();
            estado = EstadoDoMenu.menuNovoJogoCarregarDeletar;
            break;

        case 1:
            menuO.gameObject.SetActive(true);
            estado = EstadoDoMenu.externalUpdate;
            break;

        case 2:
            languageS.Start();
            estado = EstadoDoMenu.menuDeLinguagensAberto;
            break;

        case 3:
            creditos.Start();
            estado = EstadoDoMenu.externalUpdate;
            break;
        }
    }
Пример #2
0
    void ChangeToColorGrid()
    {
        EditableElements     target = activeEditables[cMenu.SelectedOption];
        ColorContainerStruct ccs    = secManager.GetColorAssignById(target.member).coresEditaveis[target.inIndex];

        ChangeColorMainAction(ccs);
        estado = EstadoDoMenu.colorGrid;
    }
Пример #3
0
    void OnSelectColorByClick(MsgSelectedColorByClick msg)
    {
        secManager.ApplyColor(msg.C);

        secManager.EndChangeColor(true);

        FinishColorGrid();

        estado = EstadoDoMenu.main;
    }
Пример #4
0
    void StartGlobalColorMenu()
    {
        estado = EstadoDoMenu.globalizationColors;
        MessageAgregator <ChangeInGlobalColorMessage> .AddListener(OnChangeInGlobalMessage);

        MessageAgregator <ButtonMakeGlobalMessage> .AddListener(OnButtonMakeGlobal);

        MessageAgregator <SelectGlobalColorMessage> .AddListener(OnSelectGlobalColor);

        MessageAgregator <ToggleGlobalColorMessage> .AddListener(OnToggleGlobalColor);
    }
Пример #5
0
    public void OnMenuOfNewOptionSelect(int qual)
    {
        if (qual == 0)
        {
            Input.Iniciar();
        }
        else
        {
            menuDoNovo.IsDeleteOrLoad();
        }

        estado = EstadoDoMenu.externalUpdate;
    }
Пример #6
0
    private bool ColorCircleState()
    {
        bool foi       = false;
        bool effective = false;

        Vector2 V = new Vector2(
            CommandReader.GetAxis("horizontal", Controlador.teclado),
            CommandReader.GetAxis("vertical", Controlador.teclado)
            );

        float val = (Input.GetKey(KeyCode.Q) ? 1 : 0) + (Input.GetKey(KeyCode.E) ? -1 : 0);

        val *= Time.deltaTime * velValForGreyScale;

        myGetColor.MoveMark(V * velValForColor, val);

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            effective = false;
            foi       = true;
        }
        else if (Input.GetKeyDown(KeyCode.Return))
        {
            effective = true;
            foi       = true;
        }
        else if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            EndColorCircle();
            ChangeToColorGrid();
        }
        else if (Input.GetKeyDown(KeyCode.Alpha2) && secManager.GetTargetColorReg != RegistroDeCores.skin)
        {
            EndColorCircle();
            globalCM.StartHud(myGetColor.CurrentColor, secManager.GuardOriginalColor.cor, secManager.VerifyColorReg(), secManager.GetTargetColorReg);
            StartGlobalColorMenu();
        }

        if (foi)
        {
            EndColorCircle();
            secManager.EndChangeColor(effective);
            estado = EstadoDoMenu.main;
        }



        return(true);
    }
Пример #7
0
    void OnStartLoadDeleteButtonPress(IGameEvent e)
    {
        StandardSendGameEvent ssge = (StandardSendGameEvent)e;
        int qual = (int)ssge.MyObject[0];

        if ((bool)ssge.MyObject[1])
        {
            menuDoNovo.IniciarJogo(qual);
        }
        else
        {
            menuDoNovo.DeletarJogo(qual);
        }

        estado = EstadoDoMenu.externalUpdate;
    }
Пример #8
0
    bool ColorState()
    {
        bool foi       = false;
        bool effective = false;

        int x = CommandReader.GetIntTriggerDown("horizontal", Controlador.teclado);
        int y = CommandReader.GetIntTriggerDown("vertical", Controlador.teclado);

        mySuggestionColors.ChangeOption(y, x);

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            effective = false;
            foi       = true;
        }
        else if (Input.GetKeyDown(KeyCode.Return))
        {
            effective = true;
            foi       = true;
        }
        else if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            Color C = mySuggestionColors.GetSelectedColor;

            FinishColorGrid();

            ChangeToColorCircle(C);
        }
        else if (Input.GetKeyDown(KeyCode.Alpha2) && secManager.GetTargetColorReg != RegistroDeCores.skin)
        {
            globalCM.StartHud(mySuggestionColors.GetSelectedColor, secManager.GuardOriginalColor.cor, secManager.VerifyColorReg(), secManager.GetTargetColorReg);
            StartGlobalColorMenu();
            FinishColorGrid();
        }

        if (foi)
        {
            secManager.EndChangeColor(effective);

            FinishColorGrid();

            estado = EstadoDoMenu.main;
        }
        return(true);
    }
Пример #9
0
    private void ChangeToColorCircle(Color C)
    {
        myGetColor.transform.parent.gameObject.SetActive(true);
        estado = EstadoDoMenu.colorCircle;

        EventAgregator.AddListener(EventKey.changeColorPicker, OnChangeColorPicker);

        SupportSingleton.Instance.InvokeOnEndFrame(() =>
        {
            myGetColor.SetColor(C);

            EditableElements target = activeEditables[cMenu.SelectedOption];

            MessageAgregator <MsgOpenColorMenu> .Publish(new MsgOpenColorMenu()
            {
                reg = secManager.GetTargetColorReg
            });
        });
    }
Пример #10
0
    void StartCharactersSavedMenu(int indice = 0)
    {
        List <CustomizationContainerDates> lccd = ToSaveCustomizationContainer.Instance.ccds;

        if (lccd.Count > 0)
        {
            string[] ss = new string[lccd.Count];
            for (int i = 0; i < ss.Length; i++)
            {
                ss[i] = lccd[i].Sid;
            }
            cMenu.FinishHud();
            charDbMenu.StartHud((int x) => { }, ss, selectIndex: indice);
            ChangeBaseCharacter(lccd[indice].PersBase == PersonagemBase.masculino);
            secManager.SetCustomDates(lccd[indice]);

            estado = EstadoDoMenu.characterSaveChanges;
        }
    }
Пример #11
0
    private void OnSelectGlobalColor(SelectGlobalColorMessage obj)
    {
        transitoryReg = obj.indexOfGlobal;
        estado        = EstadoDoMenu.globalizationMenu;

        EndGlobalColorMenu();
        globalMenu.StartHud(OpcoesDoGlobalizationMenu,
                            new string[3] {
            "Selecionar a cor e não usar registro", "Selecionar a cor e usar o registro", "Voltar para o menu anterior"
        });

        EditableElements target = activeEditables[cMenu.SelectedOption];

        Debug.Log(target.member + " : " + target.inIndex);

        ColorContainerStruct ccs = secManager.GetColorAssignById(target.member).coresEditaveis[target.inIndex];

        if (ccs.coresEditaveis.registro == obj.indexOfGlobal)
        {
            globalMenu.ChangeSelectionTo(1);
        }
    }
Пример #12
0
    private void OpcoesDoGlobalizationMenu(int x)
    {
        switch (x)
        {
        case 0:
            estado = EstadoDoMenu.main;
            secManager.ChangeColorReg(RegistroDeCores.registravel);
            break;

        case 1:
            estado = EstadoDoMenu.main;
            secManager.ChangeColorReg(transitoryReg);
            break;

        case 2:
            globalCM.StartHud(globalCM.RememberedColor, secManager.GuardOriginalColor.cor, secManager.VerifyColorReg(), secManager.GetTargetColorReg);
            StartGlobalColorMenu();
            break;
        }

        globalMenu.FinishHud();
    }
Пример #13
0
    private bool GlobalizationColorsState()
    {
        globalCM.ChangeOption(
            CommandReader.GetIntTriggerDown("horizontal", Controlador.teclado),
            -CommandReader.GetIntTriggerDown("vertical", Controlador.teclado)
            );

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            secManager.EndChangeColor(false);
            estado = EstadoDoMenu.main;
            EndGlobalColorMenu();
        }
        else if (Input.GetKeyDown(KeyCode.Return))
        {
            globalCM.InvokeSelectedAction();
        }
        else if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            EndGlobalColorMenu();
            ChangeToColorGrid();
        }
        else if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            ChangeToColorCircle(globalCM.RememberedColor);
            EndGlobalColorMenu();
        }
        else if (Input.GetKeyDown(KeyCode.Space))
        {
            EndGlobalColorMenu();
            estado = EstadoDoMenu.main;
        }


        return(true);
    }
Пример #14
0
 public void BotaoVoltarAoMenuPrincipal()
 {
     estado = EstadoDoMenu.faseInicial;
     menuDoNovo.FinalizarHud(2);
     menu.IniciarHud(OnInitialMenuOptionSelect, BancoDeTextos.RetornaListaDeTextoDoIdioma(ChaveDeTexto.opcoesDeMenu).ToArray());
 }
Пример #15
0
    bool MainState()
    {
        bool up      = Input.GetKeyDown(KeyCode.W);
        bool down    = Input.GetKeyDown(KeyCode.S);
        bool left    = Input.GetKeyDown(KeyCode.A);
        bool right   = Input.GetKeyDown(KeyCode.D);
        int  change  = (up ? -1 : 0) + (down ? 1 : 0);
        int  hChange = (left ? -1 : 0) + (right ? 1 : 0);

        cMenu.ChangeOption(change);
        ChangeAction(hChange, cMenu.SelectedOption);

        if (Input.GetKeyDown(KeyCode.Return))
        {
            MessageAgregator <MsgNegativeUiInput> .Publish();

            MainAction(cMenu.SelectedOption);
        }
        else if (Input.GetKeyDown(KeyCode.Escape))
        {
            MessageAgregator <MsgNegativeUiInput> .Publish();

            EscapeAction(cMenu.SelectedOption);
        }
        else if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            #region SloteSaveCOnfirmation
            estado = EstadoDoMenu.confirmacaoAberta;
            confirmation.StartConfirmationPanel(() =>
            {
                CustomizationContainerDates ccd = secManager.GetCustomDates();
                ccd.Save();
                estado = EstadoDoMenu.main;
            }, () =>
            {
                estado = EstadoDoMenu.main;
            }, "Deseja salvar esse personagem no slote de salvamento único?", hideSelections: true);
            #endregion
        }
        else if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            #region sloteLoadConfirmation
            estado = EstadoDoMenu.confirmacaoAberta;
            confirmation.StartConfirmationPanel(() =>
            {
                CustomizationContainerDates ccd = new CustomizationContainerDates();
                ccd.Load();
                secManager.SetCustomDates(ccd);
                estado = EstadoDoMenu.main;
            }, () =>
            {
                estado = EstadoDoMenu.main;
            }, "Deseja carregar o personagem do slote de salvamento único?", hideSelections: true);
            #endregion
        }
        else if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            #region combineMeshConfirmation
            estado = EstadoDoMenu.confirmacaoAberta;
            confirmation.StartConfirmationPanel(() =>
            {
                bool generoMasculino = secManager == secManagerH_Base;
                testMeshCombiner.StartCombiner(secManager);
                estado = EstadoDoMenu.main;
            }, () =>
            {
                estado = EstadoDoMenu.main;
            }, "Combinar malhas?", hideSelections: true);
            #endregion
        }
        else if (Input.GetKeyDown(KeyCode.Alpha4))
        {
            #region saveInTheArrayConfirmation
            estado = EstadoDoMenu.confirmacaoAberta;
            confirmation.StartConfirmationPanel(() =>
            {
                ToSaveCustomizationContainer.Instance.Save(secManager.GetCustomDates());
                estado = EstadoDoMenu.main;
            }, () =>
            {
                estado = EstadoDoMenu.main;
            }, "Deseja salvar esse pernogem no vetor de personagens?", hideSelections: true);
            #endregion
        }
        else if (Input.GetKeyDown(KeyCode.Alpha5))
        {
            #region loadOfTheArrrayConfirmation
            estado = EstadoDoMenu.confirmacaoAberta;
            confirmation.StartConfirmationPanel(() =>
            {
                ToSaveCustomizationContainer.Instance.Load();
                List <CustomizationContainerDates> lccd = ToSaveCustomizationContainer.Instance.ccds;
                if (lccd != null && lccd.Count > 0)
                {
                    int i = UnityEngine.Random.Range(0, lccd.Count);
                    secManager.SetCustomDates(lccd[i]);
                }
                else
                {
                    Debug.Log(lccd);
                    Debug.Log(lccd.Count);
                }

                secManager.gameObject.SetActive(false);
                SupportSingleton.Instance.InvokeOnEndFrame(() =>
                {
                    secManager.gameObject.SetActive(true);
                });
                estado = EstadoDoMenu.main;
            }, () =>
            {
                estado = EstadoDoMenu.main;
            }, "Deseja tentar carregar um pernogem do vetor de personagens?", hideSelections: true);
            #endregion
        }
        else if (Input.GetKeyDown(KeyCode.Alpha6))
        {
            ToSaveCustomizationContainer.Instance.Load();
            StartCharactersSavedMenu();
        }

        return(false);
    }
Пример #16
0
 void RequestStandardMenu(IGameEvent e)
 {
     estado = EstadoDoMenu.faseInicial;
     menu.IniciarHud(OnInitialMenuOptionSelect, BancoDeTextos.RetornaListaDeTextoDoIdioma(ChaveDeTexto.opcoesDeMenu).ToArray());
 }
Пример #17
0
    private void MainAction(int index)
    {
        EditableElements target = activeEditables[index];

        if (target.type == EditableType.control)
        {
            ControlMainAction(target);
        }
        else if (target.type == EditableType.mesh || target.type == EditableType.texture)
        {
            ChangeElementMainAction(target);
        }
        else if (target.type == EditableType.color)
        {
            ColorContainerStruct ccs = secManager.GetColorAssignById(target.member).coresEditaveis[target.inIndex];

            secManager.StartChangeColor(target.member, target.inIndex, ccs);
            ChangeColorMainAction(ccs);
            estado = EstadoDoMenu.colorGrid;
        }
        else if (target.type == EditableType.personagemBase)
        {
            if (secManager == secManagerH_Base)
            {
                ChangeBaseCharacter(false);
                DirectionalCamera cDir = CameraApplicator.cam.Cdir;
                //CameraAplicator.cam.FocusBasicCam(secManager.transform, 0.2f, .7f);
                CameraApplicator.cam.Cdir.VarVerticalHeightPoint = .7f;
                SupportSingleton.Instance.InvokeOnEndFrame(() =>
                {
                    secManager.SetColorsByAssign(secManagerH_Base.ColorAssign);
                });
            }
            else if (secManager == secManagerM_Base)
            {
                ChangeBaseCharacter(true);
                DirectionalCamera cDir = CameraApplicator.cam.Cdir;
                //CameraAplicator.cam.FocusBasicCam(secManager.transform, 0.2f, .7f);
                CameraApplicator.cam.Cdir.VarVerticalHeightPoint = .7f;
                SupportSingleton.Instance.InvokeOnEndFrame(() =>
                {
                    CameraApplicator.cam.Cdir.VarVerticalHeightPoint = .7f;
                    secManager.SetColorsByAssign(secManagerM_Base.ColorAssign);
                });
            }
        }
        else if (target.type == EditableType.conclusao)
        {
            estado = EstadoDoMenu.confirmacaoAberta;
            confirmation.StartConfirmationPanel(
                () => {
                cMenu.FinishHud();
                ProvisionalStartGame.InitProvisionalStartGame(
                    testMeshCombiner, secManager
                    );
            },
                () => {
                estado = EstadoDoMenu.main;
            },
                "Iniciar o jogo com esse personagem?",
                hideSelections: true
                );
        }
    }
Пример #18
0
    private bool CharacterSaveChangesState()
    {
        int change = -CommandReader.GetIntTriggerDown("vertical", Controlador.teclado);

        if (change != 0)
        {
            charDbMenu.ChangeOption(change);
            List <CustomizationContainerDates> lccd = ToSaveCustomizationContainer.Instance.ccds;
            ChangeBaseCharacter(lccd[charDbMenu.SelectedOption].PersBase == PersonagemBase.masculino);

            SupportSingleton.Instance.InvokeOnEndFrame(() =>
            {
                secManager.SetCustomDates(lccd[charDbMenu.SelectedOption]);
            });
        }
        else if (Input.GetKeyDown(KeyCode.Return))
        {
            cMenu.StartHud(secManager, MainAction, ChangeAction, EscapeAction, activeEditables);
            charDbMenu.FinishHud();
            estado = EstadoDoMenu.main;
        }
        else if (Input.GetKeyDown(KeyCode.Escape))
        {
            estado = EstadoDoMenu.confirmacaoAberta;
            confirmation.StartConfirmationPanel(
                () =>
            {
                ToSaveCustomizationContainer.Instance.ccds.RemoveAt(charDbMenu.SelectedOption);
                ToSaveCustomizationContainer.Instance.SaveLoaded();

                charDbMenu.FinishHud();

                StartCharactersSavedMenu();

                estado = EstadoDoMenu.characterSaveChanges;
            },
                () => { estado = EstadoDoMenu.characterSaveChanges; },
                "Gostaria de deletar esse personagem do vetor?",
                hideSelections: true);
        }
        else if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            //charDbMenu.FinishHud();
            estado = EstadoDoMenu.inputTextOpened;

            inputTextManager.StartHud(() => {
                CustomizationContainerDates ccd = ToSaveCustomizationContainer.Instance.ccds[charDbMenu.SelectedOption];

                ccd.Sid = inputTextManager.TextContent;
                ToSaveCustomizationContainer.Instance.SaveLoaded();
                int guard = charDbMenu.SelectedOption;
                charDbMenu.FinishHud();
                StartCharactersSavedMenu(guard);
                inputTextManager.FinishHud();

                estado = EstadoDoMenu.characterSaveChanges;
            }, () => {
                //inputTextManager.FinishHud();
                //charDbMenu.FinishHud();
                //StartCharactersSavedMenu();
                estado = EstadoDoMenu.characterSaveChanges;
            },
                                      "Escolha um nome, que será identificador  ID, para esse personagem");
        }
        return(true);
    }
Пример #19
0
 void ReturnOfDelete(IGameEvent e)
 {
     estado = EstadoDoMenu.menuNovoJogoCarregarDeletar;
 }