function AjaxRequest(Url, Feedback, Arg) { Url = 'core/ajax/request/'+Url; if(window.XMLHttpRequest) Request = new XMLHttpRequest(); else if(window.ActiveXObject) Request = new ActiveXObject("Microsoft.XMLHTTP"); Request.onreadystatechange = function () { if(Request.readyState==4){ if(Request.status==200) { eval(Feedback); } else if(Request.status==404) { alert('Page introuvable'); } else { alert('Erreur inconnue.'); } } } Request.open("GET", Url, true); Request.send(null); }function XML2JS(xmlDoc) { var containerTag = 'page'; var Data = new Array(); var rawData = xmlDoc.getElementsByTagName(containerTag)[0]; for (i = 0; i < rawData.childNodes.length; i++) { if (rawData.childNodes[i].nodeType == 1) { Data[rawData.childNodes[i].tagName] = rawData.childNodes[i].firstChild.nodeValue; } } return Data; }function CreateGamespace() { SizeX = document.body.clientWidth; SizeY = document.body.clientHeight; document.getElementById('Gamespace').style.position = 'absolute'; document.getElementById('Gamespace').style.top = '0px'; document.getElementById('Gamespace').style.left = '0px'; document.getElementById('Gamespace').style.width = SizeX; document.getElementById('Gamespace').style.height = SizeY; document.getElementById('Gamespace').style.overflow = 'hidden'; document.body.style.background= GamespaceBg; }function ResizeGamespace(Repeat) { if(Repeat!=1) { setTimeout("ResizeGamespace(1);",50); } SizeX = document.body.clientWidth; SizeY = document.body.clientHeight; document.getElementById('Gamespace').style.width = SizeX; document.getElementById('Gamespace').style.height = SizeY; }function StartGamespace() { LockAction = 0; window.onresize = ResizeGamespace; document.onmousemove = MouseMove; document.onclick = MouseClick; document.onmouseup = Drop; setInterval("ScrollMap(ScrollY,ScrollX);",DefInterval); if(Locator==1) {CreateLocator();} }function CreateMap(SizeX, SizeY) { Map = '


| '; } MapStr += ' |
';
Loc += '';
Loc += '
';
ObjDiv = '
';
if(document.getElementById(ObjId) == null) {
document.getElementById(Map).innerHTML += Obj;
}
if(posX<0) {posX = 0;}
if(posY<0) {posY = 0;}
if(posX+50>MapSizeX) {posX = MapSizeX-50;}
if(posY+50>MapSizeY) {posY = MapSizeY-50;}
document.getElementById(ObjId).style.position = 'absolute';
document.getElementById(ObjId).style.left = posX;
document.getElementById(ObjId).style.top = posY;
}WinOpen = 0;
function CreateWin(WinSizeX,WinSizeY,Text,WinId,Centered,Overflow) {
if(Overflow == 1) {
Overflow = ' overflow: auto;';
}
if(document.getElementById(WinId)==null) {
SizeBox = WinSizeY-50;
Win = '';
document.getElementById('Window').innerHTML += Win;
WinOpen++;
} else {
if(document.getElementById(WinId).style.visibility == 'hidden') {
document.getElementById(WinId).style.visibility = 'visible';
WinOpen++;
}
}
}
function CloseWindow(WinId) {
document.getElementById(WinId).style.visibility = 'hidden';
WinOpen--;
}
WinFix = new Array();
WinDrag = '';
function Drag(WinId,Init) {
if(Init == 1) {
WinPosX = document.getElementById(WinId).style.left;
WinPosX = WinPosX.replace('px','');
WinPosX = WinPosX.replace('pt','');
WinPosY = document.getElementById(WinId).style.top;
WinPosY = WinPosY.replace('px','');
WinPosY = WinPosY.replace('pt','');
WinDecalX = MouseXCoord() - WinPosX;
WinDecalY = MouseYCoord() - WinPosY;
WinDrag = WinId;
}
if(WinDrag != '') {
WinFix[WinId] = setTimeout("Drag('"+WinId+"');",DefInterval);
document.getElementById(WinId).style.left = MouseXCoord()-WinDecalX*1;
document.getElementById(WinId).style.top = MouseYCoord()-WinDecalY*1;
}
if(WinLightDrag == 1) {
document.getElementById(WinId).style.MozOpacity = 1;
document.getElementById(WinId).filters.alpha.opacity = 100;
}
}
function Drop() {
if(WinDrag != '') {
if(WinLightDrag == 1) {
setTimeout("document.getElementById('"+WinDrag+"').style.MozOpacity = WinOpacity;",DefInterval);
setTimeout("document.getElementById('"+WinDrag+"').filters.alpha.opacity = WinOpacity*100;",DefInterval);
}
WinDrag = '';
}
}function CreateDialog(BoxX,BoxY,Text,BoxId) {
if(document.getElementById(BoxId)==null) {
TextBox = '
',18);
//crée un div de dialogue au point 100,100, d'id 18, contenant l'image spinner.gif
StickDialog(18,17);
//"colle" ce div à l'élémental
AjaxRequest('test.php','CreateDialog(100,100,Request.responseText,18);');
//appelle en arrière plan la page test.php, quand le résultalt arrive place dans le div de dialogue le contenu du fichier
}*/
}
function ActionOut(Id) {
}
//pour modifier le menu regarder dans le fichier index
//CreateWin(350,350,WinAbout(),'About');
//crée une fenêtre déplaçable d'id 'About' au point 350,350
//de contenu WinAbout(), fonction définie dans le fichier game/win/options.win.js
//si quelqu'un a une idée pour un menu plus ergonomique je suis preneur !
function WinOptions() {
Options = '';
if(ScrollSpeed < 0) {ScrollSpeed=0;}
Options += 'Scroll speed
';
Options += 'down ';
Options += ScrollSpeed;
Options += ' up';
Options += '
Mouse sensitivity
';
if (StaticZone == 0) {
Options += 'Scroll less';
} else {
Options += 'Scroll more';
}
Options += '
Cursor
';
if (DynCursor == 0) {
Options += 'Change cursor shape while scrolling';
} else {
Options += 'Do not change cursor shape while scrolling';
}
Options += '
Map borders
';
if (BorderLim == 0) {
Options += 'Show map borders';
} else {
Options += 'Keep focus on the map';
}
Options += '
Volumetric Lights
';
if (OverMask == 0) {
Options += 'On';
} else {
Options += 'Off';
}
Options += '
| ';
About += ' ForgotEngine ';
About += ' |