• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Modify Item-Type Tooltips

Status
Not open for further replies.
Level 19
Joined
Aug 16, 2007
Messages
881
Has anyone figured out how to modify the tooltip of an item-type, if even possible? A workaround exists maybe?

The natives modifying item data only takes an item parameter, not item-type/integer.
native BlzSetItemExtendedTooltip takes item whichItem, string extendedTooltip returns nothing
 
Last edited:
Level 19
Joined
Aug 16, 2007
Messages
881
Nope, just like with modifying ability tooltips it only takes a specific item. You could write a system to achieve this functionality, but why do you need it?

I've made a crafting system based of items in a shop and whenever the player buys the same item again it gets upgraded. I would have liked to be able to dynamically adjust the tooltip to match the current upgraded value of the item, instead of having to create multiple versions of the same item.

Items are generated to the shop with native AddItemToStock takes unit whichUnit, integer itemId, integer currentStock, integer stockMax returns nothing.
 
Level 19
Joined
Aug 16, 2007
Messages
881
Are there any issues with adjusting the tooltip of the item that is bought immediately after the player buys the item?
No, that shouldn't be an issue, but it's also not really what I want to do.

As you can see in the image below I'd like to modify the tooltip of an item as it's displayed in the shop. The issue is that you can't access these items and modify the tooltip. They're not really items you can access, but are added as an item-type (integer). I'm not really sure how it operates.

WIP14.png
 
Level 20
Joined
Jul 12, 2010
Messages
1,719
You made the system yourself or it's from somebody else?

Not 100% sure but you need to find the frame with type "TEXT" and modify that locally for the player.

The code that creates the text should be something like this:
JASS:
local framehandle ItemDes = BlzCreateFrameByType("TEXT", "ItemDescription", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
and to modify it use local player:
JASS:
if GetLocalPlayer() == GetTriggerPlayer() then
    call BlzFrameSetText(ItemDes , "Your Item Description" )
endif
Also you should store the text in a string variable to allow easier modification.
You can try what I suggested but in the end you have to wait for @Tasyen to be sure :D
 
Last edited:
Status
Not open for further replies.
Top