d k daunkey kaung

This commit is contained in:
SandPoot
2024-01-03 22:42:03 -03:00
parent cb2251ea37
commit 7eaef36e11
106 changed files with 1683 additions and 936 deletions

View File

@@ -136,21 +136,29 @@
//alert(realIconSize + ' | ' +tooltip.tileSize + ' | ' + resizeRatio); //DEBUG
//Parse out the tile and cursor locations from params (e.g. "icon-x=32;icon-y=29;screen-loc=3:10,15:29")
const parameters = new Object();
//Parse out the contents of params (e.g. "icon-x=32;icon-y=29;screen-loc=3:10,15:29")
//It is worth noting that params is not always ordered in the same way. We therefore need to write the code
//To load their values in independantly of their order
var paramsA = tooltip.params.cursor.split(';');
if (paramsA.length < 3) {return false;} //Sometimes screen-loc is never sent ahaha fuck you byond
for (var i = 0; i < paramsA.length; i++) {
var entry = paramsA[i];
var nameAndValue = entry.split("=");
parameters[nameAndValue[0]] = nameAndValue[1];
}
//Sometimes screen-loc is never sent ahaha fuck you byond
if (!parameters["icon-x"] || !parameters["icon-y"] || !parameters["screen-loc"]) {
return false;
}
//icon-x
var iconX = paramsA[0];
iconX = iconX.split('=');
iconX = parseInt(iconX[1]);
var iconX = parseInt(parameters["icon-x"]);
//icon-y
var iconY = paramsA[1];
iconY = iconY.split('=');
iconY = parseInt(iconY[1]);
var iconY = parseInt(parameters["icon-y"]);
//screen-loc
var screenLoc = paramsA[2];
screenLoc = screenLoc.split('=');
screenLoc = screenLoc[1].split(',');
var screenLoc = parameters["screen-loc"];
screenLoc = screenLoc.split(',');
if (screenLoc.length < 2) {return false;}
var left = screenLoc[0];
var top = screenLoc[1];