コード例 #1
0
        protected override void InitButtons()
        {
            base.InitButtons();
            this.buttonLoad              = base.GetElement <UXButton>("BtnLoad");
            this.buttonOk                = base.GetElement <UXButton>("BtnOk");
            this.buttonCancel            = base.GetElement <UXButton>("BtnCancel");
            this.buttonConnectNew        = base.GetElement <UXButton>("BtnConnectNew");
            this.buttonConnectNewConfirm = base.GetElement <UXButton>("BtnConnectNewConfirm");
            UserInputInhibitor userInputInhibitor = Service.Get <UserInputInhibitor>();

            if (userInputInhibitor != null)
            {
                userInputInhibitor.AlwaysAllowElement(this.CloseButton);
                userInputInhibitor.AlwaysAllowElement(this.buttonLoad);
                userInputInhibitor.AlwaysAllowElement(this.buttonOk);
                userInputInhibitor.AlwaysAllowElement(this.buttonCancel);
                userInputInhibitor.AlwaysAllowElement(this.buttonConnectNew);
                userInputInhibitor.AlwaysAllowElement(this.buttonConnectNewConfirm);
            }
            base.GetElement <UXLabel>("LabelBtnOk").Text             = this.lang.Get("s_Ok", new object[0]);
            base.GetElement <UXLabel>("LabelBtnLoad").Text           = this.lang.Get("ACCOUNT_SYNC_LOAD", new object[0]);
            base.GetElement <UXLabel>("LabelBtnCancel").Text         = this.lang.Get("s_Cancel", new object[0]);
            base.GetElement <UXLabel>("LabelConnectNew").Text        = this.lang.Get("ACCOUNT_SYNC_CONNECT_NEW_GAME", new object[0]);
            base.GetElement <UXLabel>("LabelConnectNewConfirm").Text = this.lang.Get("ACCOUNT_SYNC_CONNECT_NEW_GAME", new object[0]);
            this.ShowSyncConflict();
        }
コード例 #2
0
 public UXCheckbox(UXCamera uxCamera, UXCheckboxComponent component) : base(uxCamera, component.gameObject, component.NGUIButton)
 {
     this.component  = component;
     this.inhibitor  = Service.Get <UserInputInhibitor>();
     this.radioGroup = this.RadioGroup;
     this.OnSelected = null;
 }
コード例 #3
0
        public override void Execute()
        {
            base.Execute();
            string elementName  = this.prepareArgs[0];
            string elementName2 = this.prepareArgs[1];
            int    num;

            int.TryParse(this.prepareArgs[2], out num);
            int num2;

            int.TryParse(this.prepareArgs[3], out num2);
            this.dismissButton = Service.ScreenController.FindElement <UXButton>(elementName2);
            if (this.dismissButton == null)
            {
                this.parent.ChildComplete(this);
                return;
            }
            this.grid = Service.ScreenController.FindElement <UXGrid>(elementName);
            if (this.grid == null)
            {
                Service.Logger.ErrorFormat("The StoryAction {0} has an incorrect number of arguments: {1}, wrong name used.story action requires grid.", new object[]
                {
                    this.vo.Uid,
                    this.vo.PrepareString
                });
                this.parent.ChildComplete(this);
                return;
            }
            UserInputInhibitor userInputInhibitor = Service.UserInputInhibitor;

            userInputInhibitor.DenyAll();
            List <UXElement> list = new List <UXElement>();

            list.AddRange(this.grid.GetElementList());
            list.Add(this.dismissButton);
            int i     = 0;
            int count = list.Count;

            while (i < count)
            {
                userInputInhibitor.AddToAllow(list[i]);
                i++;
            }
            NavigationCenterUpgradeScreen highestLevelScreen = Service.ScreenController.GetHighestLevelScreen <NavigationCenterUpgradeScreen>();

            if (highestLevelScreen != null)
            {
                highestLevelScreen.ActivateHighlight();
            }
        }
コード例 #4
0
 public UXButton(UXCamera uxCamera, UXButtonComponent component) : base(uxCamera, component.gameObject, component.NGUIButton)
 {
     this.component        = component;
     this.OnClicked        = null;
     this.OnPressed        = null;
     this.OnReleased       = null;
     this.NGUIButton       = component.NGUIButton;
     this.VisuallyDisabled = false;
     if (this.NGUIButton != null)
     {
         this.defaultButtonColor = this.NGUIButton.defaultColor;
     }
     this.inhibitor = ((Service.UserInputInhibitor == null) ? null : Service.UserInputInhibitor);
 }
コード例 #5
0
ファイル: UXButton.cs プロジェクト: Hengle/swc-decompiled
 public UXButton(UXCamera uxCamera, UXButtonComponent component)
 {
     this.defaultButtonColor = new Color(255f, 255f, 255f, 1f);
     base..ctor(uxCamera, component.gameObject, component.NGUIButton);
     this.component        = component;
     this.OnClicked        = null;
     this.OnPressed        = null;
     this.OnReleased       = null;
     this.NGUIButton       = component.NGUIButton;
     this.VisuallyDisabled = false;
     if (this.NGUIButton != null)
     {
         this.defaultButtonColor = this.NGUIButton.defaultColor;
     }
     this.inhibitor = (Service.IsSet <UserInputInhibitor>() ? Service.Get <UserInputInhibitor>() : null);
 }
コード例 #6
0
        public BuildingMover(BuildingSelector buildingSelector)
        {
            this.buildingSelector      = buildingSelector;
            this.lifted                = false;
            this.canOccupy             = false;
            this.prevValidBoardAnchorX = new Dictionary <Entity, int>();
            this.prevValidBoardAnchorZ = new Dictionary <Entity, int>();
            this.prevBoardAnchorX      = new Dictionary <Entity, int>();
            this.prevBoardAnchorZ      = new Dictionary <Entity, int>();
            this.pressScreenPosition   = Vector2.zero;
            this.dragged               = false;
            this.pressedBuilding       = null;
            this.moved = false;
            this.buildingController = Service.BuildingController;
            this.worldView          = Service.WorldInitializer.View;
            EventManager eventManager = Service.EventManager;

            eventManager.RegisterObserver(this, EventId.BuildingViewReady, EventPriority.Default);
            eventManager.RegisterObserver(this, EventId.GameStateChanged, EventPriority.Default);
            eventManager.RegisterObserver(this, EventId.UserWantedEditBaseState, EventPriority.Default);
            this.inhibitor = Service.UserInputInhibitor;
        }