Guest User

ItemMessage

a guest
Feb 3rd, 2024
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. extends CanvasLayer
  2.  
  3. @onready var message = $Message
  4.  
  5.  
  6. func send_message(item):
  7. message.append_text(set_hint(item))
  8. message.append_text(set_image(item) + '\n')
  9.  
  10. func set_image(item):
  11. return "[img=16x16]"+ item.path +"[/img]"
  12.  
  13. func set_hint(item):
  14. var text = "[hint=%s]%s[/hint]" % [item.description, item.name]
  15.  
  16. match item.rarity:
  17. "Rare":
  18. text = "[color=blue]" + text + "[/color]"
  19. "Epic":
  20. text = "[wave amp=15 freq=5][color=purple]" + text + "[/color][/wave]"
  21. "Legendary":
  22. text = "[tornado radius=1 freq=4][color=yellow]" + text + "[/color][/tornado]"
  23.  
  24. return text
  25.  
Add Comment
Please, Sign In to add comment