ID:157610
 
I have seen in many games where instead of having to place in RGB values, you simply click on a button and a full funtioning diamond shaped color wheel comes up that looks just like the one in paint. I was wondering if somebody could explain to me how I would go about putting one of these into a game.
Never actually figured this out, bump? :D
Odd. Only shades of blue are showing up. No matter what color the skin starts as.
mob
verb
setbgcolor(c as color)
set hidden = 1
winset(usr,"default","background-color=[bgcolor]")
bgcolor = 0
mob/var
tmp
bgcolor = 0

And here it randomizes
mob
verb
setbgcolor(c as color)
set hidden = 1
winset(usr,"default","background-color=[bgcolor]")
bgcolor = c
mob/var
tmp
bgcolor = 0

<big><big>EDIT:</big></big>
I got it, bad order!
mob
verb
setbgcolor(c as color)
set hidden = 1
bgcolor = c
winset(usr,"default","background-color=[bgcolor]")

mob/var
tmp
bgcolor = 0
These aren't meshing with my current OOC code, any idea how to fix that?
In response to SRI
Here SRI:
mob
verb
colorchangeooc(T as color)

txtcolor = T
winset(usr,"output1","text-color=[txtcolor]")
//output1 is the name of the output box you have where you
//have the text sent. this can be modded to use for input too.


mob/var/txtcolor = 0

mob/Write(var/savefile/F)
..()

mob/Read(var/savefile/F)
..()
loc = locate(F["x"], F["y"], F["z"])
if(client)//if they are the client use the previous color that was saved when they log out
winset(usr,"output1","text-color=[txtcolor]")

mob/verb/ooc(Msg as text)
view() << "\icon[usr] [usr] says, '[Msg]'"
mob
Login()
var/savefile/F = new(ckey)
Read(F)
return ..()
mob
Logout()
var/savefile/F = new(ckey)
Write(F)
del(src)


For skin refrence, check here.
http://www.byond.com/docs/ref/skinparams.html
Also, read about winset in reference

Just set up a skin with an input, an output, and an info. set them to default and have them match the proper names in code.
In response to Darkjohn66
Don't use usr in procs.

You aren't saving into the x,y,z keys in Write(), so reading from them won't work.

Don't call Read() and Write() directly.

Please stop attempting to help people. You've been giving consistently bad advice.
In response to Garthor
Garthor wrote:
Don't use usr in procs.

You aren't saving into the x,y,z keys in Write(), so reading from them won't work.

Don't call Read() and Write() directly.

Please stop attempting to help people. You've been giving consistently bad advice.
I would rather have somebody give me bad advice then sit there with my question unanswered. Or if i did have bad advice, I would hate to think think that I have a new post that may help even more so I read it but see negativity against the other persons' effort to help them. Yes I did make those errors/mistakes, but passing in a paper and getting a 30/100 is better then not passing anything in. And I aplogize if I'm coming off as an (insert word here) here, take it with a grain of salt.
In response to Darkjohn66
Because we're on the subject of absurd metaphors: I'd rather have no house than have a house that collapses and kills me. Your analogy does not apply because you are not writing to demonstrate your own ability, you are telling people what to do, which is a whole different kettle of fish.

Providing wrong help is worse than providing no help. It creates more work for people looking to actually HELP people because now they have to go around correcting not only the person asking for help, but the people supposedly helping them. If they don't do that, then the person originally asking for help is going to create a new thread asking for help with their supposed help.

Of course, even worse is advice that is insidiously wrong, like using usr in procs. In these cases, you have an error that the person won't even KNOW ABOUT, and so doesn't know to ask for help with it. Only later, when something breaks it, will they realize there's a problem, but they will have no clue where that problem is, and it is a pain in the ass for them (or anybody helping them) to fix it.

Furthermore, you get a snowball effect of bad advice. People give bad advice to people who then think they're qualified to give bad advice to more people. This take an unbelievable amount of work to fix (in particular, usr abuse still hasn't gone away and we've been trying to get people to stop it for literally years now).

And finally, your stupid "BUT IT DOESN'T HURT / I CAN DO WHAT I WANT" crap made me write all of THIS, and put me in a bad mood. Thanks, guy.

In short: shut up. If you care to provide advice, then take the time to ensure it's correct.
In response to Garthor
Is there ever a reason to use usr outside of verbs defined for an atom where the usr is not the atom it is defined for? It would be nice to put an end to wanton usr usage.
In response to Garthor
ok dude I didnt mean to offend you so badly by attempting to be a help to others...sorry
In response to EGUY

A nice guide made long ago but still useful today:
Dream Tutor: usr Unfriendly
http://www.byond.com/members/ DreamMakers?command=view_post&post=35932
In response to Pirion
I got this down so if anybody wants to use it go ahead.

mob
verb
setbgcolor(c as color)
set hidden = 1
bgcolor = c
winset(src,"default","background-color=[bgcolor]")


mob/var/bgcolor = 0
//////////////////////////////////////////////////
mob
var/buttoncolortxt = 0
verb
btntalktxt(z as color)
set hidden = 1
buttoncolortxt = z
winset(src,"btnooc","text-color=[buttoncolortxt]")
winset(src,"btnsay","text-color=[buttoncolortxt]")
winset(src,"btnsquad","text-color=[buttoncolortxt]")
winset(src,"btnwhisper","text-color=[buttoncolortxt]")

To save:
mob/Write(var/savefile/F)
..()
F["x"] << x
F["y"] << y
F["z"] << z

mob/Read(var/savefile/F)
..()
loc = locate(F["x"], F["y"], F["z"])
if(client)
winset(src,"default","background-color=[bgcolor]")
winset(src,"btnooc","text-color=[buttoncolortxt]")
winset(src,"btnsay","text-color=[buttoncolortxt]")
winset(src,"btnsquad","text-color=[buttoncolortxt]")
winset(src,"btnwhisper","text-color=[buttoncolortxt]")


Oh and also somebody (maybe I will) unless its been done should write a guide on naming skin items like visual basic does so you don't lose track of them.
In response to Darkjohn66
Darkjohn66 wrote:
Yes I did make those errors/mistakes, but passing in a paper >and getting a 30/100 is better then not passing anything in.

Either way it's a 30 percent which is an F and a failing paper...