After some thinking, I ain't really going to use this warp menu, but some of you guys might! Here is the code. Better to give than to keep and forget!
PHP Code:
function onActionServerSide() {
if (params[0] == "3") {
setlevel2("lexia_store1.nw", 31, 42.68);
}
if (params[0] == "1") {
setlevel2("lexia_osl.nw", serveroptions.unstickmex, serveroptions.unstickmey);
}
if (params[0] == "2") {
setlevel2("lexia-lumber.gmap", 30, 30);
}
}
//#CLIENTSIDE
function onCreated() {
this.menu_on = false;
setTimer(0.05);
GraalControlhasfocus();
this.selected = "MenuText1";
}
function onTimeout() {
if (this.menu_on == true) {
showMenu();
}
if (this.menu_on == false) {
hidemenu();
}
setTimer(0.05);
}
function ShowMenu() {
new GuiShowImgCtrl("Menu") {
x = 0;
y = 0;
width = GraalControl.width;
height = GraalControl.height;
polygon = {
0, 0, width, 0, width, height, 0, height
};
red = green = blue = 0;
alpha = 0.8;
new GuiShowImgCtrl("MenuText1") {
x = GraalControl.width / 2;
y = GraalControl.height / 2;
text = "Warp to OSL";
style = "b";
height = 150;
zoom = 0.75;
font = "Tempsitc";
width = 150;
}
new GuiShowImgCtrl("MenuText2") {
x = GraalControl.width / 2;
y = GraalControl.height / 2 + 20;
text = "Warp to Lumbering";
style = "b";
height = 150;
zoom = 0.75;
font = "Tempsitc";
width = 150;
}
new GuiShowImgCtrl("MenuText3") {
x = GraalControl.width / 2;
y = GraalControl.height / 2 + 40;
text = "Warp to Store";
style = "b";
height = 150;
zoom = 0.75;
font = "Tempsitc";
width = 150;
}
new GuiShowImgCtrl("MenuTextArr") {
x = GraalControl.width / 2 - 10;
text = ">";
style = "b";
height = 150;
zoom = 0.75;
font = "Tempsitc";
width = 15;
}
}
}
function HideMenu() {
Menu.visible = false;
}
function onKeyPressed(code, Key) {
if (Key == "[") {
this.menu_on = true;
Menu.visible = true;
}
if (Key == "]") {
this.menu_on = false;
}
}
function MenuText1.onMouseDown() {
triggerserver("gui", this.name, "1");
MenuText3.alpha = 0.7;
MenuText1.alpha = 1;
MenuText2.alpha = 0.7;
MenuTextArr.y = GraalControl.height / 2;
this.selc = MenuText1;
}
function MenuText2.onMouseDown() {
triggerserver("gui", this.name, "2");
MenuText3.alpha = 0.7;
MenuText1.alpha = 0.7;
MenuText2.alpha = 1;
MenuTextArr.y = GraalControl.height / 2 + 20;
this.selc = MenuText2;
}
function MenuText3.onMouseDown() {
triggerserver("gui", this.name, "3");
MenuText3.alpha = 1;
MenuText1.alpha = 0.7;
MenuText2.alpha = 0.7;
MenuTextArr.y = GraalControl.height / 2 + 40;
this.selc = MenuText3;
}