Blockland Forums > Modification Help
My gui is messed up somehow?!?
tyler0:
it doesn't pop up :(
the problem is somewhere in the functions...\/
Client.cs
--- Code: ---exec("./Testgui.gui");
moveMap.bind(keyboard, "m", pushTestgui);
///////////////////////////////////
//Variables
$Msgs::Msg1T = "Empty";
$Msgs::Msg2T = "Empty";
$Msgs::Msg3T = "Empty";
$Msgs::Msg4T = "Empty";
$Msgs::Msg5T = "Empty";
$Msgs::CMsg1T = "Empty";
$Msgs::CMsg2T = "Empty";
$Msgs::BMsg1T = "Empty";
$Msgs::BMsg2T = "Empty";
$Msgs::Allmsgskb = "ctrl j";
$Msgs::Cmsgskb = "ctrl u";
$Msgs::Bmsgskb = "ctrl 7";
////////////////////////////////////
//Create File Or Open File
if(isFile("config/server/MsgPref2.1.cs"))
{
exec("config/server/MsgPref2.1.cs");
} else {
export("$Msgs::*","config/server/MsgPref2.1.cs");
}
///////////////////////////////////// Functions\/
//Functions
function Close()
{
canvas.popdialog(Shortcutmsgsgui);
export("$Msgs::*","config/server/MsgPref2.1.cs");
}
function Msg1s(%Client)
{
if(%Client.isAdmin || %Client.isSuperAdmin)
{
messageAll('', "<color:ffffff>" @ $Msgs::Msg1T);
export("$Msgs::*","config/server/MsgPref2.1.cs");
}
}
function Msg2s(%Client)
{
if(%Client.isAdmin || %Client.isSuperAdmin)
{
messageAll('', "<color:ffffff>" @ $Msgs::Msg2T);
export("$Msgs::*","config/server/MsgPref2.1.cs");
}
}
function Msg3s(%Client)
{
if(%Client.isAdmin || %Client.isSuperAdmin)
{
messageAll('', "<color:ffffff>" @ $Msgs::Msg3T);
export("$Msgs::*","config/server/MsgPref2.1.cs");
}
}
function Msg4s(%Client)
{
if(%Client.isAdmin || %Client.isSuperAdmin)
{
messageAll('', "<color:ffffff>" @ $Msgs::Msg4T);
export("$Msgs::*","config/server/MsgPref2.1.cs");
}
}
function Msg5s(%Client)
{
if(%Client.isAdmin || %Client.isSuperAdmin)
{
messageAll('', "<color:ffffff>" @ $Msgs::Msg5T);
export("$Msgs::*","config/server/MsgPref2.1.cs");
}
}
function CMsg1s(%Client)
{
if(%Client.isAdmin || %Client.isSuperAdmin)
{
centerPrintAll("<color:ffffff>" @ $Msgs::CMsg1T @ %targetClient.name,3,1);
export("$Msgs::*","config/server/MsgPref2.1.cs");
}
}
function CMsg2s(%Client)
{
if(%Client.isAdmin || %Client.isSuperAdmin)
{
centerPrintAll("<color:ffffff>" @ $Msgs::CMsg2T @ %targetClient.name,3,1);
export("$Msgs::*","config/server/MsgPref2.1.cs");
}
}
function BMsg1s(%Client)
{
if(%Client.isAdmin || %Client.isSuperAdmin)
{
bottomPrintAll("<color:ffffff>" @ $Msgs::BMsg1T @ %targetClient.name,3,1);
export("$Msgs::*","config/server/MsgPref2.1.cs");
}
}
function BMsg2s(%Client)
{
if(%Client.isAdmin || %Client.isSuperAdmin)
{
bottomPrintAll("<color:ffffff>" @ $Msgs::BMsg2T @ %targetClient.name,3,1);
export("$Msgs::*","config/server/MsgPref2.1.cs");
}
}
function Allmsgskbs(%Client)
{
$Msgs::Allmsgskb = $Msgs::Allmsgskb.text
export("$Msgs::*","config/server/MsgPref2.1.cs");
}
function Allmsgskbs(%Client)
{
$Msgs::Allmsgskb = $Msgs::Allmsgskb.text
export("$Msgs::*","config/server/MsgPref2.1.cs");
}
function Cmsgskbs(%Client)
{
$Msgs::Cmsgskb = $Msgs::Cmsgskb.text
export("$Msgs::*","config/server/MsgPref2.1.cs");
}
function Bmsgskbs(%Client)
{
$Msgs::Bmsgskb = $Msgs::Bmsgskb.text
export("$Msgs::*","config/server/MsgPref2.1.cs");
}
--- End code ---
pitfall:
I thick you need a function to open it.
Tom:
--- Code: ---if(!$SrvMessageBindsMapped)
{
$remapDivision[$remapCount] = "Server Messages";
$remapName[$remapCount] = "Open Message GUI";
$remapCmd[$remapCount] = "openMsgGUI";
$remapCount++;
$SrvMessageBindsMapped = 1;
}
function openMsgGUI(%var)
{
if(%var)
{
canvas.pushDialog(GUINAME);
}
}
--- End code ---
ZSNO:
--- Quote from: tyler0 on July 02, 2010, 01:01:53 AM ---
--- Code: ---function Close()
{
canvas.popdialog(Shortcutmsgsgui);
export("$Msgs::*","config/server/MsgPref2.1.cs");
}
--- End code ---
--- End quote ---
There might be some problems if you use that as a function
MegaScientifical:
--- Quote from: tyler0 on July 02, 2010, 01:01:53 AM ---
--- Code: ---exec("./Testgui.gui");
moveMap.bind(keyboard, "m", pushTestgui);
--- End code ---
--- End quote ---
Yep, "pushTestgui" doesn't exist.
--- Quote from: Tom on July 02, 2010, 01:22:48 PM ---
--- Code: ---if(!$SrvMessageBindsMapped)
{
$remapDivision[$remapCount] = "Server Messages";
$remapName[$remapCount] = "Test GUI";
$remapCmd[$remapCount] = "pushTestgui";
$remapCount++;
$SrvMessageBindsMapped = 1;
}
function pushTestgui(%var) {
if(%var)
canvas.pushDialog(pushTestgui);
}
--- End code ---
--- End quote ---
Edited his code a little.