Exemple #1
0
 public GenericModConfigMenuSetup(
     IModHelper helper,
     IManifest manifest,
     IOptional <IGenericModConfigMenuApi> configApiFactory,
     HudConfig hudConfig,
     ConfigManager <HudConfig> hudConfigManager,
     FishConfig fishConfig,
     ConfigManager <FishConfig> fishConfigManager,
     TreasureConfig treasureConfig,
     ConfigManager <TreasureConfig> treasureConfigManager
     )
 {
     this.helper    = helper ?? throw new ArgumentNullException(nameof(helper));
     this.manifest  = manifest ?? throw new ArgumentNullException(nameof(manifest));
     this.configApi = configApiFactory
                      ?? throw new ArgumentNullException(nameof(configApiFactory));
     this.hudConfig        = hudConfig ?? throw new ArgumentNullException(nameof(hudConfig));
     this.hudConfigManager = hudConfigManager
                             ?? throw new ArgumentNullException(nameof(hudConfigManager));
     this.fishConfig        = fishConfig ?? throw new ArgumentNullException(nameof(fishConfig));
     this.fishConfigManager = fishConfigManager
                              ?? throw new ArgumentNullException(nameof(fishConfigManager));
     this.treasureConfig =
         treasureConfig ?? throw new ArgumentNullException(nameof(treasureConfig));
     this.treasureConfigManager = treasureConfigManager
                                  ?? throw new ArgumentNullException(nameof(treasureConfigManager));
 }
Exemple #2
0
        public void OnEnter()
        {
            Service.EditBaseController.Enable(true);
            Service.BuildingController.EnterMoveMode(this.autoLiftSelectedBuilding);
            Service.WorldInitializer.View.SetEditModeVantage(true);
            Service.WorldInitializer.View.DrawWorldGrid();
            HudConfig hudConfig = new HudConfig(new string[]
            {
                "PlayerInfo",
                "Currency",
                "Droids",
                "Crystals",
                "ButtonExitEdit",
                "ButtonStore"
            });
            HUD hUD = Service.UXController.HUD;

            if (!GameConstants.DISABLE_BASE_LAYOUT_TOOL && !hUD.BaseLayoutToolView.IsBuildingPendingPurchase)
            {
                hudConfig.Add("BtnActivateStash");
            }
            hUD.ConfigureControls(hudConfig);
            hUD.BaseLayoutToolView.RefreshNewJewelStatus();
            Service.EventManager.SendEvent(EventId.EnterEditMode, null);
            Service.ChampionController.DestroyAllChampionEntities();
        }
Exemple #3
0
        private void SetDialogSettings(DroneConfig droneConfig, HudConfig hudConfig)
        {
            configSettings = new GeneralConfigBinding(droneConfig, hudConfig);
            configSettings.PropertyChanged += configSettings_PropertyChanged;

            this.DataContext = configSettings;
        }
Exemple #4
0
        public GeneralConfigBinding(DroneConfig droneConfig, HudConfig hudConfig)
        {
            networkUtils = new NetworkUtils();

            TakeOverDroneConfigSettings(droneConfig);
            TakeOverHudConfigSettings(hudConfig);
        }
Exemple #5
0
        private void InitializeHudInterface()
        {
            currentHudConfig = new HudConfig();
            currentHudConfig.Load();

            InitializeHudInterface(currentHudConfig);
        }
Exemple #6
0
        public WarBaseEditorState()
        {
            HudConfig config = new HudConfig(new string[0]);
            HUD       hUD    = Service.Get <UXController>().HUD;

            hUD.ConfigureControls(config);
        }
Exemple #7
0
        public GeneralConfigWindow(DroneConfig droneConfig, HudConfig hudConfig)
        {
            InitializeComponent();
            SetDialogSettings(droneConfig, hudConfig);

            UpdateDependentHudCheckBoxes(hudConfig.ShowHud);
        }
Exemple #8
0
        private void SaveDroneAndHudConfigStates(DroneConfig droneConfig, HudConfig hudConfig)
        {
            currentDroneConfig = droneConfig;
            currentHudConfig   = hudConfig;

            droneConfig.Save();
            hudConfig.Save();
        }
Exemple #9
0
        public GeneralConfigWindow(DroneConfig droneConfig, HudConfig hudConfig)
        {
            InitializeComponent();
            SetDialogSettings(droneConfig, hudConfig);

            UpdateDependentHudCheckBoxes(hudConfig.ShowHud);
            UpdateFirmwareVersionComboBox(droneConfig.UseSpecificFirmwareVersion);
        }
Exemple #10
0
 private void TakeOverHudConfigSettings(HudConfig hudConfig)
 {
     showHud         = hudConfig.ShowHud;
     showHudTarget   = hudConfig.ShowTarget;
     showHudBaseLine = hudConfig.ShowBaseLine;
     showHudHeading  = hudConfig.ShowHeading;
     showHudAltitude = hudConfig.ShowAltitude;
     showHudSpeed    = hudConfig.ShowSpeed;
     showHudBattery  = hudConfig.ShowBattery;
 }
Exemple #11
0
        public void RefreshVisibility()
        {
            IState          currentState     = Service.Get <GameStateMachine>().CurrentState;
            HUD             hUD              = Service.Get <UXController>().HUD;
            HudConfig       currentHudConfig = hUD.CurrentHudConfig;
            SquadController squadController  = Service.Get <SquadController>();
            Squad           currentSquad     = squadController.StateManager.GetCurrentSquad();
            bool            visible          = (currentState is GalaxyState || currentHudConfig.Has("SquadScreen")) && currentSquad != null;

            this.Visible = visible;
        }
Exemple #12
0
        public HudConfig GetResultingHudConfig()
        {
            HudConfig hudConfig = new HudConfig();

            hudConfig.ShowHud      = showHud;
            hudConfig.ShowTarget   = showHudTarget;
            hudConfig.ShowBaseLine = showHudBaseLine;
            hudConfig.ShowHeading  = showHudHeading;
            hudConfig.ShowAltitude = showHudAltitude;
            hudConfig.ShowSpeed    = showHudSpeed;
            hudConfig.ShowBattery  = showHudBattery;

            return(hudConfig);
        }
Exemple #13
0
 public FishingHudRenderer(
     IModHelper helper,
     IFishingApi fishingApi,
     HudConfig hudConfig,
     INamespaceRegistry namespaceRegistry
     )
 {
     this.helper            = helper ?? throw new ArgumentNullException(nameof(helper));
     this.fishingApi        = fishingApi ?? throw new ArgumentNullException(nameof(fishingApi));
     this.hudConfig         = hudConfig ?? throw new ArgumentNullException(nameof(hudConfig));
     this.namespaceRegistry = namespaceRegistry;
     this.whitePixel        = new(Game1.graphics.GraphicsDevice, 1, 1);
     this.whitePixel.SetData(new[] { Color.White });
 }
Exemple #14
0
        public void OnEnter()
        {
            HudConfig config = new HudConfig(new string[]
            {
                "Currency",
                "Droids",
                "Crystals",
                "PlayerInfo",
                "Shield",
                "ButtonBattle",
                "ButtonWar",
                "ButtonLog",
                "ButtonLeaderboard",
                "ButtonSettings",
                "ButtonClans",
                "ButtonStore",
                "Newspaper",
                "SquadScreen",
                "SpecialPromo"
            });

            Service.UXController.HUD.ConfigureControls(config);
            if (!this.transitionToHomeState)
            {
                if (Service.WorldTransitioner.IsCurrentWorldHome() && this.ForceReloadMap)
                {
                    Service.ProjectileViewManager.UnloadProjectileAssetsAndPools();
                    Service.SpecialAttackController.UnloadPreloads();
                    Service.WorldInitializer.ProcessMapData(Service.CurrentPlayer.Map);
                    Service.EventManager.SendEvent(EventId.HomeStateTransitionComplete, null);
                }
                else
                {
                    Service.EventManager.SendEvent(EventId.WorldInTransitionComplete, null);
                }
                if (this.pendingCompletion != null)
                {
                    this.pendingCompletion();
                    this.pendingCompletion = null;
                }
            }
            Service.BuildingController.EnterSelectMode();
            Service.DeployerController.ExitAllDeployModes();
            Service.BILoggingController.SchedulePerformanceLogging(true);
            Service.InventoryCrateRewardController.ScheduleGivingNextDailyCrate();
        }
        public override void Execute()
        {
            base.Execute();
            string[] list;
            if (string.Compare("none", this.prepareArgs[0], 5) == 0)
            {
                list = new string[0];
            }
            else
            {
                list = this.prepareArgs[0].Split(new char[]
                {
                    ','
                });
            }
            HudConfig config = new HudConfig(list);

            Service.Get <UXController>().HUD.ConfigureControls(config);
            this.parent.ChildComplete(this);
        }
Exemple #16
0
        public override void Execute()
        {
            base.Execute();
            string[] list;
            if (string.Compare("none", this.prepareArgs[0], StringComparison.InvariantCultureIgnoreCase) == 0)
            {
                list = new string[0];
            }
            else
            {
                list = this.prepareArgs[0].Split(new char[]
                {
                    ','
                });
            }
            HudConfig config = new HudConfig(list);

            Service.UXController.HUD.ConfigureControls(config);
            this.parent.ChildComplete(this);
        }
Exemple #17
0
        public void ConfigureBaseLayoutToolStateHUD()
        {
            HudConfig hudConfig = new HudConfig(new string[]
            {
                "BtnCancelStash",
                "BtnSaveLayout",
                "BtnStashAll",
                "BtnStashMode",
                "StashPanelHolder",
                "SpriteStashTray",
                "LabelTitleTopLeft"
            });

            if (Service.Get <GameStateMachine>().CurrentState is WarBaseEditorState)
            {
                this.bltTitleLabel.Text = Service.Get <Lang>().Get("WAR_BASE_LAYOUT_TITLE", new object[0]);
                hudConfig.Add("BtnInfoWarBE");
            }
            else
            {
                this.bltTitleLabel.Text = Service.Get <Lang>().Get("blt_title", new object[0]);
            }
            this.hud.ConfigureControls(hudConfig);
        }
Exemple #18
0
        public void OnEnter()
        {
            BattleController battleController = Service.BattleController;

            battleController.StartBattle();
            Service.BattleRecordController.StartRecord();
            HudConfig  hudConfig = null;
            BattleType type      = battleController.GetCurrentBattle().Type;

            switch (type)
            {
            case BattleType.Pvp:
            case BattleType.PveAttack:
            case BattleType.PveFue:
            case BattleType.ClientBattle:
                hudConfig = new HudConfig(new string[]
                {
                    "Currency",
                    "OpponentInfo",
                    "ButtonEndBattle",
                    "LabelTimeLeft",
                    "DamageStars",
                    "LabelBaseNameOpponent",
                    "TroopsGrid",
                    "LabelDeployInstructions",
                    "LabelCurrencyValueOpponent"
                });
                break;

            case BattleType.PveDefend:
                hudConfig = new HudConfig(new string[]
                {
                    "Currency",
                    "PlayerInfo",
                    "ButtonEndBattle",
                    "LabelTimeLeft",
                    "DamageStars",
                    "LabelBaseNameOpponent",
                    "TroopsGrid",
                    "LabelDeployInstructions",
                    "LabelCurrencyValueOpponent"
                });
                break;

            case BattleType.PveBuffBase:
            case BattleType.PvpAttackSquadWar:
                hudConfig = new HudConfig(new string[]
                {
                    "OpponentInfo",
                    "BuffsYoursSquadWars",
                    "ButtonEndBattle",
                    "LabelTimeLeft",
                    "DamageStars",
                    "LabelBaseNameOpponent",
                    "TroopsGrid",
                    "WarAttackStarted"
                });
                if (type != BattleType.PveBuffBase)
                {
                    hudConfig.Add("BuffsOpponentsSquadWars");
                }
                break;
            }
            Service.UXController.HUD.ConfigureControls(hudConfig);
            Service.BILoggingController.SchedulePerformanceLogging(false);
        }
Exemple #19
0
        private void InitializeHudInterface(HudConfig hudConfig)
        {
            HudConstants hudConstants = new HudConstants(droneControl.FrontCameraFieldOfViewDegrees);

            hudInterface = new HudInterface(hudConfig, hudConstants);
        }
Exemple #20
0
 private void CreateNewHudConfig()
 {
     hudConfig = configSettings.GetResultingHudConfig();
 }
        public virtual void OnEnter()
        {
            Service.Get <UXController>().MiscElementsManager.RemoveGalaxyTournamentStatus();
            HudConfig  hudConfig  = null;
            BattleType battleType = this.battleData.BattleType;

            switch (battleType)
            {
            case BattleType.Pvp:
                hudConfig = new HudConfig(new string[]
                {
                    "Currency",
                    "OpponentInfo",
                    "MedalInfo",
                    "ButtonHome",
                    "LabelBaseNameOpponent",
                    "TroopsGrid",
                    "LabelDeployInstructions",
                    "LabelCurrencyValueOpponent"
                });
                if (!this.battleData.IsRevenge)
                {
                    hudConfig.Add("ButtonNextBattle");
                }
                break;

            case BattleType.PveDefend:
                hudConfig = new HudConfig(new string[]
                {
                    "Currency",
                    "PlayerInfo",
                    "LabelBaseNameOpponent",
                    "LabelCurrencyValueOpponent",
                    "TroopsGrid",
                    "LabelDeployInstructions"
                });
                break;

            case BattleType.PveAttack:
            case BattleType.PveFue:
            case BattleType.ClientBattle:
                hudConfig = new HudConfig(new string[]
                {
                    "Currency",
                    "OpponentInfo",
                    "ButtonHome",
                    "LabelBaseNameOpponent",
                    "TroopsGrid",
                    "LabelDeployInstructions",
                    "LabelCurrencyValueOpponent"
                });
                break;

            case BattleType.PveBuffBase:
            case BattleType.PvpAttackSquadWar:
            {
                hudConfig = new HudConfig(new string[]
                    {
                        "OpponentInfo",
                        "LabelBaseNameOpponent",
                        "WarAttack"
                    });
                SquadWarManager    warManager    = Service.Get <SquadController>().WarManager;
                bool               flag          = this.battleData.Attacker.PlayerFaction == this.battleData.Defender.PlayerFaction;
                SquadWarStatusType currentStatus = warManager.GetCurrentStatus();
                if (!flag)
                {
                    hudConfig.Add("BuffsYoursSquadWars");
                }
                if (battleType != BattleType.PveBuffBase)
                {
                    hudConfig.Add("BuffsOpponentsSquadWars");
                }
                if (this.battleData.Attacker.GuildId != this.battleData.Defender.GuildId && !warManager.IsCurrentlyScoutingOwnedBuffBase())
                {
                    hudConfig.Add("WarAttackOpponent");
                    if (currentStatus == SquadWarStatusType.PhaseAction)
                    {
                        hudConfig.Add("TroopsGrid");
                    }
                }
                if (currentStatus == SquadWarStatusType.PhasePrep)
                {
                    if (battleType == BattleType.PvpAttackSquadWar)
                    {
                        Service.Get <BuildingController>().EnterSelectMode();
                    }
                    else
                    {
                        Service.Get <BuildingController>().ExitAllModes();
                    }
                }
                break;
            }
            }
            if (hudConfig != null)
            {
                Service.Get <UXController>().HUD.ConfigureControls(hudConfig);
            }
        }