Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2014
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. <Zefram_Fysh> btw, I wanted to use tooltips describing item groups, for group ingredient buttons in the craft guide, but those are all item_image_button[], which doesn't support formspec-supplied tooltips. it'd be good to get that added to the engine
  2. <RealBadAngel> but then default ones (taken from item's desc) should be overriden, yes?
  3. <Zefram_Fysh> (this will also require the ability to register group descriptions alongside the representative items. better go to a register_group() facility with data table)
  4. <Zefram_Fysh> yes, item_image_button[] defaults to item description as tooltip (which is great), and I'd like the ability to override that default for a particular button
  5. <RealBadAngel> so if "tooltip" parameter is given then use it, otherwise same as before
  6. <Zefram_Fysh> yes
  7. <Zefram_Fysh> except for an edge case:
  8. <Zefram_Fysh> if I provide the ";" preceding the tooltip parameter, but then no actual tooltip text, is that supplying no tooltip and so getting the default, or is it supplying an empty tooltip that overrides the default?
  9. <Zefram_Fysh> I think for sanity that should get the default, but there should also be some way to explicitly suppress the tooltip. maybe by using some otherwise-unused formspec metachar in place of the parameter
  10. <RealBadAngel> it is supplyin empty tooltip
  11. <Zefram_Fysh> so item_image_button[0,0;1,1;default:stone;foo;] -> "Stone", item_image_button[0,0;1,1;default:stone;foo;;] -> "Stone", item_image_button[0,0;1,1;default:stone;foo;;Block] -> "Block", item_image_button[0,0;1,1;default:stone;foo;;,] -> no tooltip
  12. <RealBadAngel> ; will indicate that next parameter is given
  13. <RealBadAngel> "" empty string in this case
  14. <Zefram_Fysh> if empty field is treated as explicit empty tooltip, you have a problem if any more optional parameters get added
  15. <Zefram_Fysh> it would become impossible to supply the next optional parameter without overriding the tooltip
  16. <RealBadAngel> no, we just count parameters
  17. <RealBadAngel> ah that
  18. <RealBadAngel> indeed
  19. <Zefram_Fysh> I think all the current optional parameters have supplied-and-empty equivalent to not-supplied, one way or another. it would be good to maintain that equivalence
  20. <RealBadAngel> so lets say empty string is also not an overriding value
  21. <Zefram_Fysh> right
  22. <Zefram_Fysh> but then how do you override to no tooltip?
  23. <RealBadAngel> just wanted to say the same
  24. <Zefram_Fysh> that's why I favour using a metachar for that
  25. <Zefram_Fysh> oh, add to my list of examples: item_image_button[0,0;1,1;default:stone;foo;;\,] -> ","
  26. <Zefram_Fysh> I'm definitely going to need to be able to include an actual comma in tooltip text, for the default display of a multi-group ingredient spec
  27. <RealBadAngel> i can code it using 2 parameters
  28. <RealBadAngel> one bool and tooltip
  29. <RealBadAngel> bool to enable/disable overriding
  30. <Zefram_Fysh> ugly
  31. <Zefram_Fysh> but workable
  32. <Zefram_Fysh> actually, if you want to structure it as flag+string, better for them to be specified as comma-separated sub-parameters, rather than two completely separate parameters
  33. <Zefram_Fysh> so item_image_button[0,0;1,1;default:stone;foo;;1,Block] -> "Block", item_image_button[0,0;1,1;default:stone;foo;;1,] -> no tooltip, item_image_button[0,0;1,1;default:stone;foo;;0,] -> "Stone"
  34. <Zefram_Fysh> the coordinate parameters are obviously precedent for this sort of arrangement
  35. <RealBadAngel> true/false looks better than 0/1
  36. <Zefram_Fysh> if you like
  37. <Zefram_Fysh> is there precedent for truth value parameters?
  38. <Zefram_Fysh> ah, there's the noclip parameter for image_button
  39. <RealBadAngel> yes
  40. <Zefram_Fysh> lua_api doesn't say how that's encoded
  41. <Zefram_Fysh> anyway, this new truth value parameter should use the same encoding as noclip, whatever that is
  42. <RealBadAngel> so true/false
  43. <Zefram_Fysh> OK
  44. <RealBadAngel> i will code that today
  45. <Zefram_Fysh> thanks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement