private void LaserDamageChanged(object sender, SliderChangedEventArgs args)
        {
            if (args.Id != LaserCannonConfig.SECTION_PROGRAM[2])
            {
                return;
            }

            LaserCannonConfig.program_settings["Damage"] = args.Value.ToString();
            LaserCannonConfig.WriteConfig();

            Main.OnConfigChanged.Trigger(true);
        }
        private void HostileOnly(object sender, ToggleChangedEventArgs args)
        {
            if (args.Id != LaserCannonConfig.SECTION_PROGRAM[0])
            {
                return;
            }

            LaserCannonConfig.program_settings["OnlyHostile"] = args.Value.ToString();
            LaserCannonConfig.WriteConfig();

            Main.OnConfigChanged.Trigger(true);
        }
        private void BeamColorChanged(object sender, ChoiceChangedEventArgs args)
        {
            if (args.Id != LaserCannonConfig.SECTION_PROGRAM[1])
            {
                return;
            }

            LaserCannonConfig.program_settings["BeamColor"] = ColorHelper.ColorNames[args.Index];
            LaserCannonConfig.beamColor = args.Index;

            LaserCannonConfig.WriteConfig();

            Main.OnConfigChanged.Trigger(true);
        }
Exemplo n.º 4
0
        private void LaserDamageChanged(object sender, SliderChangedEventArgs args)
        {
            if (args.Id != LaserCannonConfig.SECTION_PROGRAM[2])
            {
                return;
            }

            LaserCannonConfig.program_settings["Damage"] = args.Value.ToString();
            LaserCannonConfig.WriteConfig();

            if (Main.Instance != null)
            {
                Main.Instance.SendMessage("SetLaserStrength", SendMessageOptions.DontRequireReceiver);
            }
        }
Exemplo n.º 5
0
        private void HostileOnly(object sender, ToggleChangedEventArgs args)
        {
            if (args.Id != LaserCannonConfig.SECTION_PROGRAM[0])
            {
                return;
            }

            LaserCannonConfig.program_settings["OnlyHostile"] = args.Value.ToString();
            LaserCannonConfig.WriteConfig();

            if (Main.Instance != null)
            {
                Main.Instance.SendMessage("ShootOnlyHostile", SendMessageOptions.DontRequireReceiver);
            }
        }
Exemplo n.º 6
0
        public static void Load()
        {
            try
            {
                LaserCannonConfig.LoadConfig();
                var laserCannon = new LaserCannonPrefab();
                laserCannon.Patch();

                HarmonyInstance.Create("Subnautica.LaserCannon.mod").PatchAll(Assembly.GetExecutingAssembly());
                SceneManager.sceneLoaded += new UnityAction <Scene, LoadSceneMode>(OnSceneLoaded);
            }
            catch (Exception ex)
            {
                Debug.LogException(ex);
            }
        }
Exemplo n.º 7
0
        private void BeamColorChanged(object sender, ChoiceChangedEventArgs args)
        {
            if (args.Id != LaserCannonConfig.SECTION_PROGRAM[1])
            {
                return;
            }

            LaserCannonConfig.program_settings["BeamColor"] = Modules.Colors.ColorNames[args.Index];
            LaserCannonConfig.beamColor = args.Index;

            LaserCannonConfig.WriteConfig();

            if (Main.Instance != null)
            {
                Main.Instance.SendMessage("SetBeamColor", SendMessageOptions.DontRequireReceiver);
            }
        }
Exemplo n.º 8
0
        public static void Load()
        {
            try
            {
                objectHelper = new ObjectHelper();

                LaserCannonConfig.Config_Load();

                new LaserCannonPrefab().Patch();

                Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Subnautica.LaserCannon.mod");

                SceneManager.sceneLoaded += new UnityAction <Scene, LoadSceneMode>(OnSceneLoaded);
            }
            catch (Exception ex)
            {
                Debug.LogException(ex);
            }
        }