public static void LoadConfig() { //Reads the ini file InitializationFile settings = initialiseFile(Globals.Application.ConfigPath + "ForceACallout.ini"); //Makes a new converter to convert strings to keys KeysConverter kc = new KeysConverter(); string FoceCalloutKey; string ForceCalloutModifier; string DebugLogging; string AvailabilityKey; string AvailabilityModifier; string AvailableForCalloutsText; int RectangleAlpha; //Reads the key and modifier to force a callout from the ini file FoceCalloutKey = settings.ReadString("Keybindings", "ForceCalloutKey", "X"); ForceCalloutModifier = settings.ReadString("Keybindings", "ForceCalloutModifier", "None"); //Reads the value for debug logging from the ini file DebugLogging = settings.ReadString("General", "DebugLogging", "False"); //Reads the key and modifier to set the player's availability from the ini file AvailabilityKey = settings.ReadString("Keybindings", "AvailabilityKey", "Z"); AvailabilityModifier = settings.ReadString("Keybindings", "AvailabilityModifier", "None"); //Reads the value to enable or disable the on screen text AvailableForCalloutsText = settings.ReadString("General", "AvailableForCalloutsText", "True"); //Reads the int for the rectangle alpha RectangleAlpha = settings.ReadInt16("General", "RectangleAlpha", 200); //Logs some things Logger.Log("DebugLogging is set to " + DebugLogging); Logger.Log("ForceCalloutKey is set to " + FoceCalloutKey); Logger.Log("ForceCalloutModifier is set to " + ForceCalloutModifier); Logger.Log("AvailabilityKey is set to " + AvailabilityKey); Logger.Log("AvailabilityModifier is set to " + AvailabilityModifier); Logger.Log("AvailableForCalloutsText is set to " + AvailableForCalloutsText); Logger.Log("RectangleAlpha is set to " + RectangleAlpha); //These convert strings to keys Globals.Controls.ForceCalloutKey = (Keys)kc.ConvertFromString(FoceCalloutKey); Globals.Controls.ForceCalloutModifier = (Keys)kc.ConvertFromString(ForceCalloutModifier); Globals.Controls.AvailabilityKey = (Keys)kc.ConvertFromString(AvailabilityKey); Globals.Controls.AvailabilityModifier = (Keys)kc.ConvertFromString(AvailabilityModifier); //Converts a string to a bool Globals.Application.DebugLogging = Convert.ToBoolean(DebugLogging); //Converts a string to a bool Globals.Application.AvailableForCalloutsText = Convert.ToBoolean(AvailableForCalloutsText); //Assigns the rectangle alpha int to something Globals.Application.RectangleAlpha = RectangleAlpha; }
public override void Initialize() { Settings = new InitializationFile(@"Plugins\LSPDFR\AlfredoRedux.ini"); WeaponPool = Settings.ReadString("WEAPONS", "WeaponList", "WEAPON_PISTOL|COMPONENT_AT_PI_FLSH,WEAPON_CARBINERIFLE|COMPONENT_AT_AR_FLSH|COMPONENT_AT_AR_AFGRIP,WEAPON_STUNGUN,WEAPON_PUMPSHOTGUN,WEAPON_FLASHLIGHT,WEAPON_NIGHTSTICK,WEAPON_FIREEXTINGUISHER"); ApplyOnGoOnDuty = Settings.ReadBoolean("WEAPONS", "RunWhenGoingOnDuty", true); CleanPlayer = Settings.ReadBoolean("PLAYER", "CleanPlayer", true); FillHealth = Settings.ReadBoolean("PLAYER", "FillHealth", true); FillArmour = Settings.ReadBoolean("PLAYER", "FillArmour", true); InfiniteAmmo = Settings.ReadBoolean("AMMO", "InfiniteAmmo", false); RepairVehicle = Settings.ReadBoolean("VEHICLES", "RepairVehicle", true); CleanVehicle = Settings.ReadBoolean("VEHICLES", "CleanVehicle", false); GiveFlashlight = Settings.ReadBoolean("WEAPONS", "GiveFlashlight", true); OnlyRepairPoliceVehicles = Settings.ReadBoolean("VEHICLES", "OnlyRepairPoliceVehicles", true); AmmoCount = Settings.ReadInt16("AMMO", "AmmoCount", 1000); KeysConverter kc = new KeysConverter(); Keybind = (Keys)kc.ConvertFromString(Settings.ReadString("GENERAL", "Keybind", "F7")); Functions.OnOnDutyStateChanged += OnOnDutyStateChanged; CheckThread = new GameFiber(DoMagicThread); Game.DisplayNotification("~g~AlfredoRedux~w~ loaded!"); }
public static void LoadConfig() { InitializationFile settings = initialiseFile(Global.Application.ConfigPath + "EasyLoadout.ini"); Global.Application.DebugLogging = LoadoutConfig.ToBoolean(settings.ReadString("General", "DebugLogging", "false")); Logger.DebugLog("General Config Loading Started."); KeysConverter kc = new KeysConverter(); string opTemp, opmTemp, glTemp, glmTemp, dlnTemp, dlcTemp; opTemp = settings.ReadString("Keybinds", "OpenMenu", "F8"); opmTemp = settings.ReadString("Keybinds", "OpenMenuModifier", "None"); glTemp = settings.ReadString("Keybinds", "GiveLoadout", "F7"); glmTemp = settings.ReadString("Keybinds", "GiveLoadoutModifier", "None"); Global.Controls.OpenMenu = (Keys)kc.ConvertFromString(opTemp); Global.Controls.OpenMenuModifier = (Keys)kc.ConvertFromString(opmTemp); Global.Controls.GiveLoadout = (Keys)kc.ConvertFromString(glTemp); Global.Controls.GiveLoadoutModifier = (Keys)kc.ConvertFromString(glmTemp); dlnTemp = settings.ReadString("General", "DefaultLoadout", "Loadout1"); dlcTemp = settings.ReadString("General", dlnTemp, "Loadout1"); Global.Application.DefaultLoadout = new LoadoutData(dlnTemp, dlcTemp); Global.Application.LoadoutCount = settings.ReadInt32("MultiLoadout", "LoadoutCount", 3); //Ammo Count Global.LoadoutAmmo.PistolAmmo = settings.ReadInt16("Ammo", "PistolAmmo", 10000); Global.LoadoutAmmo.MGAmmo = settings.ReadInt16("Ammo", "MGAmmo", 10000); Global.LoadoutAmmo.ShotgunAmmo = settings.ReadInt16("Ammo", "ShotgunAmmo", 10000); Global.LoadoutAmmo.RifleAmmo = settings.ReadInt16("Ammo", "RifleAmmo", 10000); Global.LoadoutAmmo.SniperAmmo = settings.ReadInt16("Ammo", "SniperAmmo", 10000); Global.LoadoutAmmo.HeavyAmmo = settings.ReadInt16("Ammo", "HeavyAmmo", 10000); Global.LoadoutAmmo.ThrowableCount = settings.ReadInt16("Ammo", "ThrowableCount", 10000); Logger.DebugLog("General Config Loading Finished."); }