Ejemplo n.º 1
0
 public void AddMode(UserMode mode)
 {
     if (!Modes.Contains(mode))
     {
         Modes.Add(mode);
     }
 }
Ejemplo n.º 2
0
                public LowerLeftGrip()
                {
                    GripMode m1 = new GripMode();

                    m1.ModeId           = (uint)myMFMGPEModeId.kStretchRadiusX;
                    m1.DisplayString    = "Stretch radius, offset mapped to X diection.";
                    m1.CLIPromptString  = "\nSpecify new vertex point:";
                    m1.CLIKeywordList   = "STretch MOve ROtate SCale MIrror Base Copy Undo X EXit dummy GMove CGizmo _STretch MOve ROtate SCale MIrror Base Copy Undo X EXit dummy GMove CGizmo";
                    m1.CLIDisplayString = "\n** STRETCH X **";
                    m1.Action           = GripMode.ActionType.DragOn;
                    Modes.Add(m1);
                    GripMode m2 = new GripMode();

                    m2.ModeId           = (uint)myMFMGPEModeId.kStretchRadiusY;
                    m2.DisplayString    = "Stretch radius, offset mapped to Y diection.";
                    m2.CLIDisplayString = "\n** STRETCH Y **";
                    m1.CLIKeywordList   = "STretch MOve ROtate SCale MIrror Base Copy Undo X EXit dummy GMove CGizmo _STretch MOve ROtate SCale MIrror Base Copy Undo X EXit dummy GMove CGizmo";
                    m2.CLIPromptString  = "\nSpecify new vertex point:";
                    m2.Action           = GripMode.ActionType.DragOn;
                    Modes.Add(m2);
                    GripMode m3 = new GripMode();

                    m3.ModeId           = (uint)myMFMGPEModeId.kIncrementRadiusByOne;
                    m3.DisplayString    = "Increment radius by 1.";
                    m3.CLIPromptString  = "\nSpecify new vertex point:";
                    m3.CLIKeywordList   = "STretch MOve ROtate SCale MIrror Base Copy Undo X EXit dummy GMove CGizmo _STretch MOve ROtate SCale MIrror Base Copy Undo X EXit dummy GMove CGizmo";
                    m3.CLIDisplayString = "\n** INCREMENT RADIUS BY 1 **";
                    m3.Action           = GripMode.ActionType.Immediate;
                    Modes.Add(m3);
                    CurrentModeId = 0;
                }
        public void BeginAddNewMode()
        {
            Modes.Add(new ModeVM());

            ShowAddModeButton = false;
            RaisePropertyChanged(nameof(ShowAddModeButton));
        }
Ejemplo n.º 4
0
 public void AddMode(ChannelMode mode)
 {
     if (!Modes.Contains(mode))
     {
         Modes.Add(mode);
     }
 }
Ejemplo n.º 5
0
        private static Modes GetModeChanges(string[] parameterWords)
        {
            var modes    = new Modes();
            var modeWord = parameterWords[0];

            var currentModifier = modeWord[0];

            for (var i = 1; i < modeWord.Length; i++)
            {
                if (modeWord[i] == '+' || modeWord[i] == '-')
                {
                    if (modeWord[i] != currentModifier)
                    {
                        currentModifier = modeWord[i];
                    }
                }

                else
                {
                    var isOn = currentModifier == '+';
                    var mode = new Mode()
                    {
                        Identifier = modeWord[i].ToString(), IsOn = isOn
                    };
                    modes.Add(mode);
                }
            }
            return(modes);
        }
Ejemplo n.º 6
0
 public SceneListViewModel(MainWindow mainWindow)
 {
     tCPAgent           = new TCPAgent();
     this.mainWindow    = mainWindow;
     Prefabs            = new List <string>();
     AddSceneCommand    = new RelayCommand(new Action <object>(AddScene));
     SaveRoutineCommand = new RelayCommand(new Action <object>(SaveRoutine));
     LoadRoutineCommand = new RelayCommand(new Action <object>(LoadRoutine));
     PlayCommand        = new RelayCommand(new Action <object>(PlayRoutine));
     PauseCommand       = new RelayCommand(new Action <object>(PauseRoutine));
     StopCommand        = new RelayCommand(new Action <object>(StopRoutine));
     Modes.Add(Constants.TEXTMODE, "Texto");
     Modes.Add(Constants.AUDIOMODE, "Audio");
     Modes.Add(Constants.TEXTAUDIOMODE, "Texto + Audio");
     if (!File.Exists(Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName) + @"\Recursos.json"))
     {
         System.Windows.MessageBox.Show("No se ha encontrado el archivo Recursos.json en la carpeta " +
                                        Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName));
     }
     else
     {
         Prefabs = ResourceLoader.Instance.GetPrefabs();
         Prefabs.Add(Constants.PREFAB_VACIO);
         AvailableBackgrounds = ResourceLoader.Instance.GetBackgrounds();
     }
 }
Ejemplo n.º 7
0
        private void InitModes()
        {
            ScoreDisplay = new ScoreDisplay(this, 1);
            ScoreDisplay.layer.enabled = false;
            BaseMode       = new BaseMode(this, 2);
            AttractMode    = new Attract(this, 20);
            SkillshotMode  = new Skillshot(this, 3);
            PagesMode      = new PageMode(this, 5);
            CellarRampMode = new CellarRamp(this, 6);
            TargetsMode    = new Targets(this, 25);
            WorkshedMode   = new WorkShed(this, 30);
            ShedMultiball  = new ShedMball(this, 35);
            BumpersMode    = new Bumpers(this, 40);
            DeadByDawnMode = new DeadByDawn(this, 50);

            SelectMode  = new ModeSelect(this, 40);
            Lindamode   = new Linda(this, 40);
            CherylMode  = new Cheryl(this, 40);
            BadHandMode = new BadHand(this, 40);
            EscapeMode  = new Escape(this, 40);
            ShellyMode  = new Shelly(this, 40);

            Modes.Add(ScoreDisplay);
            Modes.Add(BaseMode);
            Modes.Add(AttractMode);
            Modes.Add(TargetsMode);
            Modes.Add(WorkshedMode);
        }
        public void SaveModeChanges(ModeVM newModeVM)
        {
            if (!newModeVM.SaveChanges())
            {
                // If mode is null then the user was adding a new mode and cancelled the add. Remove the mode from the list.
                // Otherwise, do nothing
                if (newModeVM.Mode == null)
                {
                    Modes.Remove(Modes.First(modeVM => modeVM.Mode == null));
                }
            }
            else
            {
                // The mode being saved doesn't exist in our list yet. Add it now.
                if (Modes.FirstOrDefault(modeVM => modeVM.Mode.Id == newModeVM.Mode.Id) == null)
                {
                    Modes.Add(newModeVM);
                }

                // Always update the modes so we get the changes
                UpdateModes();
            }

            ShowAddModeButton = true;
            RaisePropertyChanged(nameof(ShowAddModeButton));
        }
Ejemplo n.º 9
0
        public PublisherInfo(XElement element) : this()
        {
            if (element != null && element.Name.ToString().Equals("source"))
            {
                if (element.Attribute("name") != null)
                {
                    Name = element.Attribute("name").Value;
                }
                if (element.Attribute("path") != null)
                {
                    SourcePath = element.Attribute("path").Value;
                }
                if (element.Attribute("type") != null)
                {
                    switch (element.Attribute("type").Value)
                    {
                    case "file":
                        Type = PublisherTypes.PublisherSourceType.File;
                        break;

                    case "folder":
                        Type = PublisherTypes.PublisherSourceType.Directory;
                        break;
                    }
                }
                if (element.Attribute("mode") != null)
                {
                    foreach (string mode in element.Attribute("mode").Value.Split(' '))
                    {
                        switch (mode)
                        {
                        case "overwrite":
                            Modes.Add(PublisherTypes.PublisherMode.Overwrite);
                            break;

                        case "archive":
                            Modes.Add(PublisherTypes.PublisherMode.Archive);
                            break;

                        case "subonly":
                            Modes.Add(PublisherTypes.PublisherMode.SubOnly);
                            break;
                        }
                    }
                }
                if (element.Elements("destination") != null)
                {
                    foreach (XElement destelement in element.Elements("destination"))
                    {
                        PublisherDestination destination = PublisherDestination.Create(destelement);

                        if (destination != null)
                        {
                            Destinations.Add(destination);
                        }
                    }
                }
            }
        }
Ejemplo n.º 10
0
 public ObdClient()
 {
     Modes.Add(ModeFactory.createMode1());
     bluetoothSerialClient.OnConnect    += BluetoothSerialClient_OnConnect;
     bluetoothSerialClient.OnDisconnect += BluetoothSerialClient_OnDisconnect;
     bluetoothSerialClient.OnReceived   += BluetoothSerialClient_OnReceived;
     bluetoothSerialClient.OnSent       += BluetoothSerialClient_OnSent;
     bluetoothSerialClient.OnException  += BluetoothSerialClient_OnException;
 }
Ejemplo n.º 11
0
        public void ControlButton_Click(object sender, EventArgs e)
        {
            if (RuleListBox.Items.Count == 0)
            {
                MessageBoxX.Show(i18N.Translate("Unable to add empty rule"));
                return;
            }

            if (string.IsNullOrWhiteSpace(RemarkTextBox.Text))
            {
                MessageBoxX.Show(i18N.Translate("Please enter a mode remark"));
                return;
            }

            if (string.IsNullOrWhiteSpace(FilenameTextBox.Text))
            {
                MessageBoxX.Show(i18N.Translate("Please enter a mode filename"));
                return;
            }

            if (_mode != null)
            {
                _mode.Remark = RemarkTextBox.Text;
                _mode.Rule.Clear();
                _mode.Rule.AddRange(RuleListBox.Items.Cast <string>());

                Modes.WriteFile(_mode);
                Global.MainForm.InitMode();
                Edited = false;
                MessageBoxX.Show(i18N.Translate("Mode updated successfully"));
            }
            else
            {
                var fullName = Modes.GetFullPath(FilenameTextBox.Text + ".txt");
                if (File.Exists(fullName))
                {
                    MessageBoxX.Show(i18N.Translate("File already exists.\n Please Change the filename"));
                    return;
                }

                var mode = new Models.Mode
                {
                    BypassChina = false,
                    FileName    = FilenameTextBox.Text,
                    Type        = 0,
                    Remark      = RemarkTextBox.Text
                };
                mode.Rule.AddRange(RuleListBox.Items.Cast <string>());

                Modes.WriteFile(mode);
                Modes.Add(mode);
                MessageBoxX.Show(i18N.Translate("Mode added successfully"));
            }

            Close();
        }
Ejemplo n.º 12
0
        private void GetModes()
        {
            if (this.Modes == null)
            {
                this.Modes = new List <string>();
            }

            Modes.Add("CASH");
            Modes.Add("CREDIT");
        }
Ejemplo n.º 13
0
        public async void SetUiElements()
        {
            #region Set Modes to combobox

            Modes.Clear();
            Modes.Add(new ModeStruct {
                Name = LanguageController.Translation("NORMAL"), ViewMode = ViewMode.Normal
            });
            Modes.Add(new ModeStruct {
                Name = LanguageController.Translation("PLAYER"), ViewMode = ViewMode.Player
            });
            Modes.Add(new ModeStruct {
                Name = LanguageController.Translation("GOLD"), ViewMode = ViewMode.Gold
            });
            ModeSelection = Modes.FirstOrDefault(x => x.ViewMode == ViewMode.Normal);

            #endregion

            #region Full Item Info elements

            LoadFullItemInfoButtonVisibility = Visibility.Hidden;

            IsFullItemInfoSearchActive = Settings.Default.IsFullItemInfoSearchActive;

            ItemParentCategories       = CategoryController.ParentCategoryNames;
            SelectedItemParentCategory = ParentCategory.Unknown;

            ItemTiers        = FrequentlyValues.ItemTiers;
            SelectedItemTier = ItemTier.Unknown;

            ItemLevels        = FrequentlyValues.ItemLevels;
            SelectedItemLevel = ItemLevel.Unknown;

            if (!IsFullItemInfoLoading)
            {
                LoadFullItemInfoProBarGridVisibility = Visibility.Hidden;
            }

            #endregion

            #region Gold price

            var currentGoldPrice = await ApiController.GetGoldPricesFromJsonAsync(null, 1).ConfigureAwait(true);

            CurrentGoldPrice          = currentGoldPrice.FirstOrDefault()?.Price ?? 0;
            CurrentGoldPriceTimestamp = currentGoldPrice.FirstOrDefault()?.Timestamp.ToString(CultureInfo.CurrentCulture) ?? new DateTime(0, 0, 0, 0, 0, 0).ToString(CultureInfo.CurrentCulture);

            #endregion

            #region Player information

            SavedPlayerInformationName = Settings.Default.SavedPlayerInformationName;

            #endregion
        }
Ejemplo n.º 14
0
        public APModeControlPanelViewModel(AppViewModel appVm) : base(appVm)
        {
            VS_Sel   = DefineKnob(SimEvents.AP_VS_VAR_INC, SimEvents.AP_VS_VAR_DEC, 1, 1);
            SPD_Sel  = DefineKnob(SimEvents.AP_SPD_VAR_INC, SimEvents.AP_SPD_VAR_DEC, 1, 5);
            ALT_Sel  = DefineKnob(SimEvents.AP_ALT_VAR_INC, SimEvents.AP_ALT_VAR_DEC, 100, 10);
            Baro_Sel = DefineKnob(SimEvents.KOHLSMAN_INC, SimEvents.KOHLSMAN_DEC, 1, 1);

            DefineMode("AP", SimEvents.AP_MASTER,
                       () => newData.ap_master == 1,
                       () => newData.ap_master == 0 && newData.sim_on_ground == 0);
            var AT_native = DefineMode("AT", SimEvents.AUTO_THROTTLE_ARM,
                                       () => newData.ap_at_is_active == 1,
                                       () => newData.ap_at_is_active == 0 && newData.sim_on_ground == 0);


            var AT_supplemental = new MCPModeViewModel {
                Text = "AT s", Invoke = new RelayCommand(() => appVm.AT.IsActive = !appVm.AT.IsActive)
            };

            AT_supplemental.WarningColor = System.Windows.Media.Colors.Yellow;
            appVm.DataArrived           += (newData) =>
            {
                AT_supplemental.IsActive  = appVm.AT.IsActive;
                AT_supplemental.IsWarning = appVm.AT.IsWarning;
                if (AT_supplemental.IsActive)
                {
                    AT_supplemental.Text = appVm.AT.DesiredSpeed.ToString();
                }
            };
            Modes.Add(AT_supplemental);

            DefineMode("FD", SimEvents.TOGGLE_FLIGHT_DIRECTOR,
                       () => newData.ap_fd_active == 1);
            DefineMode("HDG", SimEvents.AP_HDG_HOLD_ON,
                       () => newData.ap_mode_HDG == 1);
            DefineMode("LVL", SimEvents.AP_WING_LEVELER_ON,
                       () => newData.ap_mode_lvl == 1);
            DefineMode("NAV", SimEvents.AP_NAV1_HOLD_ON,
                       () => newData.ap_mode_NAV == 1);
            DefineMode("APPR", SimEvents.AP_APR_HOLD_ON,
                       () => newData.ap_mode_APPR == 1);
            DefineMode("FLC", SimEvents.FLIGHT_LEVEL_CHANGE,
                       () => newData.ap_mode_flc == 1);
            DefineMode("ALT", SimEvents.AP_ALT_HOLD_ON,
                       () => newData.ap_mode_ALT == 1);
            DefineMode("VS", SimEvents.AP_VS_HOLD,
                       () => newData.ap_mode_VS == 1);

            appVm.DataArrived += (nd) =>
            {
                AT_native.IsApplicable       = appVm.SystemsCfg?.HasAutoThrottle ?? false;
                AT_supplemental.IsApplicable = !appVm.SystemsCfg?.HasAutoThrottle ?? false;
            };
        }
Ejemplo n.º 15
0
        public MainWindow()
        {
            InitializeComponent();

            Modes.Add(new Mode("Beginner", 9, 9, 10));
            Modes.Add(new Mode("Intermediate", 16, 16, 40));
            Modes.Add(new Mode("Expert", 30, 16, 99));

            ModeCombobox.ItemsSource   = Modes;
            ModeCombobox.SelectedIndex = 0;

            GenerateGrid();
        }
Ejemplo n.º 16
0
        public void AddMode(Client client, char mode)
        {
            if (!Modes.Contains(mode))
            {
                Modes.Add(mode);
            }

            // Invoke events
            if (mode.Equals('a'))
            {
                client.OnAwayChange(this, true);
            }
        }
 public void SetModeCombobox()
 {
     Modes.Clear();
     Modes.Add(new ModeStruct {
         Name = LanguageController.Translation("NORMAL"), ViewMode = ViewMode.Normal
     });
     Modes.Add(new ModeStruct {
         Name = LanguageController.Translation("PLAYER"), ViewMode = ViewMode.Player
     });
     Modes.Add(new ModeStruct {
         Name = LanguageController.Translation("GOLD"), ViewMode = ViewMode.Gold
     });
     ModeSelection = Modes.FirstOrDefault(x => x.ViewMode == ViewMode.Normal);
 }
Ejemplo n.º 18
0
        public static void SetModes(params LogMode[] modes)
        {
            if (Modes.Count != 0)
            {
                Modes.Clear();
            }

            if (modes != null)
            {
                foreach (var mode in modes)
                {
                    Modes.Add(mode);
                }
            }
        }
Ejemplo n.º 19
0
        public PresetExportInfo(Preset preset)
        {
            PluginName = preset.Plugin.GetEffectivePluginName();

            PluginVendor = preset.Plugin.PluginVendor;
            PluginId     = preset.Plugin.VstPluginId;
            PluginType   = preset.Plugin.PluginType;
            PresetGuid   = Guid.Parse(preset.PresetId);

            if (preset.PresetBank == null)
            {
                throw new ArgumentException(
                          $"PresetExportInfo: PresetBank for preset {preset.Metadata.PresetName} (SourceFile " +
                          $"{preset.OriginalMetadata.SourceFile}) is null. Please report this as a bug!");
            }

            BankPath = preset.PresetBank.GetBankPath().ToList();
            BankPath.RemoveFirst();
            BankName = preset.PresetBank.BankName;


            PresetName                   = preset.Metadata.PresetName;
            PreviewNotePlayer            = preset.PreviewNotePlayer;
            DefaultControllerAssignments = preset.Plugin.DefaultControllerAssignments;
            Author  = preset.Metadata.Author;
            Comment = preset.Metadata.Comment;


            foreach (var type in preset.Metadata.Types)
            {
                if (!type.IsIgnored)
                {
                    Types.Add(new List <string> {
                        type.EffectiveTypeName, type.EffectiveSubTypeName
                    });
                }
            }

            foreach (var mode in preset.Metadata.Characteristics)
            {
                if (!mode.IsIgnored)
                {
                    Modes.Add(mode.EffectiveCharacteristicName);
                }
            }
        }
Ejemplo n.º 20
0
        public Mode AddMode(Mode mode)
        {
            var otherMode = Modes.FirstOrDefault(z => z.Name == mode.Name);

            if (otherMode != null && otherMode.IsComposeMode != mode.IsComposeMode)
            {
                throw new ParseException($"Incompatible definitions of mode '{mode.Name}' found.");
            }
            if (otherMode != null)
            {
                mode = otherMode;
            }
            else
            {
                Modes.Add(mode);
            }
            return(mode);
        }
Ejemplo n.º 21
0
        public override void PopulateList()
        {
            if (Modes == null)
            {
                Modes = new List <ModeModel>();
            }

            Modes.Clear();

            foreach (DataRow row in _dataTable.Rows)
            {
                ModeModel mode = new ModeModel()
                {
                    Mode         = row.Field <string>("Mode"),
                    IsDeprecated = row.Field <bool>("Deprecated"),
                    ParentMode   = null
                };

                if (mode.IsDeprecated == false || IncludeDeprecated == true)
                {
                    Modes.Add(mode);
                }
            }

            foreach (DataRow row in _submodesTable.Rows)
            {
                ModeModel submode = new ModeModel()
                {
                    Mode         = row.Field <string>("Submode"),
                    IsDeprecated = false
                };

                // This is outside since I cannot reference submode.Mode inside the initializer.
                submode.ParentMode = Modes.Find(mode => mode.Mode == submode.Mode);

                Modes.Add(submode);
            }

            _dataTable     = null;
            _submodesTable = null;
        }
Ejemplo n.º 22
0
        public MainViewModel()
        {
            foreach (CounterpointSpecie specie in Enum.GetValues(typeof(CounterpointSpecie)))
            {
                CounterpointSpecies.Add(specie.ToUserFriendlyString());
            }
            foreach (Mode mode in Enum.GetValues(typeof(Mode)))
            {
                Modes.Add(mode.ToString());
            }
            foreach (Tonic tonic in Enum.GetValues(typeof(Tonic)))
            {
                Tonics.Add(tonic.ToString());
            }

            ChooseFileCommand = new RelayCommand(ExecuteChooseFileDialog);
            OpenFileCommand   = new RelayCommand(ExecuteOpenFile,
                                                 () => String.IsNullOrEmpty(selectedPath) == false && SelectedCounterpointSpecie != null &&
                                                 SelectedMode != null &&
                                                 SelectedTonic != null);
        }
Ejemplo n.º 23
0
        public virtual void SetMode(string modeName)
        {
            if (modeName == DefaultModeName)
            {
                throw new ArgumentException("You cannot explicity set the mode to the default mode ( " + DefaultModeName + ").  Use ResetMode() instead.");
            }

            if (CurrentModeSettings.Name != DefaultModeName)
            {
                throw new InvalidOperationException("You cannot change modes when the current mode is not the default mode.  Ensure you call ResetMode() after each use of SetMode().");
            }

            if (Modes.ContainsKey(modeName))
            {
                CurrentModeSettings = Modes[modeName];
                return;
            }

            var modeSettings = new ModeSettings(modeName);

            Modes.Add(modeName, modeSettings);
            CurrentModeSettings = modeSettings;
        }
Ejemplo n.º 24
0
    private void LoadData(List <string> heroData)
    {
        int index = 2;

        StringId = heroData[0].Split(' ')[1];

        while (heroData[index] != ".end")
        {
            List <string> data = heroData[index++].Replace("%", "").Replace("\"", "").
                                 Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries).ToList();

            switch (data[0])
            {
            case "rendering:":
                RenderingRankOverride = int.Parse(data[2]);
                break;

            case "commonfx:":
                if (CommonEffects == null)
                {
                    CommonEffects = new CommonEffects(data);
                }
                else
                {
                    CommonEffects.LoadData(data);
                }
                break;

            case "combat_skill:":
                SkillArtInfo skillArt = new SkillArtInfo(data, false);
                SkillArtInfo.Add(skillArt);
                break;

            case "riposte_skill:":
                SkillArtInfo riposteArt = new SkillArtInfo(data, false);
                SkillArtInfo.Add(riposteArt);
                break;

            default:
                Debug.LogError("Unknown art token in hero: " + StringId);
                break;
            }
        }
        index += 2;

        while (heroData[index] != ".end")
        {
            List <string> data = heroData[index++].Replace("%", "").Replace("\"", "").
                                 Split(new [] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries).ToList();

            switch (data[0])
            {
            case "resistances:":
                Resistanses.Add(AttributeType.Stun, float.Parse(data[2]) / 100);
                Resistanses.Add(AttributeType.Poison, float.Parse(data[4]) / 100);
                Resistanses.Add(AttributeType.Bleed, float.Parse(data[6]) / 100);
                Resistanses.Add(AttributeType.Disease, float.Parse(data[8]) / 100);
                Resistanses.Add(AttributeType.Move, float.Parse(data[10]) / 100);
                Resistanses.Add(AttributeType.Debuff, float.Parse(data[12]) / 100);
                Resistanses.Add(AttributeType.DeathBlow, float.Parse(data[14]) / 100);
                Resistanses.Add(AttributeType.Trap, float.Parse(data[16]) / 100);
                break;

            case "weapon:":
                Equipment weapon = new Equipment(data[2], Weapons.Count + 1, HeroEquipmentSlot.Weapon);
                weapon.EquipmentModifiers.Add(new FlatModifier(AttributeType.DamageLow, float.Parse(data[6]), false));
                weapon.EquipmentModifiers.Add(new FlatModifier(AttributeType.DamageHigh, float.Parse(data[7]), false));
                weapon.EquipmentModifiers.Add(new FlatModifier(AttributeType.CritChance, float.Parse(data[9]) / 100, false));
                weapon.EquipmentModifiers.Add(new FlatModifier(AttributeType.SpeedRating, float.Parse(data[11]), false));
                Weapons.Add(weapon);
                break;

            case "armour:":
                Equipment armor = new Equipment(data[2], Armors.Count + 1, HeroEquipmentSlot.Armor);
                armor.EquipmentModifiers.Add(new FlatModifier(AttributeType.DefenseRating, float.Parse(data[4]) / 100, false));
                armor.EquipmentModifiers.Add(new FlatModifier(AttributeType.HitPoints, float.Parse(data[8]), true));
                Armors.Add(armor);
                break;

            case "combat_skill:":
                List <string> combatData = new List <string>();
                data = heroData[index - 1].Split(new [] { '\"' }, StringSplitOptions.RemoveEmptyEntries).ToList();
                bool isEffectData = false;
                foreach (var item in data)
                {
                    if (isEffectData)
                    {
                        if (item.Trim(' ').StartsWith("."))
                        {
                            isEffectData = false;
                        }
                        else
                        {
                            combatData.Add(item);
                            continue;
                        }
                    }

                    string[] combatItems = item.Replace("%", "").Split(
                        new [] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                    if (combatItems[combatItems.Length - 1] == ".effect")
                    {
                        isEffectData = true;
                    }
                    combatData.AddRange(combatItems);
                }

                CombatSkillVariants.Add(new CombatSkill(combatData, true));
                break;

            case "combat_move_skill:":
                MoveSkill = new MoveSkill(data[2], int.Parse(data[8]), int.Parse(data[9]));
                break;

            case "riposte_skill:":
                List <string> riposteData = new List <string>();
                data = heroData[index - 1].Split('\"').ToList();
                bool isRiposteEffect = false;
                foreach (var item in data)
                {
                    if (isRiposteEffect)
                    {
                        if (item.Trim(' ')[0] == '.')
                        {
                            isRiposteEffect = false;
                        }
                        else
                        {
                            riposteData.Add(item);
                            continue;
                        }
                    }

                    string[] combatItems = item.Replace("%", "").Split(
                        new [] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                    if (combatItems[combatItems.Length - 1] == ".effect")
                    {
                        isRiposteEffect = true;
                    }
                    riposteData.AddRange(combatItems);
                }
                RiposteSkill = new CombatSkill(riposteData, true);
                break;

            case "incompatible_party_member:":
                IncompatiablePartyTag = data[4];
                break;

            case "tag:":
                Tags.Add(data[2]);
                break;

            case "controlled:":
                break;

            case "id_index:":
                IndexId = int.Parse(data[2]);
                break;

            case "skill_selection:":
                CanSelectCombatSkills        = bool.Parse(data[2]);
                NumberOfSelectedCombatSkills = int.Parse(data[4]);
                break;

            case "deaths_door:":
                if (DeathDoor == null)
                {
                    DeathDoor = new DeathDoor(data);
                }
                else
                {
                    DeathDoor.LoadData(data);
                }
                break;

            case "generation:":
                if (Generation == null)
                {
                    Generation = new HeroGeneration(data);
                }
                else
                {
                    Generation.LoadData(data);
                }
                break;

            case "extra_battle_loot:":
                if (ExtraBattleLoot == null)
                {
                    ExtraBattleLoot = new LootDefinition(data);
                }
                else
                {
                    ExtraBattleLoot.LoadData(data);
                }
                break;

            case "extra_curio_loot:":
                if (ExtraCurioLoot == null)
                {
                    ExtraCurioLoot = new LootDefinition(data);
                }
                else
                {
                    ExtraCurioLoot.LoadData(data);
                }
                break;

            case "extra_stack_limit:":
                ExtraStackLimit = data[2];
                break;

            case "mode:":
                Modes.Add(new CharacterMode(data));
                break;

            default:
                Debug.LogError("Unknown info token " + data[0] + " in hero: " + StringId);
                break;
            }
        }

        CombatSkills = new List <CombatSkill>(CombatSkillVariants.FindAll(skill => skill.Level == 0));
    }
Ejemplo n.º 25
0
 public void AddMode(char mode)
 {
     Modes.Add(mode);
     ModesString.Value = AddChar + Modes.ToString();
 }
Ejemplo n.º 26
0
        private void OnPreModeParse(string source, string target, string modestr, string[] parameters)
        {
            // TODO: refactor method name since this isn't going to be a hook-point for overrides
            // TODO: decipher what past-me meant by the above statement.
            // TODO: leave these funny comments for posterity.
            string sourceNick = source.GetNickFromSource();

            if (target.StartsWith("#"))
            {
                var c = GetChannel(target);

                var modes = ParseChanModes(modestr, parameters);
                foreach (var item in modes)
                {
                    if (item.Type == ModeType.LIST)
                    {
                        if (item.IsSet)
                        {
                            c.ListModes.Add(item.Mode, item.Parameter, source);
                        }
                        else
                        {
                            c.ListModes.Remove(item.Mode, item.Parameter);
                        }
                    }
                    else if (item.Type == ModeType.SETUNSET || item.Type == ModeType.SET || item.Type == ModeType.NOPARAM)
                    {
                        if (item.IsSet)
                        {
                            c.Modes.Add(item.Mode, item.Parameter);
                        }
                        else
                        {
                            c.Modes.Remove(item.Mode);
                        }
                    }
                    else if (item.Type == ModeType.ACCESS)
                    {
                        int  prefixIndex = info.PrefixModes.IndexOf(item.Mode);
                        char prefix      = info.Prefixes[prefixIndex];

                        if (item.IsSet)
                        {
                            c.AddPrefix(item.Parameter, prefix);
                        }
                        else
                        {
                            c.RemovePrefix(item.Parameter, prefix);
                        }
                    }

                    OnModeChanged(item.Mode, item.Parameter, source, target, item.Type);
                }
            }
            else
            { // User mode.
                Debug.WriteLine("[MODE] Received usermode(s) {0} (Source: {1} - Target: {2})", modestr, source, target);

                var modes = ParseUserModes(modestr, parameters); // I don't think parameters are available for usermodes.
                foreach (var item in modes)
                {
                    if (item.IsSet)
                    {
                        Modes.Add(item.Mode);
                    }
                    else
                    {
                        Modes.Remove(item.Mode);
                    }

                    OnModeChanged(item.Mode, null, source, target, item.Type);
                }
            }
        }
Ejemplo n.º 27
0
 public PoeleABois()
 {
     Modes.Add(new Mode {
         Id = 1, Libellé = "Allumé"
     });
 }
Ejemplo n.º 28
0
        private static Modes GetModeChanges(string[] parameterWords)
        {
            var modes = new Modes();
            var modeWord = parameterWords[0];

            var currentModifier = modeWord[0];

            for (var i = 1; i < modeWord.Length; i++)
            {
                if (modeWord[i] == '+' || modeWord[i] == '-')
                {
                    if (modeWord[i] != currentModifier)
                    {
                        currentModifier = modeWord[i];
                    }
                }

                else
                {
                    var isOn = currentModifier == '+';
                    var mode = new Mode() { Identifier = modeWord[i].ToString(), IsOn = isOn };
                    modes.Add(mode);
                }
            }
            return modes;
        }
Ejemplo n.º 29
0
        public GameViewModel(Game game) : this()
        {
            GameID           = game.GameID;
            GameName         = game.GameName;
            URL              = game.URL;
            CoverImageURL    = game.CoverImageURL;
            StoryLine        = game.StoreLine;
            Summary          = game.Summary;
            FirstReleaseDate = game.FirstReleaseDate;
            Published        = game.Published.HasValue ? game.Published.Value : false;

            foreach (var gameGenre in game.GameGenres)
            {
                Genres.Add(
                    new GenreViewModel(gameGenre.Genre)
                    );
            }

            foreach (var gameTheme in game.GameThemes)
            {
                Themes.Add(
                    new ThemeViewModel(gameTheme.Theme)
                    );
            }

            foreach (var gameMode in game.GameModes)
            {
                Modes.Add(
                    new ModeViewModel(gameMode.Mode)
                    );
            }

            foreach (var gamePerspective in game.GamePerspectives)
            {
                Perspectives.Add(
                    new PerspectiveViewModel(gamePerspective.Perspective)
                    );
            }

            foreach (var gameScreenshots in game.GameScreenshots)
            {
                Screenshots.Add(
                    new ScreenshotViewModel(gameScreenshots.Screenshot)
                    );
            }

            foreach (var gamePlatform in game.GamePlatforms)
            {
                Platforms.Add(
                    new PlatformViewModel(
                        gamePlatform.Platform,
                        gamePlatform.ReleaseDate.Value)
                    );

                foreach (var history in gamePlatform.VendorGameHistories)
                {
                    PriceHistory.Add(
                        new PriceHistoryViewModel(history)
                        );
                }
            }


            if (PriceHistory.Count() > 0)
            {
                TodaysPrices  = PriceHistory?.Where(ph => ph.CreatedDate >= DateTime.Today).ToList();
                Cheapest      = TodaysPrices?.GroupBy(ph => ph.Price)?.OrderBy(ph => double.Parse(ph.Key))?.FirstOrDefault()?.Select(ph => ph).ToList();
                CheapestPrice = Cheapest?.FirstOrDefault().Price;
            }

            foreach (var settings in game.GamePlatforms.Select(gp => gp.VendorGameSettings))
            {
                foreach (var setting in settings)
                {
                    Settings.Add(new VendorGameSettingViewModel(setting));
                }
            }
        }
Ejemplo n.º 30
0
        public static void Initialize()
        {
            Menu = MainMenu.AddMenu(Player.Instance.ChampionName, "GodSpeedRengar");
            Menu.AddGroupLabel("Introduction");
            Menu.AddLabel("Don't be a scary cat!");

            // Modes
            Modes = Menu.AddSubMenu("Modes", "modes");

            // Combo
            Modes.AddGroupLabel("Combo");
            Variables.ComboSmite  = Modes.Add("comboUseSmite", new CheckBox("Use Smite"));
            Variables.ComboYoumuu = Modes.Add("comboUseYoumuu", new CheckBox("Use Youmuu's while steath"));
            Modes.AddLabel("Modes (1-Snare;2- OneShoot;3- Snare on Jump;4- Q always)");
            Variables.ComboMode      = Modes.Add("comboMode", new Slider("Mode", 2, 1, 4));
            Variables.ComboSwitchKey = Modes.Add("comboSwitch", new KeyBind("Modes Switch Key", false, KeyBind.BindTypes.HoldActive, 'T'));

            Modes.AddSeparator();

            //Harass
            Modes.AddGroupLabel("Harass");
            Variables.HarassW = Modes.Add("harassUseW", new CheckBox("Use W"));
            Variables.HarassE = Modes.Add("harassUseE", new CheckBox("Use E"));

            Modes.AddSeparator();

            //LaneClear
            Modes.AddGroupLabel("LaneClear");
            Variables.LaneQ      = Modes.Add("laneUseQ", new CheckBox("Use Q"));
            Variables.LaneW      = Modes.Add("laneUseW", new CheckBox("Use W"));
            Variables.LaneE      = Modes.Add("laneUseE", new CheckBox("Use E"));
            Variables.LaneTiamat = Modes.Add("laneUseTiamat", new CheckBox("Use Tiamat/Hydra"));
            Variables.LaneSave   = Modes.Add("laneSave", new CheckBox("Save 5  FEROCITY", false));

            Modes.AddSeparator();

            //JungleClear
            Modes.AddGroupLabel("JungleClear");
            Variables.JungQ      = Modes.Add("jungUseQ", new CheckBox("Use Q"));
            Variables.JungW      = Modes.Add("jungUseW", new CheckBox("Use W"));
            Variables.JungE      = Modes.Add("jungUseE", new CheckBox("Use E"));
            Variables.JungTiamat = Modes.Add("jungUseTiamat", new CheckBox("Use Tiamat/Hydra"));
            Variables.JungSave   = Modes.Add("jungSave", new CheckBox("Save 5  FEROCITY", false));

            Modes.AddSeparator();

            //Auto
            Modes.AddGroupLabel("Auto");
            Variables.AutoWHeal      = Modes.Add("autoWHeal", new Slider("W Heal if HP <", 20, 0, 100));
            Variables.AutoEInterrupt = Modes.Add("autoEInterrupt", new CheckBox("Interrupt with E"));
            Variables.AutoSmiteKS    = Modes.Add("autoSmiteKS", new CheckBox("Smite KS (blue/red)"));
            Variables.AutoESK        = Modes.Add("autoEKS", new CheckBox("E Ks"));
            Variables.AutoWKS        = Modes.Add("autoWKS", new CheckBox("W Ks"));
            Variables.AutoSmiteSteal = Modes.Add("autoSteal", new CheckBox("Smite steal Drake/Baron"));

            //drawing
            Draw = Menu.AddSubMenu("Drawing", "drawing");

            Variables.DrawMode = Draw.Add("drawMode", new CheckBox("Draw Mode"));
            //Variables.DrawSelectedTarget = Draw.Add("drawSelected", new CheckBox("Notify Selected Target While Steath"));

            Magnet = Menu.AddSubMenu("Magnet", "magnet");
            Magnet.AddLabel("Magnet will only works on selected target");
            Variables.MagnetEnable = Magnet.Add("magnetEnable", new CheckBox("Enable", false));
            Variables.MagnetRange  = Magnet.Add("magnetRange", new Slider("Magnet Range", 300, 150, 500));

            Targetting = Menu.AddSubMenu("Targetting", "targetting");

            Targetting.AddGroupLabel("Ultimate Jump Targeting");
            Variables.UltSelected = Targetting.Add("ultiSelected", new CheckBox("Priority Selected Target"));
            foreach (var hero in EntityManager.Heroes.Enemies)
            {
                Targetting.Add("ulti" + hero.NetworkId,
                               new CheckBox(hero.ChampionName + "(" + hero.Name + ")"));
            }

            Targetting.AddGroupLabel("Bush Jump Targeting");
            Variables.BushSelected = Targetting.Add("bushSelected", new CheckBox("Priority Selected Target"));
            foreach (var hero in EntityManager.Heroes.Enemies)
            {
                Targetting.Add("bush" + hero.NetworkId,
                               new Slider(hero.ChampionName + "(" + hero.Name + ")", TargetSelector.GetPriority(hero), 1, 5));
            }

            Game.OnTick += Game_OnTick;
        }
Ejemplo n.º 31
0
        public int AddMode(Client client, string channel, char mode, string parameter = "")
        {
            switch (mode)
            {
            case 'v':
            {
                var user = client.UserFromNick(parameter);
                user.AddRank(client, channel, UserRank.Voice);
                return(1);
            }

            case 'h':
            {
                var user = client.UserFromNick(parameter);
                user.AddRank(client, channel, UserRank.HalfOp);
                return(1);
            }

            case 'o':
            {
                var user = client.UserFromNick(parameter);
                user.AddRank(client, channel, UserRank.Op);
                return(1);
            }

            case 'a':
            {
                var user = client.UserFromNick(parameter);
                user.AddRank(client, channel, UserRank.Admin);
                return(1);
            }

            case 'q':
            {
                var user = client.UserFromNick(parameter);
                user.AddRank(client, channel, UserRank.Owner);
                return(1);
            }

            case 'b':
            {
                AddBan(parameter);
                OnModeAdd(mode);
                return(1);
            }

            case 'e':
            {
                AddException(parameter);
                OnModeAdd(mode);
                return(1);
            }

            case 'I':
            {
                AddInvite(parameter);
                OnModeAdd(mode);
                return(1);
            }

            case 'k':
            {
                Key = parameter;
                Modes.Add(mode);
                return(1);
            }

            case 'l':
            {
                int limit;
                if (int.TryParse(parameter, out limit))
                {
                    Userlimit = limit;
                    Modes.Add(mode);
                    OnModeAdd(mode);
                    return(1);
                }
                break;
            }

            default:
            {
                if (!Modes.Contains(mode))
                {
                    Modes.Add(mode);
                }
                break;
            }
            }
            OnModeAdd(mode);
            return(0);
        }