<?php
include_once "../../../site.class.php";
include_once $PATH_TO_CODE."/modules/dungeon/dungeonconstante.class.php";
include_once $PATH_TO_CODE."/modules/dungeon/unit/dungeonrealobject.class.php";
include_once $PATH_TO_CODE."/modules/dungeon/dungeonconstante.class.php";
include_once $PATH_TO_CODE."/script/connect.php";
include_once $PATH_TO_CODE."/script/fonction.php";
?>
<html>
<head>
<title>Dungeon: The underground - Map</title>
<head>
<TITLE>Dungeon</TITLE>
<?php echoBaseHead()?>
<script type="text/javascript" src="script/javascript/fonction.js"></script>
</head>
<body class="dungeonstyle">
level to show : <select
id="strategicMapZ"
onchange="refreshStrategicMap()">
<?php
for($i = Constante::getMaxZ(); $i >= Constante::getMinZ(); $i--) {
echo "<option value='$i'";
if($i == Constante::getMinZ()+1) {
echo " SELECTED ";
$locZSelected = $i;
}
echo ">";
echo Constante::normalizeZ($i)."</option>";
}
?>
</select>
red color <select
id="strategicMapRedPlayerId"
onchange="refreshStrategicMap()">
<option value="-1">any</option>
<?php echoOptionsWithPlayerNameAndPlayerId();?>
</select>
green color <select
id="strategicMapGreenPlayerId"
onchange="refreshStrategicMap()">
<option value="-1">any</option>
<?php echoOptionsWithPlayerNameAndPlayerId();?>
</select>
blue color <select
id="strategicMapBluePlayerId"
onchange="refreshStrategicMap()">
<option value="-1">any</option>
<?php echoOptionsWithPlayerNameAndPlayerId();?>
</select>
<br/>
<img
id="strategicMapImage"
onclick='javascript:centerOnZoneWithStrategicMap(event);'
src="modules/dungeon/map/maprender.php?z=<?php echo $locZSelected;?>" />
<?php
showRequestInTable(array("player", "0x", "color"),
"SELECT DISTINCT player.login, player.color
FROM player, block
WHERE block.playerId=player.playerId", false, false);
?>
</body>
</html>
<script type="text/javascript">
function refreshStrategicMap() {
var sourceImage='modules/dungeon/map/maprender.php?z='+wdgId('strategicMapZ').options[wdgId('strategicMapZ').selectedIndex].value;
sourceImage=sourceImage+"&redPlayerId="+wdgId('strategicMapRedPlayerId').options[wdgId('strategicMapRedPlayerId').selectedIndex].value;
sourceImage=sourceImage+"&greenPlayerId="+wdgId('strategicMapGreenPlayerId').options[wdgId('strategicMapGreenPlayerId').selectedIndex].value;
sourceImage=sourceImage+"&bluePlayerId="+wdgId('strategicMapBluePlayerId').options[wdgId('strategicMapBluePlayerId').selectedIndex].value;
sourceImage=sourceImage+"&imageSize=800";
wdgId('strategicMapImage').src=sourceImage;
}
function centerOnZoneWithStrategicMap(parEvent) {
if (typeof(gloMap) != "undefined") {
var locX = findPosX(wdgId('strategicMapImage'));
var locY = findPosY(wdgId('strategicMapImage'));
var locMouseX = parEvent.pageX;
var locMouseY = parEvent.pageY;
var locImageWidth = wdgId('strategicMapImage').width;
var locImageHeight = wdgId('strategicMapImage').height;
var locDiffX = (locMouseX-locX)/locImageWidth;
var locDiffY = (locMouseY-locY)/locImageHeight;
var locX = locDiffX*<?php echo Constante::getWorldWidthInZone()?>+<?php echo Constante::getMinX()?>;
var locY = <?php echo Constante::getMaxY()?>-locDiffY*<?php echo Constante::getWorldHeightInZone()?>;
var locZ = wdgId('strategicMapZ').options[wdgId('strategicMapZ').selectedIndex].value;
centerToZone(locX, locY, locZ);
}
}
refreshStrategicMap();
</script>