예제 #1
0
        public static IIdProvider <AOptionClass> CreateOptionClassProvider(IMenuClassCollection menuClassCollection)
        {
            return(IdProviderCreator.Create(() =>
            {
                var contourView = Mission.Current.GetMissionBehaviour <CommandSystemLogic>().FormationColorSubLogic;

                var optionClass = new OptionClass(CommandSystemSubModule.ModuleId,
                                                  GameTexts.FindText("str_rts_camera_command_system_option_class"), menuClassCollection);
                var commandOptionCategory = new OptionCategory("Command", GameTexts.FindText("str_rts_camera_command_system_command_system_options"));
                commandOptionCategory.AddOption(new BoolOptionViewModel(
                                                    GameTexts.FindText("str_rts_camera_command_system_click_to_select_formation"),
                                                    GameTexts.FindText("str_rts_camera_command_system_click_to_select_formation_hint"),
                                                    () => CommandSystemConfig.Get().ClickToSelectFormation, b =>
                {
                    CommandSystemConfig.Get().ClickToSelectFormation = b;
                    contourView?.SetEnableContourForSelectedFormation(b);
                }));
                commandOptionCategory.AddOption(new BoolOptionViewModel(
                                                    GameTexts.FindText("str_rts_camera_command_system_attack_specific_formation"),
                                                    GameTexts.FindText("str_rts_camera_command_system_attack_specific_formation_hint"),
                                                    () => CommandSystemConfig.Get().AttackSpecificFormation, b =>
                {
                    CommandSystemConfig.Get().AttackSpecificFormation = b;
                    if (b)
                    {
                        PatchChargeToFormation.Patch();
                    }
                }));
                optionClass.AddOptionCategory(0, commandOptionCategory);

                return optionClass;
            }, CommandSystemSubModule.ModuleId));
        }
예제 #2
0
        public override void OnCreated(MissionView entranceView)
        {
            var config = RTSCameraConfig.Get();

            if (config.AttackSpecificFormation)
            {
                PatchChargeToFormation.Patch();
            }

            if (config.FixCircularArrangement)
            {
                PatchCircularFormation.Patch();
            }
            List <MissionBehaviour> list = new List <MissionBehaviour>
            {
                new RTSCameraSelectCharacterView(),

                new RTSCameraLogic(),

                new HideHUDView(),
                new RTSCameraMenuView(),
                new FlyCameraMissionView(),
                new RTSCameraGameKeyConfigView(),
                new FormationColorMissionView(),
                new RTSCameraOrderTroopPlacer()
            };


            foreach (var missionBehaviour in list)
            {
                MissionStartingManager.AddMissionBehaviour(entranceView, missionBehaviour);
            }

            foreach (var extension in RTSCameraExtension.Extensions)
            {
                foreach (var missionBehaviour in extension.CreateMissionBehaviours(entranceView.Mission))
                {
                    MissionStartingManager.AddMissionBehaviour(entranceView, missionBehaviour);
                }
            }

            foreach (var extension in MissionExtensionCollection.Extensions)
            {
                foreach (var missionBehaviour in extension.CreateMissionBehaviours(entranceView.Mission))
                {
                    MissionStartingManager.AddMissionBehaviour(entranceView, missionBehaviour);
                }
            }
        }
        public override void OnCreated(MissionView entranceView)
        {
            var config = CommandSystemConfig.Get();

            if (config.AttackSpecificFormation)
            {
                PatchChargeToFormation.Patch();
            }
            List <MissionBehaviour> list = new List <MissionBehaviour>
            {
                new CommandSystemLogic(),
                new CommandSystemOrderTroopPlacer(),
                new DragWhenCommandView()
            };

            foreach (var missionBehaviour in list)
            {
                MissionStartingManager.AddMissionBehaviour(entranceView, missionBehaviour);
            }
        }