Exemplo n.º 1
0
    public void CreateObject()
    {
        GameItem[] items   = GetCurrentCraftingBar();
        var        created = CraftingSystem.Instance.Craft(items);

        if (created != null && created.type == ItemType.Equipment)
        {
            Equipment.Add(created);
            if (created.prefab.GetComponent <Thruster>() != null)
            {
                _player.AddThruster(created.prefab.GetComponent <Thruster>());
            }
        }

        if (created != null && created.type == ItemType.Ingredient)
        {
            AddItem(created);
        }

        if (created != null && created.type == ItemType.Repair)
        {
            FindObjectOfType <PlayerScript>().Heal(created.CraftingValue);
        }

        if (created != null && created.type == ItemType.Finder)
        {
            if (!_earthFinder)
            {
                UIPopup popup = UIPopupManager.ShowPopup("EarthFinder", false, false);
                _earthFinder = true;
            }
        }

        ClearAllSlots(false);
    }
Exemplo n.º 2
0
        public void ShowAchievement(int achievementId)
        {
            //make sure the achievement we want to show has been defined in the Achievements list
            //the achievementId is actually the index of the achievement as it has been defined in the list
            if (Achievements == null || achievementId < 0 || achievementId > Achievements.Count - 1)
            {
                return;
            }

            //get the achievement from the list
            AchievementData achievement = Achievements[achievementId];

            //make sure we got an achievement and that the entry was not null
            if (achievement == null)
            {
                return;
            }

            //get a clone of the UIPopup, with the given PopupName, from the UIPopup Database
            m_popup = UIPopupManager.GetPopup(PopupName);

            //make sure that a popup clone was actually created
            if (m_popup == null)
            {
                return;
            }

            //set the achievement icon
            m_popup.Data.SetImagesSprites(achievement.Icon);
            //set the achievement title and message
            m_popup.Data.SetLabelsTexts(achievement.Achievement, achievement.Description);

            //show the popup
            UIPopupManager.ShowPopup(m_popup, m_popup.AddToPopupQueue, false);
        }
Exemplo n.º 3
0
        public void ShowAllClearBonusPopup(int score)
        {
            var popup = UIPopupManager.GetPopup("AllClearBonus");

            UIPopupManager.ShowPopup(popup, popup.AddToPopupQueue, false);

            _autoCreaterFSM.SendTrigger(ArborFSMTrigger.ItemCreaterMessage.ALL_CLEAR_STAGE_ITEMS_CREATE);
        }
Exemplo n.º 4
0
        private void AllClearBonus()
        {
            var popup = UIPopupManager.GetPopup("AllClearBonus");

            UIPopupManager.ShowPopup(popup, popup.AddToPopupQueue, false);

            _scoreModel.AddScore = 5000;

            _autoCreateState.SendTrigger(ItemCreaterMessage.ALL_CLEAR_STAGE_ITEMS_CREATE);
        }
Exemplo n.º 5
0
 private void RequestAuthCode(SteamKit2.EResult result)
 {
     TaskManagerController.RunAction(() =>
     {
         var authPopup = UIPopupManager.ShowPopup("AuthPopup", true, false);
         authPopup.Data.SetButtonsCallbacks(
             () => { authPopup.Hide(); },
             () =>
         {
             var authItems = authPopup.GetComponent <AuthPopupItemsContainer>();
             SteamController.steamInScene.steam3.SendAuth(authItems.authField.text);
             authPopup.Hide();
         });
     });
 }
Exemplo n.º 6
0
    public void showString(string text)
    {
        //get a clone of the UIPopup, with the given PopupName, from the UIPopup Database
        m_popup = UIPopupManager.GetPopup(PopupName);

        //make sure that a popup clone was actually created
        if (m_popup == null)
        {
            return;
        }

        //set the achievement icon
        //m_popup.Data.SetImagesSprites(achievement.Icon);
        //set the achievement title and message
        m_popup.Data.SetLabelsTexts("", text);

        //show the popup
        UIPopupManager.ShowPopup(m_popup, m_popup.AddToPopupQueue, false);
    }
Exemplo n.º 7
0
        private void TriggerNotification(Achievement achievement)
        {
            m_popup = UIPopupManager.GetPopup(PopupName);

            if (m_popup == null)
            {
                return;
            }

            var icon    = m_popup.Data.Images[0];
            var title   = m_popup.Data.Labels[0].GetComponent <TextMeshProUGUI>();
            var message = m_popup.Data.Labels[1].GetComponent <TextMeshProUGUI>();


            m_popup.Data.SetImagesSprites(achievement.icon);
            m_popup.Data.SetLabelsTexts(achievement.title, achievement.description);
            icon.color    = Color.white;
            title.color   = Color.white;
            message.color = Color.white;

            UIPopupManager.ShowPopup(m_popup, m_popup.AddToPopupQueue, false);
        }
 public void ShowPopup(string popupName)
 {
     UIPopupManager.ShowPopup(popupName, false, false);
 }
Exemplo n.º 9
0
 public void ShowQueuedPopup(string PopupName)
 {
     UIPopupManager.ShowPopup(PopupName, true, false);
 }
Exemplo n.º 10
0
        private void DrawPopupTesterOptions()
        {
            GUILayout.Space(DGUI.Properties.Space(4));

            m_exampleSprite = (Sprite)EditorGUILayout.ObjectField(m_exampleSprite, typeof(Sprite), false);
            GUILayout.Space(DGUI.Properties.Space(4));

            GUILayout.BeginHorizontal();
            {
                m_targetPopupName = EditorGUILayout.TextField(m_targetPopupName);
                GUILayout.Space(DGUI.Properties.Space(2));
                m_addToQueue = DGUI.Toggle.Switch.Draw(m_addToQueue, "Add to Queue", ComponentColorName, false, true, false);
            }
            GUILayout.EndHorizontal();
            GUILayout.Space(DGUI.Properties.Space(2));
            GUILayout.BeginHorizontal();
            {
                m_hideOnClickAnywhere = DGUI.Toggle.Switch.Draw(m_hideOnClickAnywhere, "Hide OnClick Anywhere", ComponentColorName, false, true, true);
                GUILayout.Space(DGUI.Properties.Space(2));
                m_hideOnClickOverlay = DGUI.Toggle.Switch.Draw(m_hideOnClickOverlay, "Hide OnClick Overlay", ComponentColorName, false, true, true);
            }
            GUILayout.EndHorizontal();
            GUILayout.Space(DGUI.Properties.Space(2));
            GUILayout.BeginHorizontal();
            {
                m_hideOnClickContainer = DGUI.Toggle.Switch.Draw(m_hideOnClickContainer, "Hide OnClick Container", ComponentColorName, false, true, true);
                GUILayout.Space(DGUI.Properties.Space(2));
                m_hideOnBackButton = DGUI.Toggle.Switch.Draw(m_hideOnBackButton, "Hide On Back Button", ComponentColorName, false, true, true);
            }
            GUILayout.EndHorizontal();
            GUILayout.Space(DGUI.Properties.Space(4));

            var   textSize     = Size.XL;
            float buttonHeight = DGUI.Sizes.BarHeight(textSize);

            GUILayout.BeginHorizontal();
            {
                if (DGUI.Button.Dynamic.DrawIconButton(DGUI.Icon.Show, UILabels.Show, textSize, TextAlign.Left, ComponentColorName, ComponentColorName, buttonHeight))
                {
                    UIPopup popup = UIPopupManager.ShowPopup(m_targetPopupName, m_addToQueue, false);
                    popup.DestroyAfterHide     = true;
                    popup.HideOnClickAnywhere  = m_hideOnClickAnywhere;
                    popup.HideOnClickOverlay   = m_hideOnClickOverlay;
                    popup.HideOnClickContainer = m_hideOnClickContainer;
                    popup.HideOnBackButton     = m_hideOnBackButton;

                    if (m_exampleSprite != null)
                    {
                        popup.Data.SetImagesSprites(m_exampleSprite, m_exampleSprite, m_exampleSprite);
                    }
                }

                GUILayout.Space(DGUI.Properties.Space());

                if (DGUI.Button.Dynamic.DrawIconButton(DGUI.Icon.Hide, UILabels.Hide, textSize, TextAlign.Left, ComponentColorName, ComponentColorName, buttonHeight))
                {
                    UIPopup.HidePopup(m_targetPopupName);
                }
            }
            GUILayout.EndHorizontal();
        }