Exemplo n.º 1
0
    // called when we get to the shogun panel
    void InitShogunPanel()
    {
        Skinning.ResetSkin(selectedSkin);

        if (shogunManager == null)
        {
            Debug.LogError(debuguableInterface.debugLabel + "ShogunManager component shouldn't be null. If we can't get scene references we can't do anything.");
            return;
        }

        EnemyBundle bundle = gameData.enemyContent.Find(item => { return(item.enemy == actualEnemy); });

        GeneralDialogue selectedGeneral = bundle.shogunDialogue;

        selectedGeneral.Init();

        CombatDialogue selectedCombat = bundle.combatDialogue;

        shogunManager.Init(useCheats, () =>
        {
            popupManager.Pop(GamePopup.SHOGUN_DEDUCTION);
            audioProjectManager.FadeMusicOut();
        }, audioProjectManager.FadePopupMusicIn);

        popupManager.GetPopupFromType <ShogunPopup>().SpecificInit(
            useCheats,
            selectedGeneral.GetAllClues(),
            selectedGeneral.unlockableConclusions,
            shogunManager.characters,
            selectedGeneral.goodDeityFeedback,
            selectedGeneral.badDeityFeedback,
            () =>
        {
            popupManager.CancelPop();
            audioProjectManager.FadeMusicIn();
        },
            () =>
        {
            audioProjectManager.FadeMusicOut();
            audioProjectManager.FadePopupMusicOut();

            panelManager.JumpTo(GamePhase.FIGHT, () =>
            {
                fightManager = FindObjectOfType <FightManager>();
                fightManager.PreInit(selectedCombat);

                audioProjectManager.FadeMusicOut();
            });
        },
            selectedCombat.actualState
            );

        if (selectedCombat.actualState == GameState.NORMAL)
        {
            gameData.ResetPlayerClues();
        }

        actualTutorial.Init(() => shogunManager.StartDialogue(selectedGeneral));
    }
Exemplo n.º 2
0
    public void PreInit(GameData.GameState targetState, GeneralDialogue dialogue, Func <Clue, bool> findClue)
    {
        findClueEvent = findClue;

        background.color = ColorTools.LerpColorValues(Skinning.GetSkin(SkinTag.PICTO), ColorTools.Value.SV, new int[2] {
            8, 10
        });

        characterPortrait.Hide();
        characters.ForEach(item => item.Init(() => ChangeCharacter(item.character)));

        ColorBlock block = dialogueScroll.colors;

        block.normalColor      = Skinning.GetSkin(SkinTag.SECONDARY_ELEMENT);
        block.highlightedColor = Skinning.GetSkin(SkinTag.SECONDARY_WINDOW);
        block.pressedColor     = Skinning.GetSkin(SkinTag.CONTRAST);
        dialogueScroll.colors  = block;

        scrollButton.Init(this);

        block                      = scrollButton.button.colors;
        block.normalColor          = Skinning.GetSkin(SkinTag.PRIMARY_ELEMENT);
        block.highlightedColor     = Skinning.GetSkin(SkinTag.PRIMARY_WINDOW);
        block.pressedColor         = Skinning.GetSkin(SkinTag.CONTRAST);
        block.disabledColor        = block.normalColor;
        scrollButton.button.colors = block;

        // when you come back to shogun after defeat
        if (targetState != GameData.GameState.NORMAL)
        {
            // unlocks all clues
            foreach (Clue clue in dialogue.GetAllClues())
            {
                findClue.Invoke(clue);
                AddClueToList(clue, true);
            }
        }

        actualState = targetState;
    }