GUI Button script... wierdness.

Started by Snake, Fri 05/06/2009 12:51:08

Previous topic - Next topic

Snake

I'm currently making another GUI with two buttons. This is my second GUI.

When I double click the button to go to it's script, I get shipped over to the other GUI's button script where there's already code in it. Shouldn't it bring me to a brand new script?

I've tried renaming the button from button1 to it's own name, but I still get the same results.

What's going on?
Grim: "You're making me want to quit smoking... stop it!;)"
miguel: "I second Grim, stop this nonsense! I love my cigarettes!"

Matti

I had that problem too, once. I think it was when I ex- and imported (=copied) a GUI. Although all the buttons of the second GUI had a "2" at the end of their names, I was directed to the code of the old buttons.

Hm, I can't really remember what I did back then but I tried around and it didn't took me long to solve the problem. Jutst try things like completely erasing the code for the old button and the line before the ellipses button in the panel (not without saving it of course). And then make a new action for both the new and the old button.

Or something like that.... can't really remember to be honest  ::)

Snake

#2
But I didn't do anything like copying any GUIs. All I did was make a new one like any other.

It also seems the first button is always called Button2.

There are three buttons. One is just for a picture and isn't clickable, the other two will have scripts.

//--EDIT--//
Forget it. I don't know what the hell I did so different this time, but it's finally bringing me to empty code space...
Grim: "You're making me want to quit smoking... stop it!;)"
miguel: "I second Grim, stop this nonsense! I love my cigarettes!"

GuyAwesome

It sounds like you had the two buttons running off the same script somehow*, which is probably also what happened to Mr Matti for different reasons.

If it happens again, try this:
In the GUI editor, select the second clickable button (the one with the 'wierdness') and click the 'Events' tab (the lightning flash above the properties box). Delete the name of the script function next to OnClick (probably Button1_OnClick, or something similar), and you should be able to double-click the button and create its own script.

* If they both had the same name (like the default 'Button1/2/etc') the first time you double-clicked them they'll both try to use the same 'ButtonX_OnClick', even though you've renamed them since. If that's not what you did, hopefully the fix should still work.

Khris

It looks like not every minor change is immediately completely reflected by the editor, which is understandable and forgivable. Closing and re-opening the GUI's tab should do the trick.

SMF spam blocked by CleanTalk