Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <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
- <RealBadAngel> but then default ones (taken from item's desc) should be overriden, yes?
- <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)
- <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
- <RealBadAngel> so if "tooltip" parameter is given then use it, otherwise same as before
- <Zefram_Fysh> yes
- <Zefram_Fysh> except for an edge case:
- <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?
- <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
- <RealBadAngel> it is supplyin empty tooltip
- <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
- <RealBadAngel> ; will indicate that next parameter is given
- <RealBadAngel> "" empty string in this case
- <Zefram_Fysh> if empty field is treated as explicit empty tooltip, you have a problem if any more optional parameters get added
- <Zefram_Fysh> it would become impossible to supply the next optional parameter without overriding the tooltip
- <RealBadAngel> no, we just count parameters
- <RealBadAngel> ah that
- <RealBadAngel> indeed
- <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
- <RealBadAngel> so lets say empty string is also not an overriding value
- <Zefram_Fysh> right
- <Zefram_Fysh> but then how do you override to no tooltip?
- <RealBadAngel> just wanted to say the same
- <Zefram_Fysh> that's why I favour using a metachar for that
- <Zefram_Fysh> oh, add to my list of examples: item_image_button[0,0;1,1;default:stone;foo;;\,] -> ","
- <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
- <RealBadAngel> i can code it using 2 parameters
- <RealBadAngel> one bool and tooltip
- <RealBadAngel> bool to enable/disable overriding
- <Zefram_Fysh> ugly
- <Zefram_Fysh> but workable
- <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
- <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"
- <Zefram_Fysh> the coordinate parameters are obviously precedent for this sort of arrangement
- <RealBadAngel> true/false looks better than 0/1
- <Zefram_Fysh> if you like
- <Zefram_Fysh> is there precedent for truth value parameters?
- <Zefram_Fysh> ah, there's the noclip parameter for image_button
- <RealBadAngel> yes
- <Zefram_Fysh> lua_api doesn't say how that's encoded
- <Zefram_Fysh> anyway, this new truth value parameter should use the same encoding as noclip, whatever that is
- <RealBadAngel> so true/false
- <Zefram_Fysh> OK
- <RealBadAngel> i will code that today
- <Zefram_Fysh> thanks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement