public void Load(X360IO io) { IO = io; IO.Stream.Position = 0x0; Magic = IO.Reader.ReadUInt32(); Unknown1 = IO.Reader.ReadUInt32(); Unknown2 = IO.Reader.ReadUInt32(); Magic2 = IO.Reader.ReadUInt32(); if (Magic != 0xBCADADBC || Magic2 != 0xBCADADBC) return; IO.Stream.Position = 0x10; SettingEntries = new List<SettingEntry>(); DataEntries = new List<SettingDataEntry>(); while (true) { SettingEntry entry = new SettingEntry(); if (!entry.Load(IO)) break; SettingEntries.Add(entry); } IO.Stream.Position = 0xFFF0; DataMagic = IO.Reader.ReadUInt16(); if (DataMagic != 0x4D26) return; // data while (true) { SettingDataEntry entry = new SettingDataEntry(); entry.Load(IO); if (!(entry.Flags == 0xAABB && entry.FileNameOffset == 0xCCDD && entry.Checksum == 0xEE00)) DataEntries.Add(entry); else break; } foreach (SettingDataEntry entry in DataEntries) { if (entry.Flags != 0x7A) { SettingEntry ent = SettingEntries.Find(sec => sec.IsEntryOffset(entry.FileNameOffset + 0x10)); if (ent == null) { break; } ent.DataExists = true; entry.FileNameEntry = ent; } } }
public SettingDataEntry CreateSetting(string settingName, byte settingType, string settingValue) { SettingEntry entry = new SettingEntry {ID = 0x0, Value = 0x0, Setting = settingName}; SettingDataEntry entry2 = new SettingDataEntry { Flags = 0x0, Checksum = 0x0, Type = settingType, FileNameEntry = entry }; entry2.ValueString = settingValue; entry.DataExists = true; SettingEntries.Add(entry); DataEntries.Add(entry2); return entry2; }
public BoolSettingView(SettingEntry <bool> setting, int definedWidth = -1) : base(setting, definedWidth) /* NOOP */ }
protected override void DefineSettings(SettingCollection settingsManager) { settingBackgroundPlayback = settingsManager.DefineSetting <bool>("backgroundPlayback", false, "No background playback", "Stop key emulation when GW2 is in the background"); }
public override void DefineSettings(Settings settings) { // Define settings settingOnlyShowAtHighSpeeds = settings.DefineSetting <bool>("Only Show at High Speeds", false, false, true, "Only show the speedometer if you're going at least 1/4 the max speed."); settingShowSpeedNumber = settings.DefineSetting <bool>("Show Speed Value", false, false, true, "Shows the speed (in approx. inches per second) above the speedometer."); }
public static string GenerateKey(this SettingEntry setting) { return(string.Join("-", setting.Name, setting.ObjectType, setting.ObjectId)); }
public FloatSettingView(SettingEntry <float> setting, int definedWidth = -1) : base(setting, definedWidth) /* NOOP */ }
protected override void DefineSettings(SettingCollection settings) { _settingOnlyShowAtHighSpeeds = settings.DefineSetting("OnlyShowAtHighSpeeds", false, "Only Show at High Speeds", "Only show the speedometer if you're going at least 1/4 the max speed."); _settingShowSpeedNumber = settings.DefineSetting("ShowSpeedNumber", false, "Show Speed Value", "Shows the speed (in approx. inches per second) above the speedometer."); }
protected override void DefineSettings(SettingCollection settingsManager) { _settingShowNotificationWhenLandmarkIsCopied = settingsManager.DefineSetting("ShowNotificationOnCopy", true, "Show Notification When Landmark is Copied", "If checked, a notification will be displayed in the center of the screen confirming the landmark was copied."); _settingHideWindowAfterSelection = settingsManager.DefineSetting("HideWindowOnSelection", true, "Hide Window After Selection", "If checked, the landmark search window will automatically hide after a landmark is selected from the results."); }
public override void DefineSettings(Settings settings) { settingShowNotificationWhenLandmarkIsCopied = settings.DefineSetting("Show Notification When Landmark Is Copied", true, true, true, "If enabled, a notification will be displayed in the center of the screen confirming the landmark was copied."); settingHideWindowAfterSelection = settings.DefineSetting("Hide Window After Selection", true, true, true, "If enabled, the landmark search window will automatically hide after a landmark is selected from the results."); }
/// <inheritdoc /> protected override void DefineSettings(SettingCollection settings) { _showToolbox = settings.DefineSetting("ShowToolbox", false); }
public KeyedSettings(string path, string fileName, bool prioritizeSource) { this.path = path; this.fileName = fileName; this.makeFiles(); List <string> list = FileUtils.readTextFile(this.path + "/" + this.fileName, false); this.dict = new SortedDictionary <string, SettingEntry>(); this.prioritizeSource = prioritizeSource; if (!this.prioritizeSource) { string[] stringArray; string key, value, dataType; string comment = null; object settingValue; foreach (string line in list) { comment = null; if (line.StartsWith("#")) { comment = line.Substring(2).Trim(); } else if (line.Contains("=")) { stringArray = line.Split('='); string s0 = stringArray[0]; dataType = s0.Substring(1, 1); key = s0.Substring(s0.LastIndexOf(']') + 1); value = stringArray[1]; float f; int i; bool flag; if (dataType == "F") { float.TryParse(value, out f); settingValue = f; } else if (dataType == "I") { int.TryParse(value, out i); settingValue = i; } else if (dataType == "B") { bool.TryParse(value, out flag); settingValue = flag; } else { settingValue = value; // String } SettingEntry entry = new SettingEntry(settingValue, comment); this.dict.Add(key, new SettingEntry(settingValue, comment)); } } } }
protected override void LoadFromIni() { MaxSize = Ini["REPLAY"].GetInt("MAX_SIZE_MB", 200); Quality = Ini["QUALITY"].GetEntry("LEVEL", Qualities, 3); }
protected override void DefineSettings(SettingCollection settings) { favorites = settings.DefineSetting("favorites", new List <string>()); }
protected override void DefineSettings(SettingCollection settings) { _settingCompassSize = settings.DefineSetting("CompassSize", 0.5f, "Compass Size", "Size of the compass elements."); _settingCompassRadius = settings.DefineSetting("CompassRadius", 0f, "Compass Radius", "Radius of the compass."); _settingVerticalOffset = settings.DefineSetting("VerticalOffset", 0f, "Vertical Offset", "How high to offset the compass off the ground."); }
public SettingPresenter(SettingView <TSetting> view, SettingEntry <TSetting> model) : base(view, model) /* NOOP */ }
public static IView FromEnum(SettingEntry setting, int definedWidth = -1) { var specificEnumType = typeof(EnumSettingView <>).MakeGenericType(setting.SettingType); return(Activator.CreateInstance(specificEnumType, setting, definedWidth) as IView); }
public StringSettingView(SettingEntry <string> setting, int definedWidth = -1) : base(setting, definedWidth) /* NOOP */ }
public EnumSettingView(SettingEntry <TEnum> setting, int definedWidth = -1) : base(setting, definedWidth) /* NOOP */ }
public KeybindingSettingView(SettingEntry <KeyBinding> setting, int definedWidth = -1) : base(setting, definedWidth) /* NOOP */ }
protected override void DefineSettings(SettingCollection settings) { _masterVolume = settings.DefineSetting("MasterVolume.", 50.0f, () => "Master Volume", () => "Is Sebastian a little to loud for you? Well you can attempt to have him sing a little less enthusiastically."); }
public IntSettingView(SettingEntry <int> setting, int definedWidth = -1) : base(setting, definedWidth) /* NOOP */ }
protected override void DefineSettings(SettingCollection settings) { SeenHints = settings.DefineSetting <HashSet <int>[]>("SeenHints", new HashSet <int> [3], "PreviousHints", "Previously Seen Hints"); }
protected NumericSettingView(SettingEntry <T> setting, int definedWidth = -1) : base(setting, definedWidth) /* NOOP */ }