[ZeroBrane Studio] Re: Change the tooltip formatting via interpreter? How to distribute interpreter & api?

  • From: Paul K <paul@xxxxxxxxxxxxx>
  • To: "zerobrane@xxxxxxxxxxxxx" <zerobrane@xxxxxxxxxxxxx>
  • Date: Wed, 15 Oct 2014 10:48:49 -0700

Hi Jan,

> I know how to write the API definition itself, and it works well, but I find 
> the formatting of the tooltips to be really bad and would like to change that 
> within the interpreter (or API definition, if possible), so that each user 
> would have the same formatting of tooltips when using our interpreter.
> The question is: How? I can find no documentation on how that could be 
> achieved within an interpreter.

What would you change in the formatting? There are some options
related to tooltip generation (for example, you can specify the width
in characters), but other than that, it simply lays out the text you
have.

> but all the ** just appear as text. Having just plain text is much better 
> than nothing, but being able to make use of actual formatting in the tooltips 
> would bring this to a whole new level. Consider this a feature request if not 
> possible ;)

I agree, it would be interesting to support this, but unfortunately
it's not going to be easy, as this is something that Scintilla (the
editor component ZBS is using) provides and the content of the tooltip
is limited to one style (so it's not possible to make fragments of it
bold or italic). Here is Scintilla documentation on tooltips (call
tips in their terminology):
http://www.scintilla.org/ScintillaDoc.html#CallTips

> As a bonus question, how could these two .lua files be distributed in a way 
> with our game so that it is installed into the ZeroBrane directory 
> automatically when the game is installed/started.
> Is there an environment variable that has the path to the ZeroBrane folder?

The easiest way is to probably package them as a plugin (following
this documentation: http://studio.zerobrane.com/doc-plugin.html; there
sections on registering API and interpreter).

If you have them packaged as one plugin, you can then put that file
into $HOME/.zbstudio/packages/ folder and ZBS will recognize and load
the plugin.

Paul.

On Mon, Oct 13, 2014 at 7:03 AM, Jan Drabner <jan@xxxxxxxxxxx> wrote:
> Hey there,
>
> I am currently staring to write the api documentation for our engine/game in
> Lua.
> I know how to write the API definition itself, and it works well, but I find
> the formatting of the tooltips to be really bad and would like to change
> that within the interpreter (or API definition, if possible), so that each
> user would have the same formatting of tooltips when using our interpreter.
> The question is: How? I can find no documentation on how that could be
> achieved within an interpreter.
>
> Another question would be how to apply actual formatting in the tooltip?
> When I write something like "**Test**" in the description, it is not written
> in bold letters, but all the ** just appear as text. Having just plain text
> is much better than nothing, but being able to make use of actual formatting
> in the tooltips would bring this to a whole new level. Consider this a
> feature request if not possible ;)
>
> As a bonus question, how could these two .lua files be distributed in a way
> with our game so that it is installed into the ZeroBrane directory
> automatically when the game is installed/started.
> Is there an environment variable that has the path to the ZeroBrane folder?
>

Other related posts: