ID:154984
 
Hey guys,

Is there anyway to make the stat panel moveable like any other grid?

Also is it possible to move the default area for basic verbs to show up to being in a grid?

I was trying something like this:

mob
Login()
..()
var/count = 1
for(var/x in typesof(/mob/verb))
count ++
src << output(x, "verbs:1,[count]")


However I can't really use those verbs.
Click() only registers in grids for objects. You would have to create an object for each verb, set it's Click() proc to call the verb, and output that object to the grid.
In response to Albro1 (#1)
Funny I actually tried that idea about an hour before it was mentioned here, but I must be doing it wrong?

mob
Login()
..()
var/count = 1
for(var/j in typesof(/mob/verb))
count ++
var/obj/button/o = new/obj/button
o.name = "[j]"
o.calltype = j
src << output(o, "verbs:1,[count]")




obj
button
icon = 'effects.dmi'
var
calltype
Click()
call(usr,calltype)()
In response to Speedro (#2)
Try giving the object an icon, and clicking it. Grids can be funny sometimes.
In response to Speedro (#2)
You're not storing the object anywhere, so it's being deleted. You can't click an object that doesn't exist anymore. Store 'em in a list, a global one if players can share them.

It's mentioned in the Skin reference, and there's a note in the online reference.
In response to DarkCampainger (#4)
Hah, that's it!

I remember doing it before when I was making a pokemon trading card game, but completely forgot! Thanks.

EDIT:

Final thing:

How might I remove a piece of the name, such as the typecasting that makes the options look ugly?

I tried this, expecting it not to work, and I was right:

mob
Login()
..()
var/count = 1
for(var/j in typesof(/mob/verb))
count ++
var/obj/button/o = new/obj/button
var/f = findtext("[j]","/mob/verb/")
var/q = j
q -= f
o.name = "[q]"
o.calltype = j
verblist += o
src << output(o, "verbs:1,[count]")
In response to Speedro (#5)
Speedro wrote:
Hah, that's it!

I remember doing it before when I was making a pokemon trading card game, but completely forgot! Thanks.

EDIT:

Final thing:

How might I remove a piece of the name, such as the typecasting that makes the options look ugly?

I tried this, expecting it not to work, and I was right:

mob
> Login()
> ..()
> var/count = 1
> for(var/j in typesof(/mob/verb))
> count ++
> var/obj/button/o = new/obj/button
> var/f = findtext("[j]","/mob/verb/")
> var/q = j
> q -= f
> o.name = "[q]"
> o.calltype = j
> verblist += o
> src << output(o, "verbs:1,[count]")


mob
Login()
..()
var/count = 1
for(var/j in typesof(/mob/verb))
count ++
var/obj/button/o = new/obj/button
var/f = findtext("[j]","/verb/")
var/q = copytext("[j]", f + 6)
o.name = "[q]"
o.calltype = j
verblist += o
src << output(o, "verbs:1,[count]")


That should work. findtext() returns the place where the search is in the text. In this case, it would return where the first / is. And since /verb/ is a total of 6 characters, we need to do f + 6. My math may be a bit off because of how late it is, but if I am incorrect then you just need to change 6 to 5. Then it will give you the name of the verb.
In response to Albro1 (#6)
Thank you!