gump element tooltips

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.

Moderator: POL Developer

Post Reply
ThisIsMe
Distro Developer
Posts: 43
Joined: Sun Jul 17, 2016 1:29 am
Contact:

gump element tooltips

Post by ThisIsMe » Thu Aug 10, 2017 8:56 pm

So I have a small question and possible feature request if it is not yet available. I am in the process of creating a gump and want to utilize the tooltip functionality but with that in mind, I have some custom strings I want to display in the tooltip depending on the gump element being moused over.

For example, I want to use 1114057 which should allow me to add a custom string to be displayed but I can not figure out how to do this when it comes to the gump menu. I tried setting up an array and pushing the information into the GFTooltip function but was presented with tooltip displaying "Error (MegaCliloc) StringID Not Found : 0" so obviously that does not work.

So my question is, is there a way to add a custom string to a gump element's tooltip and if not would it be possible to add such functionality?

Update: Turley answered my question.

"tooltip 1114057 @my custom text@"

This seems to only work on clients above 6.x, as tested by Yukiko, I've updated the Gump pkg to allow for a custom string. Note, you have to use a cliloc that actually allows for it, as in it accepts arguments such as the aforementioned number.

Yukiko
Distro Developer
Posts: 2140
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: gump element tooltips

Post by Yukiko » Sat Aug 12, 2017 9:01 pm

Hehe. You beat me to it ThisIsMe. I was going to post the answer. So instead I'll post a sample gump script which demonstrates it as well as our ignorant (meaning 'we just didn't know') question about text wrap in gumps. A brief explanation is in order for our defense on the text wrap thing. For years we've dealt with using (interacting in-game with) gumps where there is a text "block" made up of several text entry lines where you had to click on the next line to continue adding text. So we "knew" text just didn't wrap in a gump. It never occurred to us to just make the text entry area taller than a single line of text. If there was a way to make the text wrap, we thought, then it would have been done by those before us who wrote those gump scripts. It's like when you train your German Shepard dog as a puppy not to jump over a 3 foot fence and when it grows up it "knows" it can't jump the fence even though it is capable of easily doing it. The old admintool is a good example of what I mean by the single line entry thing. The area where you can add a comment to n account is a multi-line box but they made each line a single text entry instead of making one tall text entry element.

Anyway, here is the simple gump script that demonstrates both ideas:

Code: Select all

use uo;
use os;

program gump_gump(who)

	var gump := array {
		"page 0",
		"resizepic 200 149 9200 382 218",
		"resizepic 281 173 9270 226 173",
		"textentry 300 187 192 143 88 0 0",
		"tooltip 1114057 @Enter text here@"
	};
	var data := array {
		""
	};

	SendDialogGump(who, gump, data);

endprogram
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

Duttones
Neophyte Poster
Posts: 39
Joined: Tue Mar 27, 2012 8:56 pm

Re: gump element tooltips

Post by Duttones » Sun Aug 13, 2017 1:53 pm

It is possible to use something like that for popupmenu ?

Yukiko
Distro Developer
Posts: 2140
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: gump element tooltips

Post by Yukiko » Sun Aug 13, 2017 9:18 pm

I'm not sure. Keep in mind the cliloc number chosen there has no fixed text. It only contains the "code" for substituting a value.

This is what you see if you SendSysMessageL the number: ~1_val~
Clilocs that allow additional text to be inserted will have similar text strings in them.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest