Exemple #1
0
        public void OnApplicationStart()
        {
            if (Config.BoostColours.Count == 0)
            {
                Log.Info("BoostColours config is empty!! Added default!");
                BoostColour bc = new BoostColour();
                bc.name = "Default";
                bc.r0   = 0.18823529411f;
                bc.g0   = 0.59607843137f;
                bc.b0   = 1f;
                bc.r1   = 0.53333333333f;
                bc.g1   = 0.0862745098f;
                bc.b1   = 1f;
                Config.BoostColours.Insert(0, bc);
                Config.SelectedId = "Default";
            }

            if (Config.SelectedId == null || !Config.BoostColours.Any(x => x.name == Config.SelectedId))
            {
                Log.Info("SelectedId is null or isnt in the BoostColours list. Default to the 0th item in the list.");
                Config.SelectedId = Config.BoostColours[0].name;
            }

            foreach (BoostColour bc in Config.BoostColours)
            {
                if (bc.name == Config.SelectedId)
                {
                    Boost = bc;
                    Log.Info("Loaded BoostColour set '" + bc.name + "'!");
                    break;
                }
            }

            Log.Info("Loaded the config!");

            harmony = new Harmony("moe.gabriella.LightingPlus");
            harmony.PatchAll(Assembly.GetExecutingAssembly());

            UI.ChooseSetUI.OnLoad();

            Log.Info("Ready!");
        }
Exemple #2
0
 public virtual void Update(BoostColour colour)
 {
     SelectedId   = colour.name;
     Plugin.Boost = colour;
     Plugin.Log.Info("Updated boost set to " + colour.name);
 }