Example #1
0
        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;
        }