View Single Post
  #1  
Old 05-16-2009, 11:39 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Post Guide: Naming GUI Controls

I've seen a lot of people doing this lately, and I wanted to let them know that it should be done differently in nearly all cases.

Rather than naming your GUI windows (and other controls) such as

PHP Code:
new GuiWindowCtrl("Window") {
  
// whatever

put part of the thing you're creating it in

PHP Code:
new GuiWindowCtrl("JailInformation_Window") {
 
// whatever

The reason this matters is because if you name your buttons things like "Button1" and "Close", which I've seen a lot of people doing, any script that has

PHP Code:
function Button1.onAction() {
  
triggerserver("gui"name"summonAllPlayers");

or any other function having to do with that button would be called, not just the script that created it.

Lesson's over, thanks for reading.
__________________
Reply With Quote