/// <summary>
    /// Display original or updated level name, selected monster, selected time limit
    /// </summary>
    private void DisplayLevelInit()
    {
        if (updated == 0)
        {
            CustomLevel levelInfo = editLevelBL.LoadCustomLevelInfo();
            levelNameLine.Text = levelInfo.CustomLevelName;

            int i = 0;
            foreach (int a in timeLimitOptions)
            {
                if (a == levelInfo.TimeLimit)
                {
                    GD.Print("Found time: " + a);
                    break;
                }
                i++;
            }
            timeLimitBtn.Select(i);

            GD.Print("\nCustom Level Id: " + levelInfo.CustomLevelId + "\nCustom Level Name: " + levelInfo.CustomLevelName + "\nMonster Id: " + levelInfo.Monster.MonsterId +
                     "\nTimeLimit: " + levelInfo.TimeLimit);

            count = levelInfo.Monster.MonsterId - 1;
            UpdateArrowButtonStatuses();
            DisplayCharacter();

            oldName      = levelInfo.CustomLevelName;
            oldMonsterId = levelInfo.Monster.MonsterId;
            oldTimeLimit = levelInfo.TimeLimit;
        }
        else
        {
            levelNameLine.Text = Global.CustomLevelName;

            int i = 0;
            foreach (int a in timeLimitOptions)
            {
                if (a == Global.TimeLimit)
                {
                    GD.Print("Found time: " + a);
                    break;
                }
                i++;
            }
            timeLimitBtn.Select(i);

            GD.Print("\nCustom Level Id: " + Global.CustomLevelId + "\nCustom Level Name: " + Global.CustomLevelName + "\nMonster Id: " + Global.MonsterId +
                     "\nTimeLimit: " + Global.TimeLimit);

            count = Global.MonsterId - 1;
            UpdateArrowButtonStatuses();
            DisplayCharacter();
        }
    }
示例#2
0
    /// <summary>
    /// Initialization
    /// </summary>
    public override void _Ready()
    {
        editLevelBL = new EditLevelBL();

        questionNumberLabel = GetNode <Label>("QuestionNumberLabel");
        errorMessageLabel   = GetNode <Label>("ErrorMessageLabel");

        checkbox1 = GetNode <CheckBox>("Options/Option1/CheckBox1");
        checkbox2 = GetNode <CheckBox>("Options/Option2/CheckBox2");
        checkbox3 = GetNode <CheckBox>("Options/Option3/CheckBox3");
        checkbox4 = GetNode <CheckBox>("Options/Option4/CheckBox4");

        question1Btn = GetNode <TextureButton>("QuestionSelect/Question1");
        question2Btn = GetNode <TextureButton>("QuestionSelect/Question2");
        question3Btn = GetNode <TextureButton>("QuestionSelect/Question3");
        question4Btn = GetNode <TextureButton>("QuestionSelect/Question4");
        question5Btn = GetNode <TextureButton>("QuestionSelect/Question5");

        questionGroup = new ButtonGroup();
        checkboxGroup = new ButtonGroup();

        question1Btn.SetButtonGroup(questionGroup);
        question2Btn.SetButtonGroup(questionGroup);
        question3Btn.SetButtonGroup(questionGroup);
        question4Btn.SetButtonGroup(questionGroup);
        question5Btn.SetButtonGroup(questionGroup);

        checkbox1.SetButtonGroup(checkboxGroup);
        checkbox2.SetButtonGroup(checkboxGroup);
        checkbox3.SetButtonGroup(checkboxGroup);
        checkbox4.SetButtonGroup(checkboxGroup);


        questionTitleLine = GetNode <LineEdit>("QuestionTitle");

        option1Line = GetNode <LineEdit>("Options/Option1");
        option2Line = GetNode <LineEdit>("Options/Option2");
        option3Line = GetNode <LineEdit>("Options/Option3");
        option4Line = GetNode <LineEdit>("Options/Option4");

        CustomLevel customLevelInfo = editLevelBL.LoadCustomLevelInfo();

        DisplayQuestion();
    }