Exemplo n.º 1
0
        private void InitSearch()
        {
            this.searchBtnOverlay           = base.GetElement <UXButton>("BtnSearchWindow");
            this.searchBtnOverlay.OnClicked = new UXButtonClickedDelegate(this.SearchClicked);
            this.searchBtnOverlay.Enabled   = false;
            UXLabel element = base.GetElement <UXLabel>("LabelBtnSearchWindow");

            element.Text                         = this.lang.Get("s_Search", new object[0]);
            this.searchInput                     = base.GetElement <UXInput>("LabelInputNameSquad");
            this.searchInstructionsLabel         = base.GetElement <UXLabel>("LabelSearchInstructions");
            this.searchInstructionsLabel.Text    = this.lang.Get("SEARCH_INSTRUCTIONS", new object[0]);
            this.searchInstructionsLabel.Visible = true;
            this.searchInput.Text                = string.Empty;
            this.searchInput.InitText(this.lang.Get("s_Search", new object[0]));
            UIInput uIInputComponent = this.searchInput.GetUIInputComponent();
            UIInput arg_106_0        = uIInputComponent;

            if (SquadJoinScreen.< > f__mg$cache0 == null)
            {
                SquadJoinScreen.< > f__mg$cache0 = new UIInput.OnValidate(LangUtils.OnValidateWSpaces);
            }
            arg_106_0.onValidate = SquadJoinScreen.< > f__mg$cache0;
            EventDelegate item = new EventDelegate(new EventDelegate.Callback(this.OnChange));

            uIInputComponent.onChange.Add(item);
        }
Exemplo n.º 2
0
        protected override void OnScreenLoaded()
        {
            base.GetElement <UXElement>("InputFieldRequestMessageWar").Visible = false;
            base.GetElement <UXElement>("TitleGroupPerks").Visible             = false;
            this.InitButtons();
            this.buttonLabel            = base.GetElement <UXLabel>("LabelBtnSend");
            this.buttonLabel.Text       = this.lang.Get("BUTTON_SEND", new object[0]);
            this.requestLabel           = base.GetElement <UXLabel>("LabelRequestTroops");
            this.troopsPanel            = base.GetElement <UXElement>("PanelCurrentTroops");
            this.troopsLabel            = base.GetElement <UXLabel>("LabelCurrentTroops");
            this.requestLabel.Visible   = false;
            this.troopsPanel.Visible    = false;
            this.troopsLabel.Visible    = false;
            this.instructionsLabel      = base.GetElement <UXLabel>("LabelTroopIncrement");
            this.requestPerksLabel      = base.GetElement <UXLabel>("LabelRequestTroopsPerks");
            this.instructionsPerksLabel = base.GetElement <UXLabel>("LabelTroopIncrementPerks");
            this.input = base.GetElement <UXInput>("LabelInputNameSquad");
            UIInput uIInputComponent = this.input.GetUIInputComponent();
            UIInput arg_11F_0        = uIInputComponent;

            if (AbstractSquadRequestScreen.< > f__mg$cache0 == null)
            {
                AbstractSquadRequestScreen.< > f__mg$cache0 = new UIInput.OnValidate(LangUtils.OnValidateWNewLines);
            }
            arg_11F_0.onValidate = AbstractSquadRequestScreen.< > f__mg$cache0;
        }
Exemplo n.º 3
0
        protected override void OnScreenLoaded()
        {
            this.errorLabel           = base.GetElement <UXLabel>("LabelError");
            this.errorLabel.Visible   = false;
            this.nextButton           = base.GetElement <UXButton>("BtnPrimary");
            this.nextButton.OnClicked = new UXButtonClickedDelegate(this.OnNextButton);
            FactionType faction = Service.Get <CurrentPlayer>().Faction;

            if (faction != FactionType.Empire)
            {
                if (faction == FactionType.Rebel)
                {
                    base.GetElement <UXLabel>("LabelTitle").Text = this.lang.Get("CALL_SIGN_TITLE_REBEL", new object[0]);
                }
            }
            else
            {
                base.GetElement <UXLabel>("LabelTitle").Text = this.lang.Get("CALL_SIGN_TITLE_EMPIRE", new object[0]);
            }
            base.GetElement <UXLabel>("LabelBody").Text       = this.lang.Get("CALL_SIGN_DESCRIPTION", new object[0]);
            base.GetElement <UXLabel>("LabelBtnPrimary").Text = this.lang.Get("s_Confirm", new object[0]);
            this.inputBackground = base.GetElement <UXSprite>("InputField");
            this.inputTextField  = base.GetElement <UXInput>("LabelInput");
            this.inputTextField.InitText(this.lang.Get("CALL_SIGN_TYPE_HERE", new object[0]));
            this.inputScript                    = this.inputTextField.GetUIInputComponent();
            this.inputScript.onValidate         = new UIInput.OnValidate(LangUtils.OnValidate);
            this.inputScript.characterLimit     = GameConstants.USER_NAME_MAX_CHARACTERS;
            this.inputScript.label.maxLineCount = 1;
            EventDelegate item = new EventDelegate(new EventDelegate.Callback(this.OnChange));

            this.inputScript.onChange.Add(item);
            this.inputTextField.Text = "";
        }
Exemplo n.º 4
0
 protected override void OnScreenLoaded()
 {
     this.labelInstructions = base.GetElement <UXLabel>("LabelInstructions");
     this.inputName         = base.GetElement <UXInput>("LabelInputNameSquad");
     this.inputDescription  = base.GetElement <UXInput>("LabelInputSquadDesc");
     this.InitButtons();
     this.InitScoreReqSelector();
     this.InitEnrollmentTypeSelector();
     this.InitSymbolSelector();
     if (this.showCreateView)
     {
         this.InitCreateView();
         return;
     }
     this.InitEditView();
 }
Exemplo n.º 5
0
        private UXInput CreateInput(GameObject gameObject, UIInput nguiInput)
        {
            UXInputComponent uXInputComponent = gameObject.GetComponent <UXInputComponent>();

            if (uXInputComponent != null)
            {
                uXInputComponent.Input = null;
                UnityEngine.Object.Destroy(uXInputComponent);
            }
            uXInputComponent           = gameObject.AddComponent <UXInputComponent>();
            uXInputComponent.NGUIInput = nguiInput;
            UXInput uXInput = new UXInput(this.uxCamera, uXInputComponent);

            uXInputComponent.Input = uXInput;
            this.AddElement(gameObject.name, uXInput);
            return(uXInput);
        }
        public override void OnScreenLoaded()
        {
            string initText = this.lang.Get("s_Chat", new object[0]) + "...";

            this.chatInputBox = this.screen.GetElement <UXInput>("LabelChatInput");
            this.chatInputBox.InitText(initText);
            this.chatInputScript                    = this.chatInputBox.GetUIInputComponent();
            this.chatInputScript.onValidate         = new UIInput.OnValidate(LangUtils.OnValidateWNewLines);
            this.chatInputScript.label.maxLineCount = 1;
            this.requestInputBox                    = this.screen.GetElement <UXInput>("LabelRequestInput");
            this.requestInputBox.InitText(this.lang.Get("REQUEST_TROOPS_DEFAULT", new object[0]));
            this.requestInputScript                    = this.requestInputBox.GetUIInputComponent();
            this.requestInputScript.onValidate         = new UIInput.OnValidate(LangUtils.OnValidateWNewLines);
            this.requestInputScript.label.maxLineCount = 1;
            this.defaultShareText = this.lang.Get("BATTLE_REPLAY_SHARE_DEFAULT", new object[0]);
            this.shareInputBox    = this.screen.GetElement <UXInput>("LabeShareReplayInput");
            this.shareInputBox.InitText(this.defaultShareText);
            this.shareInputScript                    = this.shareInputBox.GetUIInputComponent();
            this.shareInputScript.onValidate         = new UIInput.OnValidate(LangUtils.OnValidateWNewLines);
            this.shareInputScript.label.maxLineCount = 1;
            this.shareOppNameLabel                   = this.screen.GetElement <UXLabel>("LabelOpponentNameShare");
            this.shareTypeLabel          = this.screen.GetElement <UXLabel>("LabelReplayTypeShare");
            this.shareDamagePercentLabel = this.screen.GetElement <UXLabel>("LabelDamageShare");
            this.shareMedalsLabel        = this.screen.GetElement <UXLabel>("LabelReplayMedalsShare");
            this.share1StarSprite        = this.screen.GetElement <UXSprite>("SpriteStar1Share");
            this.share2StarSprite        = this.screen.GetElement <UXSprite>("SpriteStar2Share");
            this.share3StarSprite        = this.screen.GetElement <UXSprite>("SpriteStar3Share");
            UXButton element = this.screen.GetElement <UXButton>("BtnSendChat");

            element.OnClicked                    = new UXButtonClickedDelegate(this.OnChatMessageSend);
            this.requestTroopBtn                 = this.screen.GetElement <UXButton>("BtnRequestTroops");
            this.requestTroopBtn.OnClicked       = new UXButtonClickedDelegate(this.OnTroopRequestClicked);
            this.resendRequestTroopBtn           = this.screen.GetElement <UXButton>("BtnResendRequest");
            this.resendRequestTroopBtn.OnClicked = new UXButtonClickedDelegate(this.OnTroopRequestClicked);
            this.resendRequestTroopCostLabel     = this.screen.GetElement <UXLabel>("LabelBtnBtnResendRequestCost");
            this.shareReplayButton               = this.screen.GetElement <UXButton>("BtnShareReplay");
            this.shareReplayButton.OnClicked     = new UXButtonClickedDelegate(this.OnShareReplayClicked);
            this.inputModeChat                   = this.screen.GetElement <UXElement>("ChatInput");
            this.inputModeShare                  = this.screen.GetElement <UXElement>("ChatInputShare");
            this.inputModeRequest                = this.screen.GetElement <UXElement>("RequestInput");
            this.chatPanel     = this.screen.GetElement <UXElement>("ChatPanel");
            this.chatItemTable = this.screen.GetElement <UXTable>("ChatTable");
        }
Exemplo n.º 7
0
        protected override void OnScreenLoaded()
        {
            this.CloseButton           = base.GetElement <UXButton>("MakerButtonCloseShare");
            this.CloseButton.OnClicked = new UXButtonClickedDelegate(this.OnCloseButtonClicked);
            this.CloseButton.Enabled   = true;
            base.CurrentBackButton     = this.CloseButton;
            this.sendButton            = base.GetElement <UXButton>("MakerButtonSendShare");
            this.sendButton.OnClicked  = new UXButtonClickedDelegate(this.SendRequestClicked);
            UXLabel element = base.GetElement <UXLabel>("MakerLabelSendShare");

            element.Text           = this.lang.Get("BUTTON_SEND", new object[0]);
            this.requestLabel      = base.GetElement <UXLabel>("MakerLabelTitleShare");
            this.requestLabel.Text = this.lang.Get("hn_ui_squad_share", new object[0]);
            this.inputBox          = base.GetElement <UXInput>("MakerLabelInputMessageShare");
            this.inputBox.InitText(this.lang.Get("hn_ui_share_text", new object[0]));
            this.nguiInputBox = this.inputBox.GetUIInputComponent();
            if (this.nguiInputBox != null)
            {
                this.nguiInputBox.onValidate = new UIInput.OnValidate(LangUtils.OnValidateWNewLines);
                EventDelegate item = new EventDelegate(new EventDelegate.Callback(this.OnSubmit));
                this.nguiInputBox.onSubmit.Add(item);
                this.nguiInputBox.enabled = true;
            }
            base.GetElement <UXLabel>("MakerLabelVideoCreatorShare").Text = "";
            base.GetElement <UXLabel>("MakerLabelVideoTitleShare").Text   = "";
            Service.Get <UserInputManager>().RegisterObserver(this, UserInputLayer.Screen);
            Service.Get <VideoDataManager>().GetVideoDetails(this.videoId, delegate(string guid)
            {
                VideoData videoData = Service.Get <VideoDataManager>().VideoDatas[guid];
                if (videoData == null)
                {
                    return;
                }
                base.GetElement <UXLabel>("MakerLabelVideoCreatorShare").Text = (string.IsNullOrEmpty(videoData.Author) ? "" : this.lang.Get("hn_ui_author", new object[]
                {
                    videoData.Author
                }));
                base.GetElement <UXLabel>("MakerLabelVideoTitleShare").Text = videoData.Title;
            });
        }