コード例 #1
0
        public void DropSelected()
        {
            if (_currentlySelectedLocation == EquipLocation.None)
            {
                return;
            }

            //Gets the item
            EquipableItem item = GetItemInSlot(_currentlySelectedLocation);

            //Drops the item
            GameObject.FindGameObjectWithTag("Player").GetComponent <ItemDropper>().DropItem(item, 1);

            //Closes the tooltip
            ItemTooltip tooltip = GameObject.FindObjectOfType <ItemTooltip>();

            if (tooltip)
            {
                tooltip.Close();
            }

            //Removes the item
            RemoveItem(_currentlySelectedLocation);

            //Sets the selected to none
            _currentlySelectedLocation = EquipLocation.None;
        }
コード例 #2
0
ファイル: MainForm.Panel.cs プロジェクト: wyggit/TQVaultAE
        /// <summary>
        /// Callback for highlighting a new item.
        /// Updates the text box on the main form.
        /// </summary>
        /// <param name="sender">sender object</param>
        /// <param name="e">SackPanelEventArgs data</param>
        private void NewItemHighlightedCallback(object sender, SackPanelEventArgs e)
        {
            Item           item      = e.Item;
            SackCollection sack      = e.Sack;
            SackPanel      sackPanel = (SackPanel)sender;

            if (item == null)
            {
                // Only do something if this sack is the "owner" of the current item highlighted.
                if (sack == this.lastSackHighlighted)
                {
                    this.itemText.Text = string.Empty;

                    // hide the tooltip
                    ItemTooltip.HideTooltip();
                }
            }
            else
            {
                var itt = ItemTooltip.ShowTooltip(this.ServiceProvider, item, sackPanel);

                this.itemText.ForeColor = itt.Data.Item.GetColor(itt.Data.BaseItemInfoDescription);
                this.itemText.Text      = itt.Data.FullNameBagTooltipClean;
            }

            this.lastSackHighlighted      = sack;
            this.lastSackPanelHighlighted = sackPanel;
        }
コード例 #3
0
ファイル: Player.cs プロジェクト: bbroeking/artemis
 private void OnValidate()
 {
     if (itemTooltip == null)
     {
         itemTooltip = FindObjectOfType <ItemTooltip>();
     }
 }
コード例 #4
0
 protected virtual void OnValidate()
 {
     if (tooltip == null)
     {
         tooltip = FindObjectOfType <ItemTooltip>();
     }
 }
コード例 #5
0
        protected async Task <ItemTooltip> GetTooltip2(int itemId, HttpClient client)
        {
            ItemTooltip tooltip = new ItemTooltip();

            HttpResponseMessage response = await client.GetAsync($@"{BaseUrl}/item={itemId}");

            string html = await response.Content.ReadAsStringAsync();

            //WowheadTooltip wowheadTooltip = JsonConvert.DeserializeObject<WowheadTooltip>(json);

            HtmlDocument htmlDoc = new HtmlDocument();

            htmlDoc.LoadHtml(html);

            HtmlNode h1Node = htmlDoc.DocumentNode.SelectSingleNode("//h1");

            tooltip.ItemName    = h1Node.InnerText;
            tooltip.Description = h1Node.NextSibling.NextSibling.InnerText;

            HtmlNode iconNode = htmlDoc.DocumentNode.SelectSingleNode("//link[@rel='image_src']");

            tooltip.ThumbnailUrl = iconNode.Attributes["href"].Value;

            tooltip.ItemUrl       = $"{BaseUrl}/item={itemId}";
            tooltip.FooterText    = "www.wowhead.com";
            tooltip.FooterIconUrl = $"{BaseUrl}/images/logos/classic-logo.gif";
            return(tooltip);
        }
コード例 #6
0
    public void Unpack(InventoryItem _item)
    {
        iTooltip = Inventory.GetItemTooltip();
        iItem    = _item;
        if (iItem.quantity > 1)
        {
            quantity.text = iItem.quantity.ToString();
        }
        else
        {
            quantityDisplay.SetActive(false);
        }
        //* Going to use this later;
        model = Instantiate(iItem.item.model, cube);
        //Debug.Log("cube transform: " + cube);
        model.transform.localPosition = iItem.item.positionOffset;
        initialRotation            = Quaternion.Euler(iItem.item.rotationOffset);
        model.transform.rotation   = initialRotation;
        model.transform.localScale = new Vector3(iItem.item.itemScale, iItem.item.itemScale, iItem.item.itemScale);
        model.layer = 5; //UI

        /*
         * if (model.GetComponent<Rigidbody>() != null) {
         *  model.GetComponent<Rigidbody>().useGravity = false;
         *  //*/
        //*/
    }
コード例 #7
0
ファイル: ItemProperties.cs プロジェクト: lvlvy/TQVaultAE
        /// <summary>
        /// Loads the item properties
        /// </summary>
        private void LoadProperties()
        {
            this.Data = ItemProvider.GetFriendlyNames(this.Item, FriendlyNamesExtraScopes.ItemFullDisplay, this.checkBoxFilterExtraInfo.Checked);

            // ItemName
            this.labelItemName.ForeColor = this.Data.Item.GetColor(Data.BaseItemInfoDescription);
            this.labelItemName.Text      = this.Data.FullName.RemoveAllTQTags();

            // Base Item Attributes
            if (this.Data.BaseAttributes.Any())
            {
                this.flowLayoutBaseItemProperties.Controls.Clear();
                foreach (var prop in this.Data.BaseAttributes)
                {
                    this.flowLayoutBaseItemProperties.Controls.Add(ItemTooltip.MakeRow(prop));
                }
                this.flowLayoutBaseItemProperties.Show();
                this.labelBaseItemProperties.Show();
            }
            else
            {
                this.flowLayoutBaseItemProperties.Hide();
                this.labelBaseItemProperties.Hide();
            }

            // Prefix Attributes
            if (this.Data.PrefixAttributes.Any())
            {
                this.flowLayoutPrefixProperties.Controls.Clear();
                foreach (var prop in this.Data.PrefixAttributes)
                {
                    this.flowLayoutPrefixProperties.Controls.Add(ItemTooltip.MakeRow(prop));
                }
                this.flowLayoutPrefixProperties.Show();
                this.labelPrefixProperties.Show();
            }
            else
            {
                this.flowLayoutPrefixProperties.Hide();
                this.labelPrefixProperties.Hide();
            }

            // Suffix Attributes
            if (this.Data.SuffixAttributes.Any())
            {
                this.flowLayoutSuffixProperties.Controls.Clear();
                foreach (var prop in this.Data.SuffixAttributes)
                {
                    this.flowLayoutSuffixProperties.Controls.Add(ItemTooltip.MakeRow(prop));
                }
                this.flowLayoutSuffixProperties.Show();
                this.labelSuffixProperties.Show();
            }
            else
            {
                this.flowLayoutSuffixProperties.Hide();
                this.labelSuffixProperties.Hide();
            }
        }
コード例 #8
0
 public void OnHoverEnter(BaseEventData baseEventData)
 {
     if (item != null && item.TooltipPrefab != null)
     {
         tooltip = Instantiate <ItemTooltip>(item.TooltipPrefab, transform);
         tooltip.SetItem(item);
     }
 }
コード例 #9
0
 void baseElement_MouseEnter(BaseElement sender, MouseEventArgs e)
 {
     if (!tooltip)
     {
         tooltip = ItemTooltip.Create(this);
         tooltip.Destroyed += tooltip_Destroyed;
     }
 }
コード例 #10
0
 public void Unpack(InventoryItem _item, List <InventoryItem> _myList, List <InventoryItem> _otherList, HellaHockster _hellaHockster)
 {
     iTooltip          = Inventory.GetItemTooltip();
     iItem             = _item;
     myList            = _myList;
     otherList         = _otherList;
     hellaHockster     = _hellaHockster;
     itemName.text     = iItem.item.name;
     itemQuantity.text = iItem.quantity.ToString();
 }
コード例 #11
0
        // todo, make sure case doesn't matter, conjoined lines don't have results.
        private string GetTooltipsAsString(ItemTooltip toolTip)
        {
            StringBuilder sb = new StringBuilder();

            for (int j = 0; j < toolTip.Lines; j++)
            {
                sb.Append(toolTip.GetLine(j) + "\n");
            }
            return(sb.ToString().ToLower());
        }
コード例 #12
0
    // Use this for initialization
    void Start()
    {
        inv     = GameObject.Find("InventoryController").GetComponent <Backpack>();
        Tooltip = inv.GetComponent <ItemTooltip>();
        //cam = GameObject.FindGameObjectWithTag("MainCamera");
        Pnel = GameObject.Find("Inventory_Panel");
        Slot = GameObject.Find("Slot_Panel");
        //ItemSlot = this.transform.parent.gameObject;

        offset = new Vector2(Pnel.GetComponent <RectTransform>().anchoredPosition.x + 2 + this.GetComponent <RectTransform>().anchoredPosition.x, Pnel.GetComponent <RectTransform>().anchoredPosition.y + 2 + Slot.GetComponent <RectTransform>().anchoredPosition.y + this.GetComponent <RectTransform>().anchoredPosition.y);
    }
コード例 #13
0
 private void OnValidate()
 {
     if (itemToolTip == null)
     {
         itemToolTip = FindObjectOfType <ItemTooltip>();
     }
     if (_player == null)
     {
         _player = GetComponent <DynamicCharacterAvatar>();
     }
 }
コード例 #14
0
 protected virtual void OnValidate()
 {
     if (image == null)
     {
         image = GetComponent <Image>();
     }
     if (tooltip == null)
     {
         tooltip = FindObjectOfType <ItemTooltip>();
     }
 }
コード例 #15
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(this);
     }
     gameObject.SetActive(false);
 }
コード例 #16
0
ファイル: LangTweaks.cs プロジェクト: Pop000100/VanillaTweaks
 static void ReplaceTooltip(ItemTooltip[] tooltipArray, string newTooltip, short itemID)
 {
     ReplacedTooltips.Add(new ReplacedTooltipLine(tooltipArray[itemID], itemID));
     if (newTooltip == null)
     {
         tooltipArray[itemID] = ItemTooltip.None;
     }
     else
     {
         tooltipArray[itemID] = ItemTooltip.FromLanguageKey(newTooltip);
     }
 }
コード例 #17
0
        public override void OnItemTooltip(ItemTooltip tooltip, InventoryItem itemInfo)
        {
            var c = tooltip[SpiritbondPercent];

            if (c != null && !(c.Payloads[0] is TextPayload tp && tp.Text.StartsWith("?")))
            {
                tooltip[SpiritbondPercent] = new SeString(new List <Payload>()
                {
                    new TextPayload((itemInfo.Spiritbond / 100f).ToString(Config.TrailingZero ? "F2" : "0.##") + "%")
                });
            }
        }
コード例 #18
0
ファイル: RelicUI.cs プロジェクト: bbroeking/artemis
    void Start()
    {
        player      = PlayerSingleton.Instance.player;
        playerRelic = player.relics;
        relics      = playerRelic.relics;
        SetStartingItems();

        uISingleton = UISingleton.Instance;
        itemTooltip = uISingleton.GetComponentInChildren <ItemTooltip>();

        this.OnPointerEnterEvent += ShowTooltip;
        this.OnPointerExitEvent  += HideTooltip;
    }
コード例 #19
0
    private void Awake()
    {
        if (itemTooltip == null)
        {
            itemTooltip = FindObjectOfType <ItemTooltip> ();
        }

        if (image == null)
        {
            image = GetComponent <Image> ();
        }

        Item = null;
    }
コード例 #20
0
        /**<summary>Sets the name of an item.</summary>*/
        private static void SetItemTooltip(int type, string tooltip)
        {
            // Access Lang's item tooltip cache
            ItemTooltip[] _itemTooltipCache = (ItemTooltip[])TerrariaReflection.Lang_itemTooltipCache.GetValue(null);

            // Get the cached item tooltip
            ItemTooltip itemTooltip = _itemTooltipCache[ItemID.FromNetId((short)type)];

            // Tooltip has not been assigned. Let's assign a new one
            if (itemTooltip == ItemTooltip.None)
            {
                // Create a new item tooltip
                itemTooltip = (ItemTooltip)TerrariaReflection.ItemToolTip_ctor.Invoke(new object[] { });

                // Create the tooltip's new localized text
                LocalizedText _text = (LocalizedText)TerrariaReflection.LocalizedText_ctor.Invoke(new object[] { "", tooltip });

                // Assign the tooltip's new localized text
                TerrariaReflection.ItemTooltip_text.SetValue(itemTooltip, _text);

                // Assign the new item tooltip to the cache
                _itemTooltipCache[ItemID.FromNetId((short)type)] = itemTooltip;
            }
            else
            {
                // Get the tooltip's localized text
                LocalizedText _text = (LocalizedText)TerrariaReflection.ItemTooltip_text.GetValue(itemTooltip);

                // Set the text of the tooltip's localized text
                TerrariaReflection.LocalizedText_SetValue.Invoke(_text, new object[] { tooltip });

                // Set it so that the tooltip will be revalidated the first time it's needed.
                TerrariaReflection.ItemTooltip_lastCulture.SetValue(itemTooltip, null);
            }



            // Create a new ItemTooltip

            /*ItemTooltip itemTooltip = (ItemTooltip)TerrariaReflection.ctor_ItemToolTip.Invoke(new object[] {});
             * // Create a new LocalizedText
             * LocalizedText locText = (LocalizedText)TerrariaReflection.ctor_LocalizedText.Invoke(new object[] { "ItemTooltip" + type.ToString(), tooltip });
             *
             * TerrariaReflection._text_ItemTooltip.SetValue(itemTooltip, locText);
             *
             * // Assign the new ItemTooltip to Lang's item tooltip cache
             * _itemTooltipCache[ItemID.FromNetId((short)type)] = itemTooltip;*/

            // Hooray for reflection!
        }
コード例 #21
0
    /// <summary>
    /// Метод создания Tooltip. Срабатывает при наведении курсора на ItemView.
    /// </summary>
    /// <param name="eventData"></param>
    public void OnPointerEnter(PointerEventData eventData)
    {
        var rectT = GetComponent <RectTransform>();

        Vector3 pos = new Vector3
        {
            x = rectT.transform.position.x + rectT.rect.width / 2 * _commonField.transform.localScale.x,
            y = rectT.transform.position.y - rectT.rect.height / 2 * _commonField.transform.localScale.y,
            z = 0
        };

        _tooltipInstance = Instantiate(ToolTipView, pos, new Quaternion(), _commonField.transform);
        _tooltipInstance.SetTooltipInfo(item.Name, item.FlavorText);
    }
コード例 #22
0
    private void FixedUpdate()
    {
        // Setup Events:
        // Right Click
        if (CharacterPanel == null)
        {
            return;
        }

        inventory      = CharacterPanel.transform.Find("Inventory").gameObject.GetComponent <Inventory>();
        itemTooltip    = CharacterPanel.transform.Find("ItemTooltip").gameObject.GetComponent <ItemTooltip>();
        equipmentPanel = CharacterPanel.transform.Find("EquipmentPanel").gameObject.GetComponent <EquipmentPanel>();
        statPanel      = CharacterPanel.transform.Find("StatPanel").gameObject.GetComponent <StatPanel>();
        draggableItem  = CharacterPanel.transform.Find("Image").gameObject.GetComponent <Image>();
        chest          = MainHud.transform.Find("ChestPanel").gameObject.GetComponent <Chest>();

        inventory.OnRightClickEvent      += Equip;
        chest.OnRightClickEvent          += GoToInventory;
        equipmentPanel.OnRightClickEvent += UnEquip;
        //Pointer Enter
        inventory.OnPointerEnterEvent      += ShowTooltip;
        equipmentPanel.OnPointerEnterEvent += ShowTooltip;
        //Pointer Exit
        inventory.OnPointerExitEvent      += HideTooltip;
        equipmentPanel.OnPointerExitEvent += HideTooltip;
        //Begin Drag
        inventory.OnBeginDragEvent      += BeginDrag;
        equipmentPanel.OnBeginDragEvent += BeginDrag;
        //End Drag
        inventory.OnEndDragEvent      += EndDrag;
        equipmentPanel.OnEndDragEvent += EndDrag;
        //Drag
        inventory.OnDragEvent      += Drag;
        equipmentPanel.OnDragEvent += Drag;
        //Drop
        inventory.OnDropEvent      += Drop;
        equipmentPanel.OnDropEvent += Drop;


        Strength.BaseValue     = CharConfig.Instance.charData.STR;
        Agility.BaseValue      = CharConfig.Instance.charData.AGI;
        Intelligence.BaseValue = CharConfig.Instance.charData.INT;
        Vitality.BaseValue     = CharConfig.Instance.charData.VIT;
        Dexterity.BaseValue    = CharConfig.Instance.charData.DEX;
        Luck.BaseValue         = CharConfig.Instance.charData.LUK;

        statPanel.SetStats(Strength, Agility, Intelligence, Vitality, Dexterity, Luck);
        statPanel.UpdateStatValues();
    }
コード例 #23
0
ファイル: UIManager.cs プロジェクト: dvscheng/enth-unity
    // Use this for initialization
    void Awake()
    {
        #region Singleton Behaviour
        /* Singleton behaviour. */
        if (_instance == null)
        {
            _instance = this;
        }
        else if (_instance != this)
        {
            Destroy(gameObject);
            Destroy(this);
            return;
        }
        DontDestroyOnLoad(gameObject);
        #endregion

        hotSpot = new Vector2(cursorTexture.width / 2, cursorTexture.height / 2);   // middle of the crossheir

        inventoryUIOn = false;
        dialogueUIOn  = false;
        insigniaOn    = false;
        journalOn     = false;
        healthBarOn   = true;
        expBarOn      = true;

        playerController = player.GetComponent <PlayerController>();
        playerInventory  = inventory.GetComponent <PlayerInventory>();
        questTracker     = questTrackerObj.GetComponent <UIQuestTracker>();
        dialogue         = dialogueObj.GetComponent <DialogueManager>();
        insigniaPanel    = insigniaObj.GetComponent <InsigniaPanel>();
        healthBar        = healthBarObj.GetComponent <HealthBar>();
        journal          = journalObj.GetComponent <Journal>();
        expBar           = expBarObj.GetComponent <EXPBar>();
        itemTooltip      = itemTooltipObj.GetComponent <ItemTooltip>();
        playerHp         = playerController.Hp;

        /* Turn on (initialize) the UI, then turn it back off (assumes they're hidden in Unity editor at start). */
        inventory.SetActive(true);
        inventory.SetActive(false);
        dialogueObj.SetActive(true);
        dialogueObj.SetActive(false);
        insigniaObj.SetActive(true);
        insigniaObj.SetActive(false);
        journalObj.SetActive(true);
        journalObj.SetActive(false);
        itemTooltipObj.SetActive(true);
        itemTooltipObj.SetActive(false);
    }
コード例 #24
0
ファイル: ItemDrop.cs プロジェクト: rpijpker01/IndieGame
    public void Init(Item pItem, Transform pPos, bool pGetCopy = true, bool pAddForce = true)
    {
        _playerTransform   = GameController.player.GetComponent <Transform>();
        _itemTooltip       = GameObject.Find("InGameUICanvas").transform.GetChild(4).GetComponent <ItemTooltip>();
        _playerInventory   = GameObject.Find("InGameUICanvas").transform.GetChild(2).transform.GetChild(1).GetComponent <Inventory>();
        _itemFlipAnimation = GetComponent <Animation>();
        _rb = GetComponent <Rigidbody>();
        _sr = GetComponent <SpriteRenderer>();

        //Ignore collision with player
        GameObject itemGo = Instantiate(pItem.PrefabWhenDropped, this.transform);

        if (pGetCopy)
        {
            _item = pItem.GetCopy();
        }
        else
        {
            _item = pItem;
        }

        itemGo.transform.tag = "LootDrop";
        itemGo.layer         = 10;
        GetComponent <HighlightGameobject>().enabled = false;
        GetComponent <HighlightGameobject>().enabled = true;

        GameObject _itemName = Resources.Load <GameObject>("DroppedItemDisplayParent");
        GameObject go        = Instantiate(_itemName, Camera.main.WorldToScreenPoint(this.transform.position), Quaternion.identity);

        _textScript          = go.GetComponent <FollowItemPosition>();
        _textScript.Item     = itemGo.transform;
        _textScript.ItemName = pItem.Name;
        _textScript.Init();

        if (pAddForce)
        {
            _rb.AddForce(Vector3.up * Random.Range(0, 5) + pPos.right * Random.Range(-2, 2) + pPos.forward * Random.Range(2, 6), ForceMode.Impulse);
        }
        else
        {
            _itemFlipAnimation.Play();
        }

        GameController.OnMouseOverGameObjectEvent += Highlight;
        GameController.OnMouseAwayFromGameObject  += Shade;
        GameController.OnMouseLeftClickGameObject += PickUp;
        GameController.OnCtrlKeyHoldEvent         += ShowTooltip;
        GameController.OnCrtlKeyUpEvent           += HideTooltip;
    }
コード例 #25
0
ファイル: ItemSlot.cs プロジェクト: Lilwu/Hunter
 protected virtual void OnValidate()
 {
     if (image == null)
     {
         image = GetComponent <Image>();
     }
     if (tooltip == null)
     {
         tooltip = FindObjectOfType <ItemTooltip>();
     }
     //20190224
     if (amountText == null)
     {
         amountText = GetComponentInChildren <Text>();
     }
 }
コード例 #26
0
        public static void EditTooltips(LanguageManager manager)
        {
            var bindFlags     = BindingFlags.Static | BindingFlags.NonPublic;
            var tooltipsField = typeof(Lang).GetField("_itemTooltipCache", bindFlags);
            var tooltips      = (ItemTooltip[])tooltipsField.GetValue(null);

            if (Config.ObsidianArmorTweak)
            {
                tooltips[ItemID.ObsidianHelm]  = ItemTooltip.FromLanguageKey("Mods.VanillaTweaks.ItemTooltip.ObsidianArmor");
                tooltips[ItemID.ObsidianShirt] = ItemTooltip.FromLanguageKey("Mods.VanillaTweaks.ItemTooltip.ObsidianArmor");
                tooltips[ItemID.ObsidianPants] = ItemTooltip.FromLanguageKey("Mods.VanillaTweaks.ItemTooltip.ObsidianArmor");
            }
            if (Config.SwatHelmetTweak)
            {
                if (VanillaTweaks.MiscellaniaLoaded && ModLoader.GetMod("GoldensMisc").ItemType("ReinforcedVest") > 0)
                {
                    tooltips[ItemID.SWATHelmet] = ItemTooltip.FromLanguageKey("Mods.VanillaTweaks.MiscellaniaTooltip.SwatHelmet");
                }
                else
                {
                    tooltips[ItemID.SWATHelmet] = ItemTooltip.FromLanguageKey("Mods.VanillaTweaks.ItemTooltip.SwatHelmet");
                }
            }
            if (Config.MeteorArmorDamageTweak)
            {
                tooltips[ItemID.MeteorHelmet]   = ItemTooltip.None;
                tooltips[ItemID.MeteorSuit]     = ItemTooltip.None;
                tooltips[ItemID.MeteorLeggings] = ItemTooltip.None;
            }
            if (Config.EskimoArmorTweak)
            {
                tooltips[ItemID.EskimoHood]  = ItemTooltip.FromLanguageKey("Mods.VanillaTweaks.ItemTooltip.Eskimo");
                tooltips[ItemID.EskimoCoat]  = ItemTooltip.FromLanguageKey("Mods.VanillaTweaks.ItemTooltip.Eskimo");
                tooltips[ItemID.EskimoPants] = ItemTooltip.FromLanguageKey("Mods.VanillaTweaks.ItemTooltip.Eskimo");
            }
            if (Config.PharaohSetTweak)
            {
                tooltips[ItemID.PharaohsMask] = ItemTooltip.FromLanguageKey("Mods.VanillaTweaks.ItemTooltip.Pharaoh");
                tooltips[ItemID.PharaohsRobe] = ItemTooltip.FromLanguageKey("Mods.VanillaTweaks.ItemTooltip.Pharaoh");
            }
            if (Config.CrimsonArmorTweak)
            {
                tooltips[ItemID.CrimsonHelmet]    = ItemTooltip.FromLanguageKey("Mods.VanillaTweaks.ItemTooltip.Crimson");
                tooltips[ItemID.CrimsonScalemail] = ItemTooltip.FromLanguageKey("Mods.VanillaTweaks.ItemTooltip.Crimson");
                tooltips[ItemID.CrimsonGreaves]   = ItemTooltip.FromLanguageKey("Mods.VanillaTweaks.ItemTooltip.Crimson");
            }
        }
コード例 #27
0
ファイル: Player.cs プロジェクト: bbroeking/artemis
    protected override void Start()
    {
        // Find All UI Objects
        uISingleton = UISingleton.Instance;
        soulPanel   = uISingleton.GetComponentInChildren <SoulPanel>();
        recapUI     = uISingleton.GetComponentInChildren <RecapUI>();
        relicUI     = uISingleton.GetComponentInChildren <RelicUI>();
        itemTooltip = uISingleton.GetComponentInChildren <ItemTooltip>();
        // itemSaveManager = FindObjectOfType<ItemSaveManager>(); TODO: Save System

        // Set UI
        soulPanel.SetTexts(this.souls);
        soulPanel.UpdateTextsValues();

        // TODO setting base values here is going to cause confusion
        map = new Room(new Vector2(0, 0), true, true, true, true); // default path
    }
コード例 #28
0
ファイル: ItemTooltip.cs プロジェクト: dvscheng/enth-unity
 void Awake()
 {
     #region Singleton Behaviour
     /* Singleton behaviour. */
     if (_instance == null)
     {
         _instance = this;
     }
     else if (_instance != this)
     {
         Destroy(gameObject);
         Destroy(this);
         return;
     }
     #endregion
     originalSize = rect.sizeDelta;
 }
コード例 #29
0
ファイル: ShopKeeper.cs プロジェクト: rpijpker01/IndieGame
    private void Awake()
    {
        _characterPanel = GameObject.Find("CharacterPanel");

        GameObject dialogue = _characterPanel.transform.parent.GetChild(3).transform.GetChild(0).gameObject;

        _dialogueParent = dialogue.GetComponent <Transform>();
        _dialogueText   = dialogue.GetComponentInChildren <Text>();
        _inventory      = _characterPanel.transform.parent.GetChild(3).transform.GetChild(1).gameObject;

        _itemTooltip = _characterPanel.transform.parent.GetChild(4).GetComponent <ItemTooltip>();
        _statTooltip = _characterPanel.transform.parent.GetChild(5).GetComponent <StatTooltip>();

        GameController.OnMouseLeftClickGameObject += OpenShop;

        _inventory.SetActive(false);
    }
コード例 #30
0
ファイル: Character.cs プロジェクト: Sanskrit84/Build-Area
    private void Start()
    {
        if (itemTooltip == null)
        {
            itemTooltip = FindObjectOfType <ItemTooltip>();
        }

        statPanel.SetStats(Health, Regeneration, Resistance, Vigour, Stamina, Recovery, Resilience, Hardiness, Cognition, Recall, Focus, Awareness, Morale, Courage, Fortitude, Determination, Strength, Agility, Intelligence, Vitality);
        statPanel.UpdateStatValues();

        uIHud.SetStats(Health, Regeneration, Resistance, Vigour, Stamina, Recovery, Resilience, Hardiness, Cognition, Recall, Focus, Awareness, Morale, Courage, Fortitude, Determination);
        uIHud.UpdateStatValues();

        //Setup Events
        //Right Click
        inventory.OnRightClickEvent      += InventoryRightClick;
        equipmentPanel.OnRightClickEvent += EquipmentPanelRightClick;
        //Pointer Enter
        inventory.OnPointerEnterEvent          += ShowTooltip;
        equipmentPanel.OnPointerEnterEvent     += ShowTooltip;
        craftingWindow.OnPointerEnterEvent     += ShowTooltip;
        workspaceInventory.OnPointerEnterEvent += ShowTooltip;

        //Pointer Exit
        inventory.OnPointerExitEvent          += HideTooltip;
        equipmentPanel.OnPointerExitEvent     += HideTooltip;
        craftingWindow.OnPointerExitEvent     += HideTooltip;
        workspaceInventory.OnPointerExitEvent += HideTooltip;

        //Begin Drag
        inventory.OnBeginDragEvent      += BeginDrag;
        equipmentPanel.OnBeginDragEvent += BeginDrag;

        //End Drag
        inventory.OnEndDragEvent      += EndDrag;
        equipmentPanel.OnEndDragEvent += EndDrag;

        //Drag
        inventory.OnDragEvent      += Drag;
        equipmentPanel.OnDragEvent += Drag;

        //Drop
        inventory.OnDropEvent      += Drop;
        equipmentPanel.OnDropEvent += Drop;
        dropItemArea.OnDropEvent   += DropItemOutsideUI;
    }
コード例 #31
0
ファイル: Character.cs プロジェクト: eduardoks98/Novo-Projeto
        private void Start()
        {
            if (itemTooltip == null)
            {
                itemTooltip = FindObjectOfType <ItemTooltip>();
            }
            statPanel.SetStats(Strength, Agility, Intelligence, Vitality);
            statPanel.UpdateStatValues();

            //Setup Events;
            //Right Click
            Inventory.OnRigtClickEvent      += InventoryRightClick;
            EquipmentPanel.OnRigtClickEvent += EquipmentPanelRightClick;

            //Pointer Enter
            Inventory.OnPointerEnterEvent      += ShowTooltip;
            EquipmentPanel.OnPointerEnterEvent += ShowTooltip;
            craftingWindow.OnPointerEnterEvent += ShowTooltip;

            //Pointer Exit
            Inventory.OnPointerExitEvent      += HideTooltip;
            EquipmentPanel.OnPointerExitEvent += HideTooltip;
            craftingWindow.OnPointerExitEvent += HideTooltip;

            //Begin Drag
            Inventory.OnBeginDragEvent      += BeginDrag;
            EquipmentPanel.OnBeginDragEvent += BeginDrag;

            //End Drag
            Inventory.OnEndDragEvet      += EndDrag;
            EquipmentPanel.OnEndDragEvet += EndDrag;

            //Drag
            Inventory.OnDragEvent      += Drag;
            EquipmentPanel.OnDragEvent += Drag;

            //Drop
            Inventory.OnDropEvent      += Drop;
            EquipmentPanel.OnDropEvent += Drop;
            dropItemArea.OnDropEvent   += DropItemOutSideUI;

            itemSaveManager.LoadEquipment(this);
            itemSaveManager.LoadInventory(this);
        }
コード例 #32
0
 void tooltip_Destroyed(BaseElement sender)
 {
     tooltip = null;
 }