Ejemplo n.º 1
0
    static int set_onValidate(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIInput            obj       = (UIInput)o;
            UIInput.OnValidate arg0      = null;
            LuaTypes           funcType2 = LuaDLL.lua_type(L, 2);

            if (funcType2 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (UIInput.OnValidate)ToLua.CheckObject(L, 2, typeof(UIInput.OnValidate));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 2);
                arg0 = DelegateFactory.CreateDelegate(typeof(UIInput.OnValidate), func) as UIInput.OnValidate;
            }

            obj.onValidate = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onValidate on a nil value" : e.Message));
        }
    }
Ejemplo n.º 2
0
 protected override void OnScreenLoaded()
 {
     base.OnScreenLoaded();
     base.GetElement <UXElement>("InputFieldRequestMessage").Visible    = !this.isWarRequest;
     base.GetElement <UXElement>("InputFieldRequestMessageWar").Visible = this.isWarRequest;
     this.requestNowCostLabel    = base.GetElement <UXLabel>("FinishCostLabel");
     this.requestLabel.Text      = this.lang.Get("REQUEST_TROOPS", new object[0]);
     this.requestPerksLabel.Text = this.requestLabel.Text;
     this.requestLabel.Visible   = true;
     this.troopsPanel.Visible    = true;
     this.troopsLabel.Visible    = true;
     this.troopsLabel.Text       = this.lang.Get("SQUAD_DONATED_TO_USER", new object[0]);
     if (this.isWarRequest)
     {
         this.input = base.GetElement <UXInput>("LabelInputNameSquadWar");
         UIInput uIInputComponent = this.input.GetUIInputComponent();
         UIInput arg_108_0        = uIInputComponent;
         if (SquadTroopRequestScreen.< > f__mg$cache0 == null)
         {
             SquadTroopRequestScreen.< > f__mg$cache0 = new UIInput.OnValidate(LangUtils.OnValidateWNewLines);
         }
         arg_108_0.onValidate = SquadTroopRequestScreen.< > f__mg$cache0;
         UXTexture element = base.GetElement <UXTexture>("TextureWarRequest");
         element.LoadTexture("squadwars_playerdetails_bg");
         Service.EventManager.RegisterObserver(this, EventId.CurrentPlayerMemberDataUpdated);
     }
     this.input.InitText(this.defaultRequestText);
     this.InitTroopGrid();
     this.UpdateRequestState();
 }
Ejemplo n.º 3
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;
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
    public static Delegate UIInput_OnValidate(LuaFunction func)
    {
        if (func == null)
        {
            UIInput.OnValidate fn = delegate { return('\0'); };
            return(fn);
        }

        UIInput.OnValidate d = (new UIInput_OnValidate_Event(func)).Call;
        return(d);
    }
Ejemplo n.º 6
0
 public static Delegate UIInput_OnValidate(LuaFunction func)
 {
     UIInput.OnValidate d = (param0, param1, param2) =>
     {
         int    top = func.BeginPCall();
         IntPtr L   = func.GetLuaState();
         LuaScriptMgr.Push(L, param0);
         LuaScriptMgr.Push(L, param1);
         LuaScriptMgr.Push(L, param2);
         func.PCall(top, 3);
         object[] objs = func.PopValues(top);
         func.EndPCall(top);
         return((char)objs[0]);
     };
     return(d);
 }
Ejemplo n.º 7
0
    static int get_onValidate(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIInput            obj = (UIInput)o;
            UIInput.OnValidate ret = obj.onValidate;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onValidate on a nil value" : e.Message));
        }
    }
Ejemplo n.º 8
0
    static int set_onValidate(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIInput            obj  = (UIInput)o;
            UIInput.OnValidate arg0 = (UIInput.OnValidate)ToLua.CheckDelegate <UIInput.OnValidate>(L, 2);
            obj.onValidate = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index onValidate on a nil value"));
        }
    }
Ejemplo n.º 9
0
    private static int get_onValidate(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            UIInput            uIInput    = (UIInput)obj;
            UIInput.OnValidate onValidate = uIInput.onValidate;
            ToLua.Push(L, onValidate);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index onValidate on a nil value");
        }
        return(result);
    }
Ejemplo n.º 10
0
        static internal int checkDelegate(IntPtr l, int p, out UIInput.OnValidate ua)
        {
            int op = extractFunction(l, p);

            if (LuaDLL.lua_isnil(l, p))
            {
                ua = null;
                return(op);
            }
            else if (LuaDLL.lua_isuserdata(l, p) == 1)
            {
                ua = (UIInput.OnValidate)checkObj(l, p);
                return(op);
            }
            LuaDelegate ld;

            checkType(l, -1, out ld);
            if (ld.d != null)
            {
                ua = (UIInput.OnValidate)ld.d;
                return(op);
            }
            LuaDLL.lua_pop(l, 1);

            l  = LuaState.get(l).L;
            ua = (string a1, int a2, System.Char a3) =>
            {
                int error = pushTry(l);

                pushValue(l, a1);
                pushValue(l, a2);
                pushValue(l, a3);
                ld.pcall(3, error);
                System.Char ret;
                checkType(l, error + 1, out ret);
                LuaDLL.lua_settop(l, error - 1);
                return(ret);
            };
            ld.d = ua;
            return(op);
        }
Ejemplo n.º 11
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.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();
            UIInput arg_17C_0 = this.inputScript;

            if (SetCallsignScreen.< > f__mg$cache0 == null)
            {
                SetCallsignScreen.< > f__mg$cache0 = new UIInput.OnValidate(LangUtils.OnValidate);
            }
            arg_17C_0.onValidate                = SetCallsignScreen.< > f__mg$cache0;
            this.inputScript.characterLimit     = GameConstants.USER_NAME_MAX_CHARACTERS;
            this.inputScript.label.maxLineCount = 1;
            EventDelegate item = new EventDelegate(new EventDelegate.Callback(this.OnSubmit));

            this.inputScript.onSubmit.Add(item);
            item = new EventDelegate(new EventDelegate.Callback(this.OnChange));
            this.inputScript.onChange.Add(item);
            this.inputTextField.Text = string.Empty;
        }
Ejemplo n.º 12
0
        internal static int checkDelegate(IntPtr l, int p, out UIInput.OnValidate ua)
        {
            int result = LuaObject.extractFunction(l, p);

            if (LuaDLL.pua_isnil(l, p))
            {
                ua = null;
                return(result);
            }
            if (LuaDLL.pua_isuserdata(l, p) == 1)
            {
                ua = (UIInput.OnValidate)LuaObject.checkObj(l, p);
                return(result);
            }
            LuaDelegate ld;

            LuaObject.checkType(l, -1, out ld);
            LuaDLL.pua_pop(l, 1);
            if (ld.d != null)
            {
                ua = (UIInput.OnValidate)ld.d;
                return(result);
            }
            l  = LuaState.get(l).L;
            ua = delegate(string a1, int a2, char a3)
            {
                int num = LuaObject.pushTry(l);
                LuaObject.pushValue(l, a1);
                LuaObject.pushValue(l, a2);
                LuaObject.pushValue(l, a3);
                ld.pcall(3, num);
                char result2;
                LuaObject.checkType(l, num + 1, out result2);
                LuaDLL.pua_settop(l, num - 1);
                return(result2);
            };
            ld.d = ua;
            return(result);
        }
Ejemplo n.º 13
0
    public static Delegate UIInput_OnValidate(LuaFunction func, LuaTable self, bool flag)
    {
        if (func == null)
        {
            UIInput.OnValidate fn = delegate(string param0, int param1, char param2) { return('\0'); };
            return(fn);
        }

        if (!flag)
        {
            UIInput_OnValidate_Event target = new UIInput_OnValidate_Event(func);
            UIInput.OnValidate       d      = target.Call;
            target.method = d.Method;
            return(d);
        }
        else
        {
            UIInput_OnValidate_Event target = new UIInput_OnValidate_Event(func, self);
            UIInput.OnValidate       d      = target.CallWithSelf;
            target.method = d.Method;
            return(d);
        }
    }
Ejemplo n.º 14
0
 public void setOnValidateCallback(UIInput.OnValidate validate)
 {
     mInput.onValidate = validate;
 }
Ejemplo n.º 15
0
        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();
            UIInput arg_77_0 = this.chatInputScript;

            if (SquadScreenChatInputView.< > f__mg$cache0 == null)
            {
                SquadScreenChatInputView.< > f__mg$cache0 = new UIInput.OnValidate(LangUtils.OnValidateWNewLines);
            }
            arg_77_0.onValidate = SquadScreenChatInputView.< > f__mg$cache0;
            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();
            UIInput arg_F8_0 = this.requestInputScript;

            if (SquadScreenChatInputView.< > f__mg$cache1 == null)
            {
                SquadScreenChatInputView.< > f__mg$cache1 = new UIInput.OnValidate(LangUtils.OnValidateWNewLines);
            }
            arg_F8_0.onValidate = SquadScreenChatInputView.< > f__mg$cache1;
            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();
            UIInput arg_185_0 = this.shareInputScript;

            if (SquadScreenChatInputView.< > f__mg$cache2 == null)
            {
                SquadScreenChatInputView.< > f__mg$cache2 = new UIInput.OnValidate(LangUtils.OnValidateWNewLines);
            }
            arg_185_0.onValidate = SquadScreenChatInputView.< > f__mg$cache2;
            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");
        }