コード例 #1
0
ファイル: SMSideBar.cs プロジェクト: huokele/shadow-gun
    // =========================================================================================================================
    protected override void OnViewInit()
    {
        base.OnViewInit();

        m_ScreenLayout = GetLayout("IngameMenu", "SMSideButtons_Layout");

        // prepare screen widgets...
        m_EquipButton   = PrepareButton(m_ScreenLayout, "Equip_Button", ShowEquip, null);
        m_FriendsButton = PrepareButton(m_ScreenLayout, "Friends_Button", ShowFriend, null);
        m_GameButton    = PrepareButton(m_ScreenLayout, "Game_Button", ShowGame, null);
        m_ShopButton    = PrepareButton(m_ScreenLayout, "Shop_Button", ShowShop, null);
        m_StatsButton   = PrepareButton(m_ScreenLayout, "Stats_Button", ShowStats, null);

        m_EquipButton.autoColorLabels   = true;
        m_FriendsButton.autoColorLabels = true;
        m_GameButton.autoColorLabels    = true;
        m_ShopButton.autoColorLabels    = true;
        m_StatsButton.autoColorLabels   = true;

        m_EquipButton.stayDown   = true;
        m_FriendsButton.stayDown = true;
        m_GameButton.stayDown    = true;
        m_ShopButton.stayDown    = true;
        m_StatsButton.stayDown   = true;
    }
コード例 #2
0
    // PRIVATE METHODS

    void SelectAccount(int newAcctType, bool force)
    {
        // always store requested account type as pending
        m_PendingAcct = newAcctType;

        if (newAcctType == m_SelectedAcct && force == false)
        {
            return;
        }
        m_SelectedAcct = newAcctType;

        for (int idx = 0; idx < MAX_TYPES; ++idx)
        {
            int            acctType = idx + 1;
            GUIBase_Button button   = GuiBaseUtils.GetControl <GUIBase_Button>(Layout, TYPE_BUTTON + acctType);
            button.ForceHighlight(m_SelectedAcct == acctType ? true : false);
        }

        //GuiBaseUtils.GetControl<GUIBase_Button>(Layout, BUY_BUTTON).SetDisabled(m_SelectedAcct < 0 ? true : false);

        /*if (m_SelectedAcct < 0)
         * {
         *      InvokeRepeating("BlinkGoldButtons", 1.0f, 1.0f);
         * }
         * else
         * {
         *      CancelInvoke("BlinkGoldButtons");
         * }*/

        //StopCoroutine("BlinkBuyButton_Coroutine");
        //StartCoroutine("BlinkBuyButton_Coroutine");
    }
コード例 #3
0
    //---------------------------------------------------------
    public void RegisterButtonTouchDelegate(string widgetID, GUIBase_Button.TouchDelegate f)
    {
        if (m_Initialized == false)
        {
            LateInit();
        }

        if (m_Elements != null)
        {
            foreach (GUIBase_Element element in m_Elements)
            {
                if (element.name == widgetID)
                {
                    GUIBase_Button button = element.GetComponent <GUIBase_Button>();

                    if (button != null)
                    {
                        button.RegisterTouchDelegate(f);
                    }

                    return;
                }
            }
        }
    }
コード例 #4
0
    void Delegate_Password(GUIBase_Widget inInstigator)
    {
        //Debug.Log("Delegate_Password: "******"Internal error. Interaction has to be disabled if Keyboard is active");
            return;
        }

        GUIBase_Button button = inInstigator.GetComponent <GUIBase_Button>();

        if (button == null)
        {
            Debug.LogError("Internal error !!! ");
            return;
        }

        if (m_PasswordHash == s_DefaultPasswordText || string.IsNullOrEmpty(m_PasswordButton.TextFieldText))
        {
            m_PasswordButton.TextFieldText = string.Empty;
            Delegate_OnKeyboardClose(m_PasswordButton, string.Empty, false);
        }

#if !UNITY_EDITOR && (UNITY_IPHONE || UNITY_ANDROID)
        // TODO move pLace holder into text database
        ShowKeyboard(button, GuiScreen.E_KeyBoardMode.Password, Delegate_OnKeyboardClose, string.Empty, "Enter password");
#endif
    }
コード例 #5
0
ファイル: GuiPopupPromote.cs プロジェクト: huokele/shadow-gun
    // GUIVIEW INTERFACE

    protected override void OnViewInit()
    {
        base.OnViewInit();
        m_CloseButton    = GuiBaseUtils.GetControl <GUIBase_Button>(Layout, CLOSE_BUTTON);
        m_FacebookButton = GuiBaseUtils.GetControl <GUIBase_Button>(Layout, FACEBOOK_BUTTON);
        m_TwitterButton  = GuiBaseUtils.GetControl <GUIBase_Button>(Layout, TWITTER_BUTTON);
    }
コード例 #6
0
ファイル: FriendListView.cs プロジェクト: huokele/shadow-gun
        public FriendLine(GUIBase_Widget inLine)
        {
            Transform trans = inLine.transform;

            m_Line         = inLine;
            m_Nickname     = trans.GetChildComponent <GUIBase_Label>("Username");        // display nickaname first
            m_Username     = trans.GetChildComponent <GUIBase_Label>("Nickname");        // display nickaname second
            m_RankText     = trans.GetChildComponent <GUIBase_Label>("TextRank");
            m_RankIcon     = trans.GetChildComponent <GUIBase_MultiSprite>("PlayerRankPic");
            m_Missions     = trans.GetChildComponent <GUIBase_Label>("Missions");
            m_Online       = trans.GetChildComponent <GUIBase_Label>("OnlineStatus");
            m_Stats        = trans.GetChildComponent <GUIBase_Button>("Stats_Button");
            m_Mail         = trans.GetChildComponent <GUIBase_Button>("SendMail_Button");
            m_Chat         = trans.GetChildComponent <GUIBase_Button>("Chat_Button");
            m_Remove       = trans.GetChildComponent <GUIBase_Button>("Remove_Button");
            m_FacebookName = trans.GetChildComponent <GUIBase_Label>("FacebookName");
            m_FacebookIcon = trans.GetChildComponent <GUIBase_Widget>("FacebookIcon");

            m_Stats.IsDisabled = GuiFrontendIngame.IsVisible;
            m_Mail.IsDisabled  = GuiFrontendIngame.IsVisible;
            m_Chat.IsDisabled  = true;

            m_Stats.RegisterTouchDelegate(Delegate_Stats);
            m_Mail.RegisterTouchDelegate(Delegate_SendMail);
            m_Chat.RegisterTouchDelegate(Delegate_Chat);
            m_Remove.RegisterTouchDelegate(Delegate_Remove);
        }
コード例 #7
0
    // =================================================================================================================

    protected override void OnViewInit()
    {
        base.OnViewInit();

        m_Button_Overall = PrepareButton("01_Button", null, OnSelectLeaderBoard, true, true);
        m_Button_Friends = PrepareButton("04_Button", null, OnSelectLeaderBoard, true, true);

        m_Button_Day  = PrepareButton("02_Button", null, OnSelectLeaderBoard, true, true);
        m_Button_Week = PrepareButton("03_Button", null, OnSelectLeaderBoard, true, true);

        m_LeaderBoard_Overall = new LeaderBoard("Default", 8);
        m_LeaderBoard_Day     = new LeaderBoard("Daily", 8);
        m_LeaderBoard_Week    = new LeaderBoard("Default", 8);
        m_LeaderBoard_Friends = new LeaderBoardFriends("Default", 8);

//      m_LeaderBoard_Overall = new LeaderBoard("Overall", 8);
//		m_LeaderBoard_Day     = new LeaderBoard("Day"    , 8);
//      m_LeaderBoard_Week    = new LeaderBoard("Week"   , 8);
//		m_LeaderBoard_Friends = new LeaderBoard("Friends", 8);

        // initialize view
        {
            GUIBase_Layout l    = GetLayout("MainMenu", "LeaderBoards_Layout");
            GUIBase_List   list = GetWidget(l, "Table").GetComponent <GUIBase_List>();

            m_LeaderBoardView = gameObject.AddComponent <LeaderBoardListView>();
            m_LeaderBoardView.GUIView_Init(l, list);
        }
    }
コード例 #8
0
    protected override bool OnInit()
    {
        if (base.OnInit() == false)
        {
            return(false);
        }

        GUIBase_Layout layout = MFGuiManager.Instance.GetLayout(LAYOUT);

        if (layout == null)
        {
            return(false);
        }

        m_Root = layout.GetWidget(ROOT);
        if (m_Root == null)
        {
            return(false);
        }

        GUIBase_Widget[] widgets = m_Root.GetComponentsInChildren <GUIBase_Widget>();
        for (int idx = 0; idx < (int)E_CommandID.Max; ++idx)
        {
            GUIBase_Widget widget = GetWidget(ITEMS[idx], ref widgets);
            widget.Show(false, true);
            m_Items[idx] = widget;
        }

        if (GuiHUD.ControledByTouchScreen())
        {
            m_Menu = GetWidget(MENU, ref widgets).GetComponent <GUIBase_Button>();
        }

        return(true);
    }
コード例 #9
0
    void Delegate_UserName(GUIBase_Widget inInstigator)
    {
        //Debug.Log("Delegate_UserName: "******"Internal error. Interaction has to be disabled if Keyboard is active");
            return;
        }

        GUIBase_Button button = inInstigator.GetComponent <GUIBase_Button>();

        if (button == null)
        {
            Debug.LogError("Internal error !!! ");
            return;
        }

        if (m_UserName == s_DefaultUserNameText)
        {
            m_UserNameButton.TextFieldText = string.Empty;
            Delegate_OnKeyboardClose(m_UserNameButton, string.Empty, false);
        }

#if !UNITY_EDITOR && (UNITY_IPHONE || UNITY_ANDROID)
        // TODO move pLace holder into text database
        string default_text = (m_UserName != s_DefaultUserNameText) ? m_UserName : string.Empty;
        ShowKeyboard(button, GuiScreen.E_KeyBoardMode.Default, Delegate_OnKeyboardClose, default_text, "Enter username");
#endif
    }
コード例 #10
0
    //private string                                m_FriendName = string.Empty;

    // =========================================================================================================================
    // === GuiScreen interface ============================================================================================
    protected override void OnViewInit()
    {
        base.OnViewInit();

        m_ScreenPivot  = GetPivot("Statistics_Screen");
        m_ScreenLayout = GetLayout("Statistics_Screen", "Statistics_Layout");

        PrepareButton(m_ScreenLayout, "03_SelectFriend_Button", null, OnSelectFriend);

        GUIBase_Button prevButton = PrepareButton(m_ScreenLayout, "Prev_Button", null, null);
        GUIBase_Button nextButton = PrepareButton(m_ScreenLayout, "Next_Button", null, null);

        prevButton.autoColorLabels = true;
        nextButton.autoColorLabels = true;

        GUIBase_List list = GetWidget(m_ScreenLayout, "Table").GetComponent <GUIBase_List>();

        m_StatisticsView = gameObject.AddComponent <StatisticsView>();
        m_StatisticsView.GUIView_Init(m_ScreenLayout, list, prevButton, nextButton);

        GUIBase_Widget header = GetWidget(m_ScreenLayout, "Header");

        m_SelectFriends = header.transform.GetChildComponent <GUIBase_Button>("03_SelectFriend_Button");
        m_SelectFriends.autoColorLabels = true;
        m_FriendNameLabel = header.transform.GetChildComponent <GUIBase_Label>("04_friend_name");
    }
コード例 #11
0
    //PRIVATE METHODS

    void UpdateList()
    {
        if (OnUpdateRow == null)
        {
            return;
        }

        for (int idx = 0; idx < m_Lines.Length; ++idx)
        {
            OnUpdateRow(GetWidgetOnLine(idx), idx, m_ItemOffset + idx);
        }

        GUIBase_Button btnUp   = m_ButtonUp;
        GUIBase_Button btnDown = m_ButtonDown;

        if (m_IsReversed)
        {
            btnUp   = m_ButtonDown;
            btnDown = m_ButtonUp;
        }

        if (btnUp != null)
        {
            btnUp.Widget.Show(m_ItemOffset > 0 ? true : false, true);
        }

        if (btnDown != null)
        {
            btnDown.Widget.Show(m_ItemOffset < Mathf.Max(0, m_MaxItems - m_NumOfLines) ? true : false, true);
        }
    }
コード例 #12
0
    protected override void OnViewShow()
    {
        base.OnViewShow();

        m_ButtonOK = RegisterButtonDelegate("OK_Button", () => { SendResult(E_PopupResultCode.Ok); }, null);

        RegisterButtonDelegate("Skip_Button", () => { SendResult(E_PopupResultCode.Cancel); }, null);

        m_EmailButton = RegisterButtonDelegate("Email_Button",
                                               () =>
        {
#if !UNITY_EDITOR && (UNITY_IPHONE || UNITY_ANDROID)
            ShowKeyboard(m_EmailButton, GuiScreen.E_KeyBoardMode.Email, OnKeyboardClose, m_Email, TextDatabase.instance[0103041]);
#endif
        },
                                               null);

        AddTextField(m_EmailButton, OnKeyboardClose);

        m_HintLabel = GuiBaseUtils.GetControl <GUIBase_Label>(Layout, "Hint_Label");
        m_HintLabel.SetNewText("");

        m_ReceiveNewsSwitch = GuiBaseUtils.RegisterSwitchDelegate(Layout, "WantNews_Switch", (switchValue) => { m_ReceiveNews = switchValue; });

        CheckEmailValidity();
    }
コード例 #13
0
    protected override void OnViewShow()
    {
        UserPPI = UserPPI ?? PPIManager.Instance.GetLocalPPI();

        base.OnViewShow();

        // bind buttons
        for (int idx = 0; idx < m_Buttons.Length; ++idx)
        {
            int pageId = idx;
            GuiBaseUtils.RegisterButtonDelegate(m_Buttons[idx],
                                                null,
                                                (inside) =>
            {
                if (inside == true)
                {
                    GotoPage(pageId);
                }
            });
        }

        GUIBase_Button prevButton = RegisterButtonDelegate(USERNAMEPREV, () => { SwitchPPI(-1); }, null);

        prevButton.Widget.Show(UserPPIs != null && UserPPIs.Length > 1 ? true : false, true);

        GUIBase_Button nextButton = RegisterButtonDelegate(USERNAMENEXT, () => { SwitchPPI(+1); }, null);

        nextButton.Widget.Show(UserPPIs != null && UserPPIs.Length > 1 ? true : false, true);

        Refresh();
    }
コード例 #14
0
    // GUICOMPONENT INTERFACE

    protected override bool OnInit()
    {
        if (base.OnInit() == false)
        {
            return(false);
        }

        // get controls
        m_RowsContainer  = Owner.Layout.GetWidget(ROWS_CONTAINER);
        m_SendButton     = GuiBaseUtils.GetControl <GUIBase_Button>(Owner.Layout, SEND_BUTTON, false);
        m_MessageButton  = GuiBaseUtils.GetControl <GUIBase_Button>(Owner.Layout, MESSAGE_BUTTON, false);
        m_ClearButton    = GuiBaseUtils.GetControl <GUIBase_Button>(Owner.Layout, CLEAR_BUTTON, false);
        m_ScrollingTable = GuiBaseUtils.GetControl <GUIBase_List>(Owner.Layout, "Table", false);
        if (m_ScrollingTable != null)
        {
            m_ScrollingTable.numOfLines = MAX_ROWS;
            m_ScrollingTable.MaxItems   = MAX_MESSAGES;
            m_ScrollingTable.Widget.SetModify();
        }

        // prepare rows
        PrepareRows();

        Owner.AddTextField(m_MessageButton, Delegate_OnKeyboardClose, null, MAX_MESSAGE_LENGTH);

        // done
        return(true);
    }
コード例 #15
0
        // when scrollbar is present, it catches all of the mouse/touch callbacks
        // following two methods will simulate the necessary callbacks
        public void ProcessMouseMovement(MouseEvent mouseEvent)
        {
            if (m_Buttons == null)
            {
                return;
            }

            if (m_HoverButton != null)
            {
                if (m_HoverButton.Widget.IsMouseOver(mouseEvent.Position))
                {
                    return;
                }
                else
                {
                    m_HoverButton.Callback(GUIBase_Callback.E_CallbackType.E_CT_ON_MOUSEOVER_END, mouseEvent);
                    m_HoverButton = null;
                }
            }

            foreach (GUIBase_Button btn in m_Buttons)
            {
                if (btn.Widget.IsMouseOver(mouseEvent.Position))
                {
                    m_HoverButton = btn;
                    m_HoverButton.Callback(GUIBase_Callback.E_CallbackType.E_CT_ON_MOUSEOVER_BEGIN, mouseEvent);
                    return;
                }
            }
        }
コード例 #16
0
    // GUIOVERLAYSIDEBAR INTERFACE

    protected override bool ShouldDisableButton(GUIBase_Button button)
    {
        if (button.name != "Spawn_Button")
        {
            return(false);
        }

        bool buttonDisabled = true;

        if (Client.Instance != null)
        {
            switch (Client.Instance.GameState.GameType)
            {
            case E_MPGameType.DeathMatch:
                buttonDisabled = Client.TimeToRespawn > Client.Instance.GameState.DMInfo.RestTimeSeconds ? true : false;
                break;

            case E_MPGameType.ZoneControl:
                PlayerPersistantInfo localPPI = PPIManager.Instance.GetLocalPPI();
                buttonDisabled = (localPPI.Team == E_Team.None) || (localPPI.ZoneIndex < 0);
                break;

            default:
                Debug.LogError("Unknown Game Type ");
                break;
            }
        }

        return(buttonDisabled);
    }
コード例 #17
0
    bool ShowTouchScreenKeyboard(GUIBase_Button inInput,
                                 E_KeyBoardMode inMode,
                                 KeyboardClose inCloseDelegate,
                                 string inText,
                                 string inPlaceholder,
                                 int inMaxTextLength)
    {
        if (m_ActiveInput != null || inInput == null || inCloseDelegate == null)
        {
            return(false);
        }

        /// setup arguments for Touch keyboard...
        TouchScreenKeyboardType keyboardType = inMode == E_KeyBoardMode.Email
                                                                                                                           ? TouchScreenKeyboardType.EmailAddress
                                                                                                                           : inMode == E_KeyBoardMode.Password
                                                                                                                                                                 ? TouchScreenKeyboardType.Default
                                                                                                                                                                 : TouchScreenKeyboardType.ASCIICapable;

        bool autocorrection = false;         //inMode != E_KeyBoardMode.Password;
        bool secure         = inMode == E_KeyBoardMode.Password;

        // open keyboard...
        TouchScreenKeyboard keyboard = TouchScreenKeyboard.Open(inText, keyboardType, autocorrection, false, secure, false, inPlaceholder);

        if (keyboard == null)
        {
            return(false);
        }

        m_ActiveInput = inInput;
        StartCoroutine(ProcessKeyboardInput(keyboard, inCloseDelegate, inText, inMaxTextLength));
        return(true);
    }
コード例 #18
0
    // -----
    protected override void OnViewInit()
    {
        base.OnViewInit();

        if (m_ScreenLayout == null)
        {
            Debug.LogError("GuiConfirmDialog<" + name + "> :: There is not any layout specified for dialog!");
            return;
        }

        GUIBase_Button.TouchDelegate[] upgradeDlgts = new GUIBase_Button.TouchDelegate[]
        { Upgrade1Touch, Upgrade2Touch, Upgrade3Touch, Upgrade4Touch };

        for (int i = 0; i < ResearchItem.MAX_PARAMS; i++)
        {
            m_Params[i]         = new Param();
            m_Params[i].Parent  = GuiBaseUtils.GetChild <GUIBase_Widget>(Layout, "Param" + (i + 1));
            m_Params[i].OrigPos = m_Params[i].Parent.transform.localPosition;
            m_Params[i].Name    = GuiBaseUtils.GetChildLabel(m_Params[i].Parent, "ParamName");
            m_Params[i].Value   = GuiBaseUtils.GetChildLabel(m_Params[i].Parent, "ParamValue");
        }

        m_UpgradeArea = GetWidget(Layout, "Upgrade_Area").GetComponent <GUIBase_Widget>();
        for (int i = 0; i < ResearchItem.MAX_UPGRADES; i++)
        {
            GUIBase_Widget parent = GuiBaseUtils.GetChild <GUIBase_Widget>(m_UpgradeArea, "Upgrade" + (i + 1));
            m_Upgrades[i].m_Parent = parent;
            m_Upgrades[i].m_UpgradeIcon.Relink(parent);
            m_Upgrades[i].m_Button = GuiBaseUtils.GetChild <GUIBase_Button>(parent, "Button");
            m_Upgrades[i].m_Button.RegisterTouchDelegate(upgradeDlgts[i]);
            m_Upgrades[i].m_CostGold   = GuiBaseUtils.GetChild <GUIBase_Widget>(parent, "CostGold");
            m_Upgrades[i].m_CostMoney  = GuiBaseUtils.GetChild <GUIBase_Widget>(parent, "CostMoney");
            m_Upgrades[i].m_CostVal    = GuiBaseUtils.GetChild <GUIBase_Label>(parent, "CostVal");
            m_Upgrades[i].m_Name       = GuiBaseUtils.GetChild <GUIBase_Label>(parent, "Name");
            m_Upgrades[i].m_Researched = GuiBaseUtils.GetChild <GUIBase_Widget>(parent, "Researched");
        }

        m_ResearchButton = PrepareButton(m_ScreenLayout, "Research_Button", null, Delegate_Research);
        PrepareButton(m_ScreenLayout, "Close_Button", null, Delegate_Close);
        PrepareButton(m_ScreenLayout,
                      "Funds_Button",
                      null,
                      (widget) =>
        {
            if (BuildInfo.Version.Stage != BuildInfo.Stage.Beta)
            {
                IViewOwner owner = Owner;
                owner.Back();
                owner.ShowScreen("Shop:3");
            }
        });

        m_Name        = PrepareLabel(m_ScreenLayout, "Name");
        m_Explanation = PrepareTextArea(m_ScreenLayout, "Explanation");
        m_Description = PrepareTextArea(m_ScreenLayout, "Description");
        m_Price       = PrepareLabel(m_ScreenLayout, "Price");
        m_PriceArea   = GetWidget(Layout, "Price_Area").GetComponent <GUIBase_Widget>();
        m_Image       = GetWidget(Layout, "Image").GetComponent <GUIBase_Sprite>();
    }
コード例 #19
0
 public bool ShowKeyboard(GUIBase_Button inInput,
                          E_KeyBoardMode inMode,
                          KeyboardClose inCloseDelegate,
                          string inText,
                          int inMaxTextLength = -1)
 {
     return(ShowKeyboard(inInput, inMode, inCloseDelegate, inText, string.Empty, inMaxTextLength));
 }
コード例 #20
0
    // =========================================================================================================================
    // === public interface ====================================================================================================
    public void GUIView_Init(GUIBase_Layout inView, GUIBase_List inList, GUIBase_Button inPrev, GUIBase_Button inNext)
    {
        m_View       = inView;
        m_PrevButton = inPrev;
        m_NextButton = inNext;

        InitGuiLines(inList);
    }
コード例 #21
0
        public void Update(Chat.Message message)
        {
            Id = message.Id;

            if (m_Name != null)
            {
                m_Name.SetNewText(GuiBaseUtils.FixNameForGui(message.Nickname));
            }

            if (m_Text != null)
            {
                m_Text.SetNewText(m_Name == null ? string.Format("{0}: {1}", GuiBaseUtils.FixNameForGui(message.Nickname), message.Text) : message.Text);

                Transform trans = m_Text.transform;
                Vector3   scale = trans.localScale;
                m_Rect.width  = Mathf.RoundToInt(m_Text.textSize.x * scale.x);
                m_Rect.height = Mathf.RoundToInt(m_Text.textSize.y * scale.y);
            }

            if (m_RankIcon != null)
            {
                m_RankIcon.State = string.Format("Rank_{0}", Mathf.Min(message.Rank, m_RankIcon.Count - 1).ToString("D2"));
            }

            if (m_RankText != null)
            {
                m_RankText.SetNewText(message.Rank.ToString());
            }

            if (m_HighlightBkg != null)
            {
                Vector2   pos    = m_HighlightBkg.GetOrigPos();
                Transform trans  = m_HighlightBkg.transform;
                Vector3   scale  = trans.lossyScale;
                int       offset = Mathf.RoundToInt(pos.y - m_Root.GetOrigPos().y);
                int       width  = Mathf.RoundToInt(m_HighlightBkg.GetWidth());
                int       height = (int)m_Rect.height + 4;

                offset -= offset - Mathf.RoundToInt(m_HighlightBkg.GetHeight() * 0.5f * scale.y);
                pos.y   = pos.y - offset + height * 0.5f * scale.y;

                m_HighlightBkg.UpdateSpritePosAndSize(0, pos.x, pos.y, width, height);

                m_Rect.width = Mathf.RoundToInt(width * scale.x);
                //m_Rect.height = Mathf.RoundToInt(height * scale.y);
            }

            foreach (var button in m_Buttons)
            {
                Transform trans = button.transform;
                Vector3   pos   = trans.localPosition;

                pos.y = m_Rect.height * 0.5f;
                trans.localPosition = pos;
            }

            m_HoverButton = null;
        }
コード例 #22
0
    // ------
    protected override void OnViewInit()
    {
        base.OnViewInit();

        m_AcceptButton = GuiBaseUtils.GetButton(Layout, "Accept_Button");
        GuiBaseUtils.RegisterButtonDelegate(Layout, "Back_Button", null, OnCloseButton);
        GuiBaseUtils.RegisterButtonDelegate(Layout, "Accept_Button", null, OnAcceptButton);
        m_CostWidgets = new GuiShopFunds(GuiBaseUtils.PrepareSprite(Layout, "Cost_Sprite"));
    }
コード例 #23
0
    protected override void OnViewShow()
    {
        base.OnViewShow();

        m_ButtonPlayDM = RegisterButtonDelegate(PLAYDM_BUTTON, () => { OnPlayPressed(E_MPGameType.DeathMatch); }, null);
        m_ButtonPlayZC = RegisterButtonDelegate(PLAYZC_BUTTON, () => { OnPlayPressed(E_MPGameType.ZoneControl); }, null);

        UpdateButtonStates();
    }
コード例 #24
0
    // HANDLERS

    void OnKeyboardClose(GUIBase_Button inInput, string inText, bool inInputCanceled)
    {
        if (inInputCanceled == true)
        {
            return;
        }

        Email = (inText ?? "").Trim();
    }
コード例 #25
0
    protected override bool ShouldDisplayButton(GUIBase_Button button)
    {
        if (button.name == "InviteFB_Button")
        {
            return(false);
        }

        return(base.ShouldDisplayButton(button));
    }
コード例 #26
0
    void SetWidgetVisibility(GUIBase_Button button, bool state)
    {
        if (button == null)
        {
            return;
        }

        SetWidgetVisibility(button.Widget, state);
    }
コード例 #27
0
 void HideUnusedButtons()
 {
     //hide the rest of buttons
     for (int k = s_GActions.Length; k < MaxConfigButtons; k++)
     {
         GUIBase_Button bt = GuiBaseUtils.GetButton(m_ScreenLayout, s_ActionButtonName + (k + 1));
         bt.Widget.Show(false, true);
     }
 }
コード例 #28
0
 void Password2KeyboardClose(GUIBase_Button input, string text, bool cancelled)
 {
     if (cancelled == false)
     {
         m_Password2Hash = CloudServices.CalcPasswordHash(text);
         m_Password2Btn.SetNewText(new string('*', text.Length));
         RefreshPage();
     }
 }
コード例 #29
0
    //---------------------------------------------------------
    public static GUIBase_Button GetButton(GUIBase_Layout layout, string buttonName)
    {
        GUIBase_Button control = GetControl <GUIBase_Button>(layout, buttonName);

        if (control == null)
        {
            Debug.LogWarning("Can't find button '" + buttonName + "'");
        }
        return(control);
    }
コード例 #30
0
ファイル: FriendListView.cs プロジェクト: huokele/shadow-gun
        public FriendLine(GUIBase_Widget inLine, OnFriendActionDelegate inFriendAction) : this(inLine)
        {
            m_OnFriendActionDelegate = inFriendAction;

            GUIBase_Button button = inLine.GetComponent <GUIBase_Button>();
            if (button != null)
            {
                button.RegisterTouchDelegate2(Delegate_OnFriendSelect);
            }
        }