예제 #1
0
    // =================================================================================================================

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

        GUIBase_Label[] labels = Parent.GetComponentsInChildren <GUIBase_Label>();

        foreach (GUIBase_Label l in labels)
        {
            if (l.name == "Score_Enum")
            {
                m_ScoreLabel = l;
            }
            else if (l.name == "Income_Enum")
            {
                m_MoneyLabel = l;
            }
            else if (l.name == "Kill_Enum")
            {
                m_KillsLabel = l;
            }
            else if (l.name == "Dead_Enum")
            {
                m_DeadsLabel = l;
            }
        }

        return(true);
    }
예제 #2
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");
    }
예제 #3
0
    // ------
    protected override void OnViewInit()
    {
        base.OnViewInit();

        m_StatusLabel  = PrepareLabel(Layout, "Text_Label");
        m_CaptionLabel = PrepareLabel(Layout, "Caption_Label");
    }
예제 #4
0
 void SetText(GUIBase_Label label, string text)
 {
     if (label != null)
     {
         label.SetNewText(text);
     }
 }
예제 #5
0
    void ShowRebuildLablesButton()
    {
        if (GUILayout.Button("Rebuild lables in selection"))
        {
            Object[] selGOs = Selection.GetFiltered(typeof(GameObject), SelectionMode.Deep);
            Debug.Log("GO found: " + selGOs.Length);

            int labelsInSelection = 0;
            foreach (GameObject go in selGOs)
            {
                GUIBase_Label label = go.GetComponent <GUIBase_Label>();
                if (label == null)
                {
                    continue;
                }

                labelsInSelection++;

                Debug.Log("Rebuilding label " + label.name + ": " + label.Text);

                label.GenerateRunTimeData();
                EditorUtility.SetDirty(label);
            }

            if (labelsInSelection > 0)
            {
                Debug.Log("Rebuild " + labelsInSelection + " labels.");
            }
            else
            {
                Debug.LogWarning("No GUIBase_Label in selection.");
            }
        }
    }
예제 #6
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();
    }
    // =================================================================================================================

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

        GUIBase_Label[] labels = Parent.GetComponentsInChildren <GUIBase_Label>();

        foreach (GUIBase_Label l in labels)
        {
            if (l.name == "YourCourse_Enum")
            {
                m_GoodCourse = l;
            }
            else if (l.name == "YourSpawns_Enum")
            {
                m_GoodSpawns = l;
            }
            else if (l.name == "EnemyCourse_Enum")
            {
                m_BadCourse = l;
            }
            else if (l.name == "EnemySpawns_Enum")
            {
                m_BadSpawns = l;
            }
        }

        return(true);
    }
예제 #8
0
        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);
        }
예제 #9
0
 void Start()
 {
     //Debug.Log(Time.realtimeSinceStartup + " Start");
     enabled         = false;
     m_Label         = m_Background.GetComponentInChildren <GUIBase_Label>();
     wasAudioPlaying = false;
 }
예제 #10
0
 public Dialog(GUIBase_Widget root)
 {
     m_Root         = root;
     m_ResultText   = GuiBaseUtils.GetChild <GUIBase_Label>(root, "ResultText_Label");
     m_SkullNormal  = GuiBaseUtils.GetChild <GUIBase_Widget>(root, "Skull_Normal");
     m_SkullPremium = GuiBaseUtils.GetChild <GUIBase_Widget>(root, "Skull_Premium");
 }
예제 #11
0
    //=================================================================================================================

    //-----------------------------------------------------------------------------------------------------------------
    // Updates label of button if player was rewarded for corresponding site.
    //-----------------------------------------------------------------------------------------------------------------
    void UpdateSiteButton(SiteData site)
    {
        if ((site.m_Rewarded == true) && (site.m_Button != null) && (site.m_ButtonRewardedLabel != string.Empty))
        {
            GUIBase_Label label = GuiBaseUtils.GetChildLabel(site.m_Button.Widget, "Button_Caption_idle");

            if (label != null)
            {
                label.SetNewText(site.m_ButtonRewardedLabel);
            }

            label = GuiBaseUtils.GetChildLabel(site.m_Button.Widget, "Button_Caption_over");

            if (label != null)
            {
                label.SetNewText(site.m_ButtonRewardedLabel);
            }

            label = GuiBaseUtils.GetChildLabel(site.m_Button.Widget, "Button_Caption_disabled");

            if (label != null)
            {
                label.SetNewText(site.m_ButtonRewardedLabel);
            }
        }
    }
예제 #12
0
 void ShowText(GUIBase_Label label, bool state)
 {
     if (label != null && label.Widget != null)
     {
         label.Widget.Show(state, true);
     }
 }
예제 #13
0
    public bool SetTextAndAdjustBackground(string text, GUIBase_Label label, GUIBase_Widget background, float BaseSize, float TextScale)
    {
        float CorrectionPerChar = 35 * (1 - TextScale);       //15f;
        bool  modif             = false;

        if (label.GetText() != text)
        {
            label.SetNewText(text);
            modif = true;
        }
        int   len      = text.Length;
        float textSize = label.textSize.x - CorrectionPerChar * (float)len;
        float xScale   = 0.2f + textSize / BaseSize;

        if ((Mathf.Abs(background.transform.localScale.x - xScale) > 0.01f) || (Mathf.Abs(label.transform.localScale.y - TextScale) > 0.01f))
        {
            background.transform.localScale = new Vector3(xScale, 1.0f, 1.0f);
            label.transform.localScale      = new Vector3(TextScale / xScale, TextScale, TextScale);
            modif = true;
        }

        if (!background.IsVisible() || !label.Widget.IsVisible())
        {
            background.Show(true, true);
            label.Widget.Show(true, true);
        }

        return(modif);
    }
예제 #14
0
    // ------
    public void Init(GUIBase_Widget newParent, bool useUpgrades)
    {
        m_Base = GetComponent <GUIBase_Widget>();

        m_Price      = GuiBaseUtils.GetChildLabel(m_Base, "Price");
        m_ItemName   = GuiBaseUtils.GetChildLabel(m_Base, "Name");
        m_Image      = GuiBaseUtils.GetChildSprite(m_Base, "Image");
        m_Enabled    = GuiBaseUtils.GetChild <GUIBase_Sprite>(m_Base, "Enabled");
        m_Disabled   = GuiBaseUtils.GetChild <GUIBase_Sprite>(m_Base, "Disabled");
        m_Finished   = GuiBaseUtils.GetChild <GUIBase_Sprite>(m_Base, "Finished");
        m_Researched = GuiBaseUtils.GetChild <GUIBase_Sprite>(m_Base, "Researched");

        m_LockedByRank = new LockedByRank(GuiBaseUtils.GetChild <GUIBase_Sprite>(m_Base, "LockedByRank"),
                                          GuiBaseUtils.GetChild <GUIBase_Label>(m_Base, "LockedByRankText"));

        if (useUpgrades)
        {
            m_FullyUpgraded = GuiBaseUtils.GetChild <GUIBase_Sprite>(m_Base, "FullyUpgraded");
            m_UpgradeParent = GuiBaseUtils.GetChild <GUIBase_Widget>(m_Base, "Upgrades");
            for (int i = 0; i < ResearchItem.MAX_UPGRADES; i++)
            {
                m_Upgrades[i] = GuiBaseUtils.GetChild <GUIBase_Widget>(m_UpgradeParent, "Upgrade" + (i + 1));
                m_Stars[i]    = GuiBaseUtils.GetChild <GUIBase_Widget>(m_UpgradeParent, "Star" + (i + 1));
            }
            //m_FullyUpgraded = GuiBaseUtils.GetChild<GUIBase_Widget>(m_UpgradeParent, "FullyUpgraded");
        }
        else
        {
            m_FullyUpgraded = null;
        }
        m_Base.Relink(newParent);
    }
예제 #15
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>();
    }
예제 #16
0
 public void InitGui(GUIBase_Layout layout, GUIBase_Widget widget)
 {
     m_RootWidget = widget;
     m_NameLabel  = GuiBaseUtils.GetChildLabel(widget, "Label");
     m_PerkSprite = GuiBaseUtils.GetChildSprite(widget, "Perk_Sprite");
     m_LockSprite = GuiBaseUtils.GetChildSprite(widget, "Lock_Sprite");
     m_EmptyLabel = GuiBaseUtils.GetChildLabel(widget, "Empty_Label");
 }
예제 #17
0
    void InitGui()
    {
        //Debug.Log("B:" + m_RootWidget.GetFullName());
        m_Sprite = GuiBaseUtils.GetChildSprite(m_RootWidget, "Sprite");
        m_Label  = GuiBaseUtils.GetChildLabel(m_RootWidget, "Label");

        //Debug.Log("C:" + m_Label.GetFullName());
    }
예제 #18
0
 public StatisticsLine(GUIBase_Widget inLine)
 {
     m_Line        = inLine;
     m_Name        = inLine.transform.GetChildComponent <GUIBase_Label>("01_name");
     m_PlayerValue = inLine.transform.GetChildComponent <GUIBase_Label>("02_player_value");
     m_FriendValue = inLine.transform.GetChildComponent <GUIBase_Label>("03_friend_value");
     m_FriendName  = inLine.transform.GetChildComponent <GUIBase_Label>("04_friend_name");
 }
예제 #19
0
    public GuiShopFunds(GUIBase_Sprite rootSprite)
    {
        m_RootSprite = rootSprite;

        m_FundsLabel  = GuiBaseUtils.GetChildLabel(m_RootSprite.Widget, "Funds_Label");
        m_SpriteGold  = GuiBaseUtils.GetChildSprite(m_RootSprite.Widget, "Gold_Sprite");
        m_SpriteMoney = GuiBaseUtils.GetChildSprite(m_RootSprite.Widget, "Money_Sprite");
    }
예제 #20
0
 public Reward(GUIBase_Widget root) : base(root)
 {
     m_TextLabel      = GuiBaseUtils.GetChild <GUIBase_Label>(root, "Text_Label");
     m_ItemCountLabel = GuiBaseUtils.GetChild <GUIBase_Label>(root, "ItemCount_Label");
     m_GoldImage      = GuiBaseUtils.GetChild <GUIBase_Sprite>(root, "Gold_Image");
     m_ChipsImage     = GuiBaseUtils.GetChild <GUIBase_Sprite>(root, "Chips_Image");
     m_ItemImage      = GuiBaseUtils.GetChild <GUIBase_Sprite>(root, "Item_Image");
     m_MagicImage     = GuiBaseUtils.GetChild <GUIBase_Sprite>(root, "Magic_Image");
 }
예제 #21
0
        public Day(GUIBase_Widget root) : base(root)
        {
            m_Root      = root;
            m_RootScale = root.transform.localScale;
            m_DayLabel  = GuiBaseUtils.GetChild <GUIBase_Label>(root, "Day_Label");

            m_DailyReward       = new InstantReward(GuiBaseUtils.GetChild <GUIBase_Widget>(root, "DailyReward"));
            m_ConditionalReward = new ConditionalReward(GuiBaseUtils.GetChild <GUIBase_Widget>(root, "ConditionalReward"));
        }
예제 #22
0
        public NumericBase(GUIBase_Label label, float source, float target)
            : base(label.Widget)
        {
            m_Label       = label;
            m_Value       = source;
            m_TargetValue = target;

            ShowValue(m_Value);
        }
예제 #23
0
 void SetDiscount(GUIBase_Label label, ref AccountInfo acct)
 {
     if (acct.Discount > 0.0f)
     {
         int key = acct.FullPrice == 1 ? 01140006 : 01140005;
         label.SetNewText(string.Format(TextDatabase.instance[key], acct.FullPrice));
     }
     label.Widget.Show(acct.Discount > 0.0f ? true : false, true);
 }
예제 #24
0
    // GUIVIEW INTERFACE
    protected override void OnViewInit()
    {
        base.OnViewInit();

        m_CountLabel    = GuiBaseUtils.PrepareLabel(m_ScreenLayout, "CountInfo_Label");
        m_AddLabel      = GuiBaseUtils.PrepareLabel(m_ScreenLayout, "AddInfo_Label");
        m_BoostModLabel = GuiBaseUtils.PrepareLabel(m_ScreenLayout, "BoostFactor_Label");
        m_DurationLabel = GuiBaseUtils.PrepareLabel(m_ScreenLayout, "BoostDuration_Label");
    }
예제 #25
0
        void AnimateWidget(GUIBase_Label label, string text)
        {
            var animation = MFGuiManager.AnimateWidget(label, text);

            if (animation != null)
            {
                animation.Duration  = 0.5f;
                animation.AudioClip = CountDownSound;
            }
        }
예제 #26
0
    //---------------------------------------------------------
    public static GUIBase_Label PrepareLabel(GUIBase_Layout layout, string name)
    {
        GUIBase_Label control = GetControl <GUIBase_Label>(layout, name);

        if (control == null)
        {
            Debug.LogWarning("Can't find label '" + name + "'");
        }
        return(control);
    }
예제 #27
0
        public override void Initialize(GUIBase_Layout layout, string rootName, float fadeInTime, float fadeOutTime)
        {
            base.Initialize(layout, rootName, fadeInTime, fadeOutTime);

            m_Caption  = GuiBaseUtils.GetChild <GUIBase_Label>(m_Root, CAPTION_LABEL);
            m_Text     = GuiBaseUtils.GetChild <GUIBase_Label>(m_Root, TEXT_LABEL);
            m_ShowInfo = GuiBaseUtils.GetChild <GUIBase_Button>(m_Root, SHOWINFO_BUTTON);

            m_ShowInfo.RegisterTouchDelegate2(OnButtonPressed);
        }
예제 #28
0
    // GUIVIEW INTERFACE

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

        m_CaptionLabel = GuiBaseUtils.GetControl <GUIBase_Label>(Layout, CAPTION_LABEL);
        m_MessageText  = GuiBaseUtils.GetControl <GUIBase_TextArea>(Layout, MESSAGE_TEXT);

        m_MessageButton = GuiBaseUtils.GetControl <GUIBase_Button>(Layout, MESSAGE_BUTTON);
        AddTextField(m_MessageButton, Delegate_OnKeyboardClose, m_MessageText, MAX_MESSAGE_LENGTH, 8);
    }
예제 #29
0
        void AnimateWidget(GUIBase_Label label, float source, float target, string format = null)
        {
            var animation = MFGuiManager.AnimateWidget(label, source, target);

            if (animation != null)
            {
                animation.Duration  = 0.5f;
                animation.AudioClip = CountDownSound;
            }
        }
예제 #30
0
    protected override void OnViewInit()
    {
        m_ScreenPivot  = MFGuiManager.Instance.GetPivot("ShopPopups");
        m_ScreenLayout = m_ScreenPivot.GetLayout("Wait_Layout");

        base.OnViewInit();

        m_StatusLabel  = PrepareLabel(m_ScreenLayout, "Text_Label");
        m_CaptionLabel = PrepareLabel(m_ScreenLayout, "Caption_Label");
    }