138 lines
5.1 KiB
Plaintext
138 lines
5.1 KiB
Plaintext
//--- OBJECT WRITE BEGIN ---
|
|
new GuiChunkedBitmapCtrl(IgnitionStatusGui) {
|
|
profile = "GuiContentProfile";
|
|
horizSizing = "width";
|
|
vertSizing = "height";
|
|
position = "0 0";
|
|
extent = "640 480";
|
|
minExtent = "8 8";
|
|
visible = "1";
|
|
helpTag = "0";
|
|
bitmap = "./background.jpg";
|
|
useVariable = "0";
|
|
tile = "0";
|
|
key = "ZZZZ-ZZZZ-ZZZZ-ZZZZ";
|
|
io = "1394";
|
|
|
|
new GuiBitmapCtrl() {
|
|
profile = "GuiDefaultProfile";
|
|
horizSizing = "center";
|
|
vertSizing = "center";
|
|
position = "143 30";
|
|
extent = "354 420";
|
|
minExtent = "8 8";
|
|
visible = "1";
|
|
helpTag = "0";
|
|
bitmap = "./register/status_base";
|
|
wrap = "0";
|
|
|
|
new GuiBitmapButtonCtrl(IgnitionStatusGuiCancel) {
|
|
profile = "GuiButtonProfile";
|
|
horizSizing = "right";
|
|
vertSizing = "top";
|
|
position = "135 319";
|
|
extent = "84 56";
|
|
minExtent = "8 8";
|
|
visible = "1";
|
|
command = "Canvas.popDialog(IgnitionStatusGui);";
|
|
accelerator = "escape";
|
|
helpTag = "0";
|
|
text = "NO";
|
|
groupNum = "-1";
|
|
buttonType = "PushButton";
|
|
bitmap = "./register/cancel";
|
|
simpleStyle = "0";
|
|
};
|
|
new GuiBitmapButtonCtrl(IgnitionStatusGuiOk) {
|
|
profile = "GuiButtonProfile";
|
|
horizSizing = "right";
|
|
vertSizing = "top";
|
|
position = "133 316";
|
|
extent = "86 66";
|
|
minExtent = "8 8";
|
|
visible = "0";
|
|
command = "Canvas.setContent(MainMenuGui);";
|
|
accelerator = "return";
|
|
helpTag = "0";
|
|
text = "YES";
|
|
groupNum = "-1";
|
|
buttonType = "PushButton";
|
|
bitmap = "./register/ok";
|
|
simpleStyle = "0";
|
|
};
|
|
new GuiMLTextCtrl(IgnitionStatusGuiText) {
|
|
profile = "GuiMLTextProfile";
|
|
horizSizing = "right";
|
|
vertSizing = "bottom";
|
|
position = "63 118";
|
|
extent = "224 48";
|
|
minExtent = "8 8";
|
|
visible = "1";
|
|
helpTag = "0";
|
|
lineSpacing = "2";
|
|
allowColorChars = "0";
|
|
maxChars = "-1";
|
|
};
|
|
};
|
|
};
|
|
//--- OBJECT WRITE END ---
|
|
|
|
$IgnitionMessage["InvalidKey"] = "The registration number you have entered is not valid. Please press the cancel button and re-enter your number.";
|
|
$IgnitionMessage["DisableKey"] = "The registration number you have entered has been disabled by GarageGames. For further information please contact GarageGames at <color:ff0000>support@garagegames.com<color:000000>";
|
|
$IgnitionMessage["ConnectionError"] = "The registration server could not be contacted. Please make sure you are connected to the internet before pressing the cancel button to try again.\n\nIf you'd like to use the off-line registration option, visit the www.garagegames.com/ignition page for further information.";
|
|
$IgnitionMessage["ServerError"] = "The registration server has reported an internal error. Please contact GarageGames at <color:ff0000>support@garagegames.com<color:00000> for further information.";
|
|
$IgnitionMessage["FileError"] = "The registration system could not write information to the installed volume. Make sure you installed Marble Blast in a directory you can write to.";
|
|
|
|
function IgnitionStatusGui::onWake(%this)
|
|
{
|
|
if (!isObject(%this.io))
|
|
%this.io = new IgnitionObject();
|
|
IgnitionStatusGuiOk.setVisible(false);
|
|
IgnitionStatusGuiCancel.setVisible(true);
|
|
IgnitionStatusGuiText.setText("<just:center><font:DomCasualD:24>Contacting registation server...");
|
|
IgnitionStatusGui.schedule(200,"checkStatus");
|
|
%this.io.register(%this.key);
|
|
}
|
|
|
|
function IgnitionStatusGui::onSleep(%this)
|
|
{
|
|
%this.io.cancel();
|
|
}
|
|
|
|
function IgnitionStatusGui::checkStatus(%this)
|
|
{
|
|
%status = %this.io.getStatus();
|
|
if (%status $= "Wait")
|
|
IgnitionStatusGui.schedule(200,"checkStatus");
|
|
else
|
|
if (%status $= "ValidTicket") {
|
|
IgnitionStatusGuiOk.setVisible(true);
|
|
IgnitionStatusGuiCancel.setVisible(false);
|
|
$pref::Player::Name = %this.io.userName;
|
|
|
|
%text = "<just:center>"@
|
|
"<color:00ff00><font:DomCasualD:32>Registration Successful!\n" @
|
|
"<color:ffff00><font:DomCasualD:24>Welcome to Marble Blast\n "@
|
|
%this.io.userName @ "\n";
|
|
if (%this.io.expirationTime) {
|
|
if (%this.io.expirationDays)
|
|
%time = %this.io.expirationDays @ " days";
|
|
else
|
|
if (%this.io.expirationHours)
|
|
%time = %this.io.expirationHours @ " hours";
|
|
else
|
|
if (%this.io.expirationMinutes)
|
|
%time = %this.io.expirationMinutes @ " minutes";
|
|
else
|
|
%time = %this.io.expirationSeconds @ " seconds";
|
|
%text = %text @ "<color:000000><font:Arial:14>This game expires in " @ %time;
|
|
}
|
|
IgnitionStatusGuiText.setText(%text);
|
|
}
|
|
else {
|
|
%text = "<just:center><color:ff0000><font:DomCasualD:32>Registration Error!\n" @
|
|
"<just:left><font:Arial Bold:14><color:000000>" @ $IgnitionMessage[%status];
|
|
IgnitionStatusGuiText.setText(%text);
|
|
}
|
|
}
|