コード例 #1
0
 private void Disable()
 {
     this._hotbarIcon.Opacity = .5f;
     Enabled    = false;
     LockCamera = false;
     this.HotbarIcon.Tooltip = HEROsMod.HeroText("FlyCamEnableTooltip");
 }
コード例 #2
0
 private void _hotbarIcon_onLeftClick(object sender, EventArgs e)
 {
     if (ModUtils.NetworkMode != NetworkMode.None)
     {
         HEROsModNetwork.GeneralMessages.RequestToggleEnemies();
     }
     else
     {
         ToggleNPCs();
         if (EnemiesAllowed)
         {
             this._hotbarIcon.Opacity = 1f;
             this.HotbarIcon.Tooltip  = HEROsMod.HeroText("DisableEnemySpawns");
         }
         else
         {
             this._hotbarIcon.Opacity = .5f;
             this.HotbarIcon.Tooltip  = HEROsMod.HeroText("EnableEnemySpawns");
         }
         if (EnemiesAllowed)
         {
             Main.NewText(HEROsMod.HeroText("EnemySpawnsEnabled"));
         }
         else
         {
             Main.NewText(HEROsMod.HeroText("EnemySpawnsDisabled"));
         }
     }
 }
コード例 #3
0
ファイル: RegionService.cs プロジェクト: xPanini/HEROsMod
        public RegionService()
        {
            MultiplayerOnly              = true;
            RegionsVisible               = false;
            canEdit                      = false;
            canView                      = false;
            this._name                   = "Region Service";
            this._hotbarIcon             = new UIImage(HEROsMod.instance.GetTexture("Images/region") /*Main.itemTexture[1337]*/);
            this.HotbarIcon.Tooltip      = HEROsMod.HeroText("OpenRegionsWindow");
            this.HotbarIcon.onLeftClick += HotbarIcon_onLeftClick;
            this.HasPermissionToUse      = true;

            _regionWindow = new RegionWindow();
            this.AddUIView(_regionWindow);
            _regionWindow.Visible = false;
            _confirmationWindow   = new SelectionConformationWindow();
            this.AddUIView(_confirmationWindow);
            _confirmationWindow.Visible = false;

            _regionWindow.bCreateRegion.onLeftClick  += bCreateRegion_onLeftClick;
            _regionWindow.bAddPlayer.onLeftClick     += bAddPlayer_onLeftClick;
            _regionWindow.bAddGroup.onLeftClick      += bAddGroup_onLeftClick;
            _confirmationWindow.bConfirm.onLeftClick += bConfirm_onLeftClick;
            _confirmationWindow.bCancel.onLeftClick  += bCancel_onLeftClick;

            HEROsModNetwork.GeneralMessages.RegionsUpdated += GeneralMessages_RegionsUpdated;
        }
コード例 #4
0
        private void HotbarIcon_onLeftClick(object sender, EventArgs e)
        {
            bool childAvailable = false;

            foreach (var item in genericServices)
            {
                childAvailable |= item.HasPermissionToUse;
            }
            if (childAvailable)
            {
                if (_extensionMenuHotbar.selected)
                {
                    _extensionMenuHotbar.selected = false;
                    _extensionMenuHotbar.Hide();
                }
                else
                {
                    _extensionMenuHotbar.selected = true;
                    _extensionMenuHotbar.Show();
                }
            }
            else
            {
                Main.NewText(HEROsMod.HeroText("NoExtensionsLoadedNote"));
            }
        }
コード例 #5
0
        public CurrentPlayersWindow()
        {
            Width   = 300;
            Height  = 400;
            CanMove = true;
            Anchor  = AnchorPosition.Center;
            CenterToParent();
            UILabel title  = new UILabel(HEROsMod.HeroText("ConnectedPlayers"));
            UIImage bClose = new UIImage(closeTexture);

            bClose.Anchor        = AnchorPosition.TopRight;
            bClose.X             = Width - spacing;
            bClose.Y             = spacing;
            title.Scale          = .6f;
            title.X              = spacing;
            title.Y              = spacing;
            title.OverridesMouse = false;
            scrollView.Width     = Width - spacing * 2;
            scrollView.Height    = Height - title.Height - spacing * 2;
            scrollView.X         = spacing;
            scrollView.Y         = title.Y + title.Height;

            AddChild(scrollView);
            AddChild(title);
            AddChild(bClose);
            bClose.onLeftClick += bClose_onLeftClick;
            UpdateList();
        }
コード例 #6
0
ファイル: Teleporter.cs プロジェクト: Tyfyter/HEROsMod
        public void PostDrawFullScreenMap()
        {
            if (HasPermissionToUse && !Main.gameMenu)
            {
                Main.spriteBatch.DrawString(Main.fontMouseText, HEROsMod.HeroText("RightClickToTeleport"), new Vector2(15, Main.screenHeight - 80), Color.White);
                Terraria.GameInput.PlayerInput.SetZoom_Unscaled();

                if (Main.mouseRight && Main.keyState.IsKeyUp(Microsoft.Xna.Framework.Input.Keys.LeftControl))
                {
                    int     mapWidth       = Main.maxTilesX * 16;
                    int     mapHeight      = Main.maxTilesY * 16;
                    Vector2 cursorPosition = new Vector2(Main.mouseX, Main.mouseY);

                    cursorPosition.X -= Main.screenWidth / 2;
                    cursorPosition.Y -= Main.screenHeight / 2;

                    Vector2 mapPosition         = Main.mapFullscreenPos;
                    Vector2 cursorWorldPosition = mapPosition;

                    cursorPosition      /= 16;
                    cursorPosition      *= 16 / Main.mapFullscreenScale;
                    cursorWorldPosition += cursorPosition;
                    cursorWorldPosition *= 16;

                    Player player = Main.player[Main.myPlayer];
                    cursorWorldPosition.Y -= player.height;
                    if (cursorWorldPosition.X < 0)
                    {
                        cursorWorldPosition.X = 0;
                    }
                    else if (cursorWorldPosition.X + player.width > mapWidth)
                    {
                        cursorWorldPosition.X = mapWidth - player.width;
                    }
                    if (cursorWorldPosition.Y < 0)
                    {
                        cursorWorldPosition.Y = 0;
                    }
                    else if (cursorWorldPosition.Y + player.height > mapHeight)
                    {
                        cursorWorldPosition.Y = mapHeight - player.height;
                    }

                    if (Main.netMode == 0)                     // single
                    {
                        player.Teleport(cursorWorldPosition, 1, 0);
                        player.position  = cursorWorldPosition;
                        player.velocity  = Vector2.Zero;
                        player.fallStart = (int)(player.position.Y / 16f);
                    }
                    else                     // 1, client
                    {
                        //ErrorLogger.Log("Teleport");
                        HEROsModNetwork.GeneralMessages.RequestTeleport(cursorWorldPosition);
                        //NetMessage.SendData(65, -1, -1, "", 0, player.whoAmI, cursorWorldPosition.X, cursorWorldPosition.Y, 1, 0, 0);
                    }
                }
                Terraria.GameInput.PlayerInput.SetZoom_UI();
            }
        }
コード例 #7
0
        public static void ProcessLoginRequest(string username, string password, int playerNumber)
        {
            int groupID  = 0;
            int playerID = 0;

            for (int i = 0; i < Network.Players.Length; i++)
            {
                if (Network.Players[i].Username.ToLower() == username.ToLower())
                {
                    Network.SendTextToPlayer(HEROsMod.HeroText("AccountAlreadyLoggedIn"), playerNumber);
                    return;
                }
            }
            if (DatabaseController.Login(ref username, password, ref playerID, ref groupID))
            {
                Network.Players[playerNumber].Username = username;
                Network.Players[playerNumber].ID       = playerID;
                if (groupID == 0)
                {
                    groupID = Network.DefaultGroup.ID;
                    DatabaseController.SetPlayerGroup(playerID, groupID);
                }
                Network.Players[playerNumber].Group = Network.GetGroupByID(groupID);
                if (Network.Players[playerNumber].UsingHEROsMod)
                {
                    LoginSuccess(playerNumber);
                }
                Network.SendTextToPlayer(string.Format(HEROsMod.HeroText("LoggedInSuccessfully"), Network.Players[playerNumber].Group.Name), playerNumber, Color.Green);
            }
            else
            {
                Network.SendTextToPlayer(HEROsMod.HeroText("InvalidUsernameOrPassword"), playerNumber, Color.Red);
            }
        }
コード例 #8
0
ファイル: Waypoints.cs プロジェクト: xPanini/HEROsMod
        private void bSave_onLeftClick(object sender, EventArgs e)
        {
            if (textbox.Text.Length > 0)
            {
                textbox.Unfocus();

                if (ModUtils.NetworkMode == NetworkMode.None)
                {
                    if (!Waypoints.AddWaypoint(textbox.Text, waypointPos))
                    {
                        UIMessageBox mb = new UIMessageBox(HEROsMod.HeroText("WaypointAlreadyExistsNote"), UIMessageBoxType.Ok, true);
                        this.AddChild(mb);
                    }
                    else
                    {
                        Close();
                    }
                }
                else
                {
                    HEROsModNetwork.GeneralMessages.RequestAddWaypoint(textbox.Text, waypointPos);
                    Close();
                }
            }
        }
コード例 #9
0
 private static void ProcessAddGroupReqest(ref BinaryReader reader, int playerNumber)
 {
     if (Network.NetworkMode == NetworkMode.Server)
     {
         if (!Network.Players[playerNumber].Group.IsAdmin)
         {
             return;
         }
         string newGroupName = reader.ReadString();
         for (int i = 0; i < Network.Groups.Count; i++)
         {
             //Check to make sure that group does not already exist
             if (Network.Groups[i].Name.ToLower() == newGroupName.ToLower())
             {
                 Network.SendTextToPlayer(HEROsMod.HeroText("GroupAlreadyExists"), playerNumber);
                 return;
             }
         }
         Group newGroup = new Group(newGroupName);
         DatabaseController.AddGroup(ref newGroup);
         Network.Groups.Add(newGroup);
         if (GroupChanged != null)
         {
             GroupChanged(null, EventArgs.Empty);
         }
     }
 }
コード例 #10
0
ファイル: ItemClearer.cs プロジェクト: xPanini/HEROsMod
 public ItemClearer()
 {
     this._name                    = "Item Clearer";
     this._hotbarIcon              = new UIImage(HEROsMod.instance.GetTexture("Images/canIcon"));
     this._hotbarIcon.onLeftClick += _hotbarIcon_onLeftClick;
     this.HotbarIcon.Tooltip       = HEROsMod.HeroText("ClearItemsOnGround");
 }
コード例 #11
0
ファイル: GroupInspector.cs プロジェクト: xPanini/HEROsMod
        private void bDelete_onLeftClick(object sender, EventArgs e)
        {
            UIMessageBox mb = new UIMessageBox(string.Format(HEROsMod.HeroText("AreYouSureDeleteGroup"), dropdown.Text), UIMessageBoxType.YesNo, true);

            mb.yesClicked += mb_yesClicked;
            this.Parent.AddChild(mb);
        }
コード例 #12
0
ファイル: RegionService.cs プロジェクト: Tyfyter/HEROsMod
        public override void MyGroupUpdated()
        {
            canView = HEROsModNetwork.LoginService.MyGroup.HasPermission("ViewRegions");
            canEdit = HEROsModNetwork.LoginService.MyGroup.HasPermission("EditRegions");             // "EditRegions" grants "ViewRegions" abilities regardless.
            this.HasPermissionToUse = canView || canEdit;
            // this._canAccessSettings = HEROsModNetwork.LoginService.MyGroup.IsAdmin;

            if (canEdit)
            {
                this.HotbarIcon.Tooltip = HEROsMod.HeroText("OpenRegionsWindow");
            }
            else
            {
                _confirmationWindow.Close();
                _regionWindow.Close();
                SelectionTool.Reset();
                if (canView)
                {
                    HotbarIcon.Tooltip = HEROsMod.HeroText("ToggleRegionsVisible");
                }
                else
                {
                    RegionService.RegionsVisible = false;
                }
            }

            //base.MyGroupUpdated();
        }
コード例 #13
0
        public static void ProcessRegistrationRequest(string username, string password, int playerNumber)
        {
            DatabaseController.RegistrationResult regResult = DatabaseController.Register(username, password);
            switch (regResult)
            {
            case DatabaseController.RegistrationResult.Sucess:
                Network.SendTextToPlayer(HEROsMod.HeroText("SuccessfullyRegistered"), playerNumber);
                for (int i = 0; i < Network.Players.Length; i++)
                {
                    HEROsModPlayer player = Network.Players[i];
                    if (player.ServerInstance.IsActive && player.Group.IsAdmin)
                    {
                        GeneralMessages.SendRegisteredUsersToPlayer(i);
                    }
                }
                break;

            case DatabaseController.RegistrationResult.UsernameTaken:
                Network.SendTextToPlayer(HEROsMod.HeroText("UsernameAlreadyTaken"), playerNumber);
                break;

            case DatabaseController.RegistrationResult.Error:
                Network.SendTextToPlayer("An error occured when trying to register.", playerNumber);
                break;
            }
        }
コード例 #14
0
 public override void Action(CommandCaller caller, string input, string[] args)
 {
     if (Main.netMode == 0)
     {
         throw new UsageException("Only use this command while on server.");
     }
     if (args.Length != 1 || args[0].Length != 6)
     {
         throw new UsageException();
     }
     if (args[0] == Network.AuthCode.ToString())
     {
         if (Network.Players[caller.Player.whoAmI].Username.Length > 0)
         {
             Network.Players[caller.Player.whoAmI].Group = Network.AdminGroup;
             DatabaseController.SetPlayerGroup(Network.Players[caller.Player.whoAmI].ID, Network.Players[caller.Player.whoAmI].Group.ID);
             LoginService.SendPlayerPermissions(caller.Player.whoAmI);
             Network.SendTextToPlayer(HEROsMod.HeroText("YouAreNowAdmin"), caller.Player.whoAmI);
             return;
         }
         else
         {
             Network.SendTextToPlayer(HEROsMod.HeroText("PleaseLoginFirst"), caller.Player.whoAmI);
             return;
         }
     }
     throw new UsageException(HEROsMod.HeroText("AuthCodeIsIncorrect"));
 }
コード例 #15
0
 private static void ProcessPlayerUsingHEROsMod(int playerNumber)
 {
     if (Network.NetworkMode == NetworkMode.Server)
     {
         ModUtils.DebugText("ProcessPlayerUsingHEROsMod: " + playerNumber);
         Network.Players[playerNumber].UsingHEROsMod = true;
         LoginService.SendGroupList(playerNumber);
         LoginService.SendPlayerPermissions(playerNumber);
         SendWaypointListToPlayer(playerNumber);
         SendRegionListToPlayer(playerNumber);
         SendCurrentTogglesToPlayer(playerNumber);
         //CTF.CTFMessages.SendTeamObjectPositionToPlayer(CTF.CaptureTheFlag.RedTeam.Flag, playerNumber);
         //CTF.CTFMessages.SendTeamObjectPositionToPlayer(CTF.CaptureTheFlag.BlueTeam.Flag, playerNumber);
         //CTF.CTFMessages.SendTeamObjectPositionToPlayer(CTF.CaptureTheFlag.RedTeam.FlagPlatform, playerNumber);
         //CTF.CTFMessages.SendTeamObjectPositionToPlayer(CTF.CaptureTheFlag.BlueTeam.FlagPlatform, playerNumber);
         //CTF.CTFMessages.SendTeamObjectPositionToPlayer(CTF.CaptureTheFlag.RedTeam.SpawnPlatform, playerNumber);
         //CTF.CTFMessages.SendTeamObjectPositionToPlayer(CTF.CaptureTheFlag.BlueTeam.SpawnPlatform, playerNumber);
         //CTF.CTFMessages.SendTeamListToPlayer(playerNumber);
         //if (CTF.CaptureTheFlag.InPregameLobby || CTF.CaptureTheFlag.GameInProgress)
         //{
         //	CTF.CTFMessages.SendCTFSettings(playerNumber);
         //}
         //if (CTF.CaptureTheFlag.InPregameLobby)
         //{
         //	CTF.CTFMessages.TellClientLobbyStarted(playerNumber);
         //}
         //else if (CTF.CaptureTheFlag.GameInProgress)
         //{
         //	CTF.CTFMessages.TellClientGameStarted(playerNumber);
         //	CTF.CTFMessages.ChangePlayerTeam(Network.Players[playerNumber], CTF.TeamColor.None);
         //}
         Network.SendTextToPlayer(HEROsMod.HeroText("LoginInstructions"), playerNumber, Color.Red);
     }
 }
コード例 #16
0
ファイル: InvasionService.cs プロジェクト: xPanini/HEROsMod
        public EventWindow()
        {
            string[] buttonText = new string[]
            {
                "Goblin Invasion",
                "Frost Legion Invasion",
                "Pirate Invasion",
                "Solar Eclipse",
                "Blood Moon",
                "Pumpkin Moon",
                "Frost Moon"
            };

            this.CanMove = true;
            int buttonWidth = 175;

            UILabel lTitle = new UILabel(HEROsMod.HeroText("Events"));

            lTitle.Scale          = .6f;
            lTitle.X              = LargeSpacing;
            lTitle.Y              = LargeSpacing;
            lTitle.OverridesMouse = false;
            AddChild(lTitle);

            UIImage bClose = new UIImage(closeTexture);

            bClose.X            = buttonWidth + LargeSpacing - bClose.Width;
            bClose.Y            = LargeSpacing;
            bClose.onLeftClick += bClose_onLeftClick;
            AddChild(bClose);

            UIButton[] buttons = new UIButton[buttonText.Length];
            float      yPos    = lTitle.Y + lTitle.Height + SmallSpacing;

            for (int i = 0; i < buttonText.Length; i++)
            {
                buttons[i]              = new UIButton(buttonText[i]);
                buttons[i].AutoSize     = false;
                buttons[i].Width        = buttonWidth;
                buttons[i].X            = LargeSpacing;
                buttons[i].Y            = yPos;
                buttons[i].Tag          = i;
                buttons[i].onLeftClick += EventWindow_onLeftClick;
                yPos += buttons[i].Height + Spacing;
                AddChild(buttons[i]);
            }

            UIButton bStopEvents = new UIButton(HEROsMod.HeroText("Stop Events"));

            bStopEvents.AutoSize     = false;
            bStopEvents.Width        = buttonWidth;
            bStopEvents.X            = LargeSpacing;
            bStopEvents.Y            = yPos + Spacing;
            bStopEvents.onLeftClick += bStopEvents_onLeftClick;
            AddChild(bStopEvents);

            this.Height = bStopEvents.Y + bStopEvents.Height + LargeSpacing;
            this.Width  = buttonWidth + LargeSpacing * 2;
        }
コード例 #17
0
 public PlayerList()
 {
     MultiplayerOnly               = true;
     this._name                    = "Player List";
     this._hotbarIcon              = new UIImage(HEROsMod.instance.GetTexture("Images/connectedPlayers"));
     this._hotbarIcon.onLeftClick += _hotbarIcon_onLeftClick;
     this.HotbarIcon.Tooltip       = HEROsMod.HeroText("ViewConnectedPlayers");
 }
コード例 #18
0
 public override void Draw(SpriteBatch spriteBatch)
 {
     if (Enabled && !LockCamera)
     {
         Main.spriteBatch.DrawString(Main.fontMouseText, HEROsMod.HeroText("RightClickToTeleport"), new Vector2(15, Main.screenHeight - 120), Color.White);
         Main.spriteBatch.DrawString(Main.fontMouseText, HEROsMod.HeroText("FlyCamInstructions"), new Vector2(15, Main.screenHeight - 90), Color.White);
     }
 }
コード例 #19
0
 private static void ProcessStopSandstormRequest(int playerNumber)
 {
     if (Network.Players[playerNumber].Group.HasPermission("ChangeTimeWeather"))
     {
         ModUtils.StopSandstorm();
         Network.SendTextToAllPlayers(string.Format(HEROsMod.HeroText("SandstormTurnedOffBy"), Main.player[playerNumber].name));
     }
 }
コード例 #20
0
 private static void ProcessClearGroundItemsRequest(int playerNumber)
 {
     if (Network.Players[playerNumber].Group.HasPermission("ClearItems"))
     {
         Network.ClearGroundItems();
         Network.SendTextToAllPlayers(string.Format(HEROsMod.HeroText("ItemsClearedBy"), Main.player[playerNumber].name));
     }
 }
コード例 #21
0
 private static void ProcessStopEventsRequest(int playerNumber)
 {
     if (Network.Players[playerNumber].Group.HasPermission("StartEvents"))
     {
         HEROsModServices.InvasionService.StopAllEvents();
         Network.SendTextToAllPlayers(string.Format(HEROsMod.HeroText("EventsStoppedBy"), Network.Players[playerNumber].GameInstance.name));
     }
 }
コード例 #22
0
 public CheckTileModificationTool()
 {
     MultiplayerOnly              = true;
     this._hotbarIcon             = new UIImage(HEROsMod.instance.GetTexture("Images/tileModification") /*Main.itemTexture[1999]*/);
     this.HotbarIcon.Tooltip      = HEROsMod.HeroText("CheckTileForLastModification");
     this.HotbarIcon.onLeftClick += HotbarIcon_onLeftClick;
     this.HasPermissionToUse      = true;
 }
コード例 #23
0
ファイル: GodModeService.cs プロジェクト: xPanini/HEROsMod
 public GodModeService()
 {
     this._hotbarIcon             = new UIImage(HEROsMod.instance.GetTexture("Images/godMode") /*Main.itemTexture[1990]*/);
     this.HotbarIcon.Tooltip      = HEROsMod.HeroText("ToggleGodMode");
     this.HotbarIcon.onLeftClick += HotbarIcon_onLeftClick;
     GodModeToggled += GodModeService_GodModeToggled;
     Enabled         = false;
 }
コード例 #24
0
ファイル: Login.cs プロジェクト: xPanini/HEROsMod
        public LoginWindow()
        {
            UIView.exclusiveControl = this;

            Width       = 600;
            this.Anchor = AnchorPosition.Center;

            lUsername              = new UILabel(HEROsMod.HeroText("Username"));
            tbUsername             = new UITextbox();
            lPassword              = new UILabel(HEROsMod.HeroText("Password"));
            tbPassword             = new UITextbox();
            tbPassword.PasswordBox = true;
            UIButton bLogin    = new UIButton(HEROsMod.HeroText("Login"));
            UIButton bCancel   = new UIButton(HEROsMod.HeroText("Cancel"));
            UIButton bRegister = new UIButton(HEROsMod.HeroText("Register"));

            bRegister.AutoSize = false;
            bRegister.Width    = 100;

            lUsername.Scale = .5f;
            lPassword.Scale = .5f;

            bLogin.Anchor  = AnchorPosition.TopRight;
            bCancel.Anchor = AnchorPosition.TopRight;

            lUsername.X  = spacing;
            lUsername.Y  = spacing;
            tbUsername.X = lUsername.X + lUsername.Width + spacing;
            tbUsername.Y = lUsername.Y;
            lPassword.X  = lUsername.X;
            lPassword.Y  = lUsername.Y + lUsername.Height + spacing;
            tbPassword.X = tbUsername.X;
            tbPassword.Y = lPassword.Y;

            bCancel.Position = new Vector2(this.Width - spacing, tbPassword.Y + tbPassword.Height + spacing);
            bLogin.Position  = new Vector2(bCancel.Position.X - bCancel.Width - spacing, bCancel.Position.Y);
            bRegister.X      = spacing;
            bRegister.Y      = bCancel.Y;
            this.Height      = bCancel.Y + bCancel.Height + spacing;

            bCancel.onLeftClick     += bCancel_onLeftClick;
            bLogin.onLeftClick      += bLogin_onLeftClick;
            bRegister.onLeftClick   += bRegister_onLeftClick;
            tbUsername.OnEnterPress += bLogin_onLeftClick;
            tbPassword.OnEnterPress += bLogin_onLeftClick;
            tbUsername.OnTabPress   += tbUsername_OnTabPress;
            tbPassword.OnTabPress   += tbPassword_OnTabPress;

            AddChild(lUsername);
            AddChild(tbUsername);
            AddChild(lPassword);
            AddChild(tbPassword);
            AddChild(bLogin);
            AddChild(bCancel);
            AddChild(bRegister);

            tbUsername.Focus();
        }
コード例 #25
0
 public EnemyToggler()
 {
     this._name                    = "Enemy Toggler";
     this._hotbarIcon              = new UIImage(HEROsMod.instance.GetTexture("Images/npcIcon"));
     this._hotbarIcon.onLeftClick += _hotbarIcon_onLeftClick;
     this.HotbarIcon.Tooltip       = HEROsMod.HeroText("DisableEnemySpawns");
     this._hotbarIcon.Opacity      = 1f;
     HEROsModNetwork.GeneralMessages.EnemiesToggledByServer += GeneralMessages_EnemiesToggledByServer;
 }
コード例 #26
0
 public SpawnPointSetter(UIHotbar hotbar)
 {
     IsInHotbar                   = true;
     HotbarParent                 = hotbar;
     this._name                   = "Spawn Point Setter";
     this._hotbarIcon             = new UIImage(HEROsMod.instance.GetTexture("Images/spawn") /*Main.itemTexture[69]*/);
     this._hotbarIcon.Tooltip     = HEROsMod.HeroText("SetSpawnPoint");
     this.HotbarIcon.onLeftClick += HotbarIcon_onLeftClick;
 }
コード例 #27
0
 public InfiniteReach()
 {
     Enabled                       = false;
     this._name                    = "Infinite Reach";
     this._hotbarIcon              = new UIImage(HEROsMod.instance.GetTexture("Images/infiniteReach") /*Main.itemTexture[407]*/);
     this._hotbarIcon.onLeftClick += _hotbarIcon_onLeftClick;
     this.HotbarIcon.Tooltip       = HEROsMod.HeroText("EnableInfiniteReach");
     Disable();
 }
コード例 #28
0
ファイル: ItemBrowser.cs プロジェクト: NluzzG/HEROsMod
 public Category(string name)
 {
     this.Name          = name;
     this.LocalizedName = HEROsMod.HeroText($"ItemBrowser.CategoryName.{name}");
     Items         = new List <Item>();
     SubCategories = new List <Category>();
     Sorts         = new Sort[0];
     this.belongs  = x => false;
 }
コード例 #29
0
ファイル: ItemBrowser.cs プロジェクト: NluzzG/HEROsMod
 public Category(string name, Predicate <Item> belongs, bool skipLocalization = false)
 {
     this.Name          = name;
     this.LocalizedName = skipLocalization ? name : HEROsMod.HeroText($"ItemBrowser.CategoryName.{name}");
     Items         = new List <Item>();
     SubCategories = new List <Category>();
     Sorts         = new Sort[0];
     this.belongs  = belongs;
 }
コード例 #30
0
ファイル: RegionService.cs プロジェクト: xPanini/HEROsMod
        public override void Update()
        {
            Vector2 mouseTile = ModUtils.CursorTileCoords;
            int     id        = 0;
            string  str       = string.Format(HEROsMod.HeroText("LastChangedBy"), id);

            UIView.HoverText = str;
            //ModUtils.MouseText(str);
            base.Update();
        }