예제 #1
0
        private void TryLoadStringMod(VariableMod varMod)
        {
            if (varMod == null)
            {
                varMod = new StringVariableMod();
            }

            if (varMod.GetType() == typeof(StringVariableMod))
            {
                var mod = (StringVariableMod)varMod;

                switch (mod.ModType)
                {
                case VariableMods.Set:
                    optStaticString.Checked = true;
                    txtStringValue.Text     = mod.Value;

                    break;

                case VariableMods.Replace:
                    optReplaceString.Checked = true;
                    txtStringFind.Text       = mod.Value;
                    txtStringReplace.Text    = mod.Replace;

                    break;
                }
            }
        }
예제 #2
0
        private void TryLoadBooleanMod(VariableMod varMod)
        {
            if (varMod == null)
            {
                varMod = new BooleanVariableMod();
            }

            if (varMod.GetType() == typeof(BooleanVariableMod))
            {
                var mod = (BooleanVariableMod)varMod;

                optBooleanTrue.Checked  = mod.Value;
                optBooleanFalse.Checked = !mod.Value;

                if (mod.DuplicateVariableId != Guid.Empty)
                {
                    if (mod.DupVariableType == VariableTypes.PlayerVariable)
                    {
                        optBooleanClonePlayerVar.Checked       = true;
                        cmbBooleanClonePlayerVar.SelectedIndex = PlayerVariableBase.ListIndex(mod.DuplicateVariableId);
                    }
                    else
                    {
                        optBooleanCloneGlobalVar.Checked       = true;
                        cmbBooleanCloneGlobalVar.SelectedIndex = ServerVariableBase.ListIndex(mod.DuplicateVariableId);
                    }
                }
            }
        }
예제 #3
0
        private void TryLoadNumericMod(VariableMod varMod)
        {
            if (varMod == null)
            {
                varMod = new IntegerVariableMod();
            }

            if (varMod.GetType() == typeof(IntegerVariableMod))
            {
                var mod = (IntegerVariableMod)varMod;

                //Should properly seperate static value, player & global vars into a seperate enum.
                //But technical debt :/
                switch (mod.ModType)
                {
                case VariableMods.Set:
                    optNumericSet.Checked       = true;
                    optNumericStaticVal.Checked = true;
                    nudNumericValue.Value       = mod.Value;

                    break;

                case VariableMods.Add:
                    optNumericAdd.Checked       = true;
                    optNumericStaticVal.Checked = true;
                    nudNumericValue.Value       = mod.Value;

                    break;

                case VariableMods.Subtract:
                    optNumericSubtract.Checked  = true;
                    optNumericStaticVal.Checked = true;
                    nudNumericValue.Value       = mod.Value;

                    break;

                case VariableMods.Multiply:
                    optNumericMultiply.Checked  = true;
                    optNumericStaticVal.Checked = true;
                    nudNumericValue.Value       = mod.Value;

                    break;

                case VariableMods.Divide:
                    optNumericDivide.Checked    = true;
                    optNumericStaticVal.Checked = true;
                    nudNumericValue.Value       = mod.Value;

                    break;

                case VariableMods.LeftShift:
                    optNumericLeftShift.Checked = true;
                    optNumericStaticVal.Checked = true;
                    nudNumericValue.Value       = mod.Value;

                    break;

                case VariableMods.RightShift:
                    optNumericRightShift.Checked = true;
                    optNumericStaticVal.Checked  = true;
                    nudNumericValue.Value        = mod.Value;

                    break;

                case VariableMods.Random:
                    optNumericRandom.Checked = true;
                    nudLow.Value             = mod.Value;
                    nudHigh.Value            = mod.HighValue;

                    break;

                case VariableMods.SystemTime:
                    optNumericSystemTime.Checked = true;

                    break;

                case VariableMods.DupPlayerVar:
                    optNumericSet.Checked                  = true;
                    optNumericClonePlayerVar.Checked       = true;
                    cmbNumericClonePlayerVar.SelectedIndex = PlayerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.DupGlobalVar:
                    optNumericSet.Checked                  = true;
                    optNumericCloneGlobalVar.Checked       = true;
                    cmbNumericCloneGlobalVar.SelectedIndex = ServerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.AddPlayerVar:
                    optNumericAdd.Checked                  = true;
                    optNumericClonePlayerVar.Checked       = true;
                    cmbNumericClonePlayerVar.SelectedIndex = PlayerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.AddGlobalVar:
                    optNumericAdd.Checked                  = true;
                    optNumericCloneGlobalVar.Checked       = true;
                    cmbNumericCloneGlobalVar.SelectedIndex = ServerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.SubtractPlayerVar:
                    optNumericSubtract.Checked             = true;
                    optNumericClonePlayerVar.Checked       = true;
                    cmbNumericClonePlayerVar.SelectedIndex = PlayerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.SubtractGlobalVar:
                    optNumericSubtract.Checked             = true;
                    optNumericCloneGlobalVar.Checked       = true;
                    cmbNumericCloneGlobalVar.SelectedIndex = ServerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.MultiplyPlayerVar:
                    optNumericMultiply.Checked             = true;
                    optNumericClonePlayerVar.Checked       = true;
                    cmbNumericClonePlayerVar.SelectedIndex = PlayerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.MultiplyGlobalVar:
                    optNumericMultiply.Checked             = true;
                    optNumericCloneGlobalVar.Checked       = true;
                    cmbNumericCloneGlobalVar.SelectedIndex = ServerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.DividePlayerVar:
                    optNumericDivide.Checked               = true;
                    optNumericClonePlayerVar.Checked       = true;
                    cmbNumericClonePlayerVar.SelectedIndex = PlayerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.DivideGlobalVar:
                    optNumericDivide.Checked               = true;
                    optNumericCloneGlobalVar.Checked       = true;
                    cmbNumericCloneGlobalVar.SelectedIndex = ServerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.LeftShiftPlayerVar:
                    optNumericLeftShift.Checked            = true;
                    optNumericClonePlayerVar.Checked       = true;
                    cmbNumericClonePlayerVar.SelectedIndex = PlayerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.LeftShiftGlobalVar:
                    optNumericLeftShift.Checked            = true;
                    optNumericCloneGlobalVar.Checked       = true;
                    cmbNumericCloneGlobalVar.SelectedIndex = ServerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.RightShiftPlayerVar:
                    optNumericRightShift.Checked           = true;
                    optNumericClonePlayerVar.Checked       = true;
                    cmbNumericClonePlayerVar.SelectedIndex = PlayerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.RightShiftGlobalVar:
                    optNumericRightShift.Checked           = true;
                    optNumericCloneGlobalVar.Checked       = true;
                    cmbNumericCloneGlobalVar.SelectedIndex = ServerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;
                }
            }
        }
        private void TryLoadNumericMod(VariableMod varMod)
        {
            if (varMod == null)
            {
                varMod = new IntegerVariableMod();
            }

            if (varMod.GetType() == typeof(IntegerVariableMod))
            {
                var mod = (IntegerVariableMod)varMod;

                switch (mod.ModType)
                {
                case VariableMods.Set:
                    optNumericSet.Checked       = true;
                    optNumericStaticVal.Checked = true;
                    nudNumericValue.Value       = mod.Value;

                    break;

                case VariableMods.Add:
                    optNumericAdd.Checked       = true;
                    optNumericStaticVal.Checked = true;
                    nudNumericValue.Value       = mod.Value;

                    break;

                case VariableMods.Subtract:
                    optNumericSubtract.Checked  = true;
                    optNumericStaticVal.Checked = true;
                    nudNumericValue.Value       = mod.Value;

                    break;

                case VariableMods.Random:
                    optNumericRandom.Checked = true;
                    nudLow.Value             = mod.Value;
                    nudHigh.Value            = mod.HighValue;

                    break;

                case VariableMods.SystemTime:
                    optNumericSystemTime.Checked = true;

                    break;

                case VariableMods.DupPlayerVar:
                    optNumericSet.Checked                  = true;
                    optNumericClonePlayerVar.Checked       = true;
                    cmbNumericClonePlayerVar.SelectedIndex = PlayerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.DupGlobalVar:
                    optNumericSet.Checked                  = true;
                    optNumericCloneGlobalVar.Checked       = true;
                    cmbNumericCloneGlobalVar.SelectedIndex = ServerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.AddPlayerVar:
                    optNumericAdd.Checked                  = true;
                    optNumericClonePlayerVar.Checked       = true;
                    cmbNumericClonePlayerVar.SelectedIndex = PlayerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.AddGlobalVar:
                    optNumericAdd.Checked                  = true;
                    optNumericCloneGlobalVar.Checked       = true;
                    cmbNumericCloneGlobalVar.SelectedIndex = ServerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.SubtractPlayerVar:
                    optNumericSubtract.Checked             = true;
                    optNumericClonePlayerVar.Checked       = true;
                    cmbNumericClonePlayerVar.SelectedIndex = PlayerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;

                case VariableMods.SubtractGlobalVar:
                    optNumericSubtract.Checked             = true;
                    optNumericCloneGlobalVar.Checked       = true;
                    cmbNumericCloneGlobalVar.SelectedIndex = ServerVariableBase.ListIndex(mod.DuplicateVariableId);

                    break;
                }
            }
        }
예제 #5
0
 //Set Variable Modification Texts
 private static string GetVariableModText(SetVariableCommand command, VariableMod mod)
 {
     return(Strings.EventCommandList.invalid);
 }