Example #1
0
    private bool LoadSaveQuestion(bool overwriting)
    {
        int    enunciateTextID = GameTextDatabase.INVALID_TEXT_ID;
        string textEnunciate   = null;
        string textOptionZero  = null;
        string textOptionOne   = null;
        bool   toDiscard       = false;
        bool   textCreated     = false;

        if ((gameTextDatabase != null) && (textBoxManager != null))
        {
            enunciateTextID = (overwriting ? GameTextDatabase.TEXT_ID_SAVE_OVERWRITE_ENUNCIATE : GameTextDatabase.TEXT_ID_SAVE_ENUNCIATE);
            textEnunciate   = gameTextDatabase.GetSystemText(enunciateTextID, ref toDiscard);
            textOptionZero  = gameTextDatabase.GetSystemText(GameTextDatabase.TEXT_ID_YES, ref toDiscard);
            textOptionOne   = gameTextDatabase.GetSystemText(GameTextDatabase.TEXT_ID_NO, ref toDiscard);
            if ((textEnunciate != null) && (textOptionZero != null) && (textOptionOne != null))
            {
                textBoxManager.PrepareForQuestion(this, 2);
                textCreated = textBoxManager.ShowDialogue(null, textEnunciate, true, false, null, TextBoxManager.QuestionRole.Enunciate);
                if (textCreated)
                {
                    textCreated = textBoxManager.ShowDialogue(null, textOptionZero, true, false, null, TextBoxManager.QuestionRole.Option);
                }
                if (textCreated)
                {
                    textCreated = textBoxManager.ShowDialogue(null, textOptionOne, true, false, null, TextBoxManager.QuestionRole.Option);
                }
                if (!textCreated)
                {
                    textBoxManager.ClearAllDialogues();
                }
                else
                {
                    /*halmeida - set option indexes for a generic confirmation and a generic cancellation commands, so that options
                     * don't actually need to be clicked to be chosen.*/
                    textBoxManager.SetOptionIndexConfirm(0);
                    textBoxManager.SetOptionIndexCancel(1);
                }
            }
        }
        return(textCreated);
    }