Author Topic: My gui is messed up somehow?!?  (Read 685 times)

it doesn't pop up :(

the problem is somewhere in the functions...\/
Client.cs
Code: [Select]
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");
}


I thick you need a function to open it.

Tom

Code: [Select]
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);
}
}

Code: [Select]
function Close()
{
canvas.popdialog(Shortcutmsgsgui);
export("$Msgs::*","config/server/MsgPref2.1.cs");
}
There might be some problems if you use that as a function

Code: [Select]
exec("./Testgui.gui");
moveMap.bind(keyboard, "m", pushTestgui);

Yep, "pushTestgui" doesn't exist.

Code: [Select]
if(!$SrvMessageBindsMapped)
{
$remapDivision[$remapCount] = "Server Messages";
$remapName[$remapCount] = "Test GUI";
$remapCmd[$remapCount] = "pushTestgui";
$remapCount++;
$SrvMessageBindsMapped = 1;
}

function pushTestgui(%var) {
if(%var)
canvas.pushDialog(pushTestgui);
}

Edited his code a little.

Tom

You might want to use arrays to store your messages. Here is an example:
Code: [Select]
$var[1] = "A";
$var[2] = "B";
$var[3] = "C";
$var[4] = "D";

function ABCs()
{
for(%i = 1; %i < 4;%i++)
{
echo($var[%i]);
}
}
[code]
[/code]

You might want to use arrays to store your messages. Here is an example:
Code: [Select]
$var[1] = "A";
$var[2] = "B";
$var[3] = "C";
$var[4] = "D";

function ABCs()
{
for(%i = 1; %i < 4;%i++)
{
echo($var[%i]);
}
}

Why the echoing command?! Being Ephialtes

ok so i put this in bottom of testgui.gui

Code: [Select]
exec("./Testgui.gui");
if(!$SrvMessageBindsMapped)
{
$remapDivision[$remapCount] = "Server Messages";
$remapName[$remapCount] = "Test GUI";
$remapCmd[$remapCount] = "pushTestgui";
$remapCount++;
$SrvMessageBindsMapped = 1;
}

put this in client.cs
Code: [Select]
function pushTestgui(%var) {
if(%var)
canvas.pushDialog(pushTestgui);
}
« Last Edit: July 02, 2010, 08:15:12 PM by tyler0 »