/// <summary>
 /// Callback when the Preset drop down selection has changed during "save" mode
 /// </summary>
 private void DropDownPresetSelect_SelectedIndexChanged_IsSave()
 {
     if (IsCreatePresetSelected)
     {
         // show the field to specify a new name when "create" option is selected in drop down
         tbNewPresetName.Enable();
         lblNewPresetName.Enable();
     }
     else
     {
         // hide the field to specify a new name when an existing preset is selected
         tbNewPresetName.Disable();
         lblNewPresetName.Disable();
     }
 }
Beispiel #2
0
        private void BtnDisplayAdvancedOptions_LeftClick(object sender, EventArgs e)
        {
            Name = "GameCreationWindow_Advanced";

            ClientRectangle = new Rectangle(X, Y,
                                            Width, 420);

            btnCreateGame.ClientRectangle = new Rectangle(btnCreateGame.X,
                                                          Height - 29, btnCreateGame.Width,
                                                          btnCreateGame.Height);

            btnCancel.ClientRectangle = new Rectangle(btnCancel.X,
                                                      Height - 29, btnCancel.Width,
                                                      btnCancel.Height);

            btnLoadMPGame.ClientRectangle = new Rectangle(btnLoadMPGame.X,
                                                          Height - 29, btnLoadMPGame.Width,
                                                          btnLoadMPGame.Height);

            lblTunnelServer.Enable();
            lbTunnelList.Enable();
            btnDisplayAdvancedOptions.Disable();

            SetAttributesFromIni();

            CenterOnParent();
            // TODO fix this hack in Rampastring.XNAUI, refreshes scrollbar position on screen
            lbTunnelList.ClientRectangle = lbTunnelList.ClientRectangle;
        }
Beispiel #3
0
        private void BtnDisplayAdvancedOptions_LeftClick(object sender, EventArgs e)
        {
            Name = "GameCreationWindow_Advanced";

            ClientRectangle = new Rectangle(X, Y,
                                            Width, 420);

            btnCreateGame.ClientRectangle = new Rectangle(btnCreateGame.X,
                                                          Height - 29, btnCreateGame.Width,
                                                          btnCreateGame.Height);

            btnCancel.ClientRectangle = new Rectangle(btnCancel.X,
                                                      Height - 29, btnCancel.Width,
                                                      btnCancel.Height);

            btnLoadMPGame.ClientRectangle = new Rectangle(btnLoadMPGame.X,
                                                          Height - 29, btnLoadMPGame.Width,
                                                          btnLoadMPGame.Height);

            lblTunnelServer.Enable();
            lbTunnelList.Enable();
            btnDisplayAdvancedOptions.Disable();

            SetAttributesFromIni();

            CenterOnParent();
        }
Beispiel #4
0
        private void BtnDisplayAdvancedOptions_LeftClick(object sender, EventArgs e)
        {
            Name = "GameCreationWindow_Advanced";

            btnCreateGame.ClientRectangle = new Rectangle(btnCreateGame.X,
                                                          lbTunnelList.Bottom + UIDesignConstants.CONTROL_VERTICAL_MARGIN * 3,
                                                          btnCreateGame.Width, btnCreateGame.Height);

            btnCancel.ClientRectangle = new Rectangle(btnCancel.X,
                                                      btnCreateGame.Y, btnCancel.Width, btnCancel.Height);

            btnLoadMPGame.ClientRectangle = new Rectangle(btnLoadMPGame.X,
                                                          btnCreateGame.Y, btnLoadMPGame.Width, btnLoadMPGame.Height);

            Height = btnCreateGame.Bottom + UIDesignConstants.CONTROL_VERTICAL_MARGIN + UIDesignConstants.EMPTY_SPACE_BOTTOM;

            lblTunnelServer.Enable();
            lbTunnelList.Enable();
            btnDisplayAdvancedOptions.Disable();

            SetAttributesFromIni();

            CenterOnParent();
        }
Beispiel #5
0
        /// <summary>
        /// Configures the preconditions / globals UI for a mission.
        /// </summary>
        /// <param name="mission">The mission. Can be null.</param>
        private void PreconditionUIConfig(Mission mission)
        {
            lblPreconditionsHeader.Disable();
            for (int i = 0; i < MAX_GLOBAL_COUNT; i++)
            {
                globalVariableNames[i].Disable();
                globalVariableValues[i].Disable();
            }

            tbMissionDescription.Height = globalVariableValues[0].Bottom - tbMissionDescription.Y;


            if (mission != null && mission.UsedGlobalVariables.Length > 0)
            {
                lblPreconditionsHeader.Enable();

                for (int i = 0; i < mission.UsedGlobalVariables.Length && i < MAX_GLOBAL_COUNT; i++)
                {
                    CampaignGlobalVariable global = CampaignHandler.Instance.GlobalVariables.Find(gv => gv.InternalName == mission.UsedGlobalVariables[i]);

                    globalVariableNames[i].Text      = global.UIName;
                    globalVariableNames[i].TextColor = UISettings.ActiveSettings.TextColor;
                    globalVariableNames[i].Enable();

                    bool disabledSelectable = global.IsDisabledUnlocked || global.DisableOptionFreeUnlock;
                    bool enabledSelectable  = global.IsEnabledUnlocked;

                    if (disabledSelectable)
                    {
                        globalVariableValues[i].Items[0].Text = global.UIDisabledOption ?? "No";
                    }
                    else
                    {
                        globalVariableValues[i].Items[0].Text = "Option not unlocked";
                    }

                    if (enabledSelectable)
                    {
                        globalVariableValues[i].Items[1].Text = global.UIEnabledOption ?? "Yes";
                    }
                    else
                    {
                        globalVariableValues[i].Items[1].Text = "Option not unlocked";
                    }

                    globalVariableValues[i].Items[0].Selectable = disabledSelectable;
                    globalVariableValues[i].Items[1].Selectable = enabledSelectable;
                    globalVariableValues[i].SelectedIndex       = 0;
                    if (global.IsEnabledUnlocked)
                    {
                        if (!global.IsDisabledUnlocked || global.EnabledThroughPreviousScenario)
                        {
                            globalVariableValues[i].SelectedIndex = 1;
                        }
                    }

                    if (global.HideIfNotEnabledUnlocked)
                    {
                        globalVariableValues[i].Items[0].Text = "-";
                        globalVariableValues[i].Items[1].Text = "-";
                        globalVariableNames[i].Text           = "Unknown Condition (not yet unlocked)";
                        globalVariableNames[i].TextColor      = UISettings.ActiveSettings.DisabledItemColor;
                    }

                    globalVariableValues[i].Enable();
                }

                int preconditionsHeaderY = mission.UsedGlobalVariables.Length >= MAX_GLOBAL_COUNT ? globalVariableNames[0].Y :
                                           globalVariableNames[mission.UsedGlobalVariables.Length - 1].Y;
                preconditionsHeaderY    -= UIDesignConstants.CONTROL_VERTICAL_MARGIN * 3;
                lblPreconditionsHeader.Y = preconditionsHeaderY;
                lblPreconditionsHeader.Enable();

                tbMissionDescription.Height = lblPreconditionsHeader.Y - (UIDesignConstants.CONTROL_VERTICAL_MARGIN * 2) - tbMissionDescription.Y;
            }
        }