Ajaxed Moral V1.1
V1.1
Small update, now the moral has the percent %
Screen
Took me some hours but i finally finished this tool, all it does it to display the moral onmouseover a village from the map(karte).
This tool is harder to install, i'll explain bellow how to do this:
1. download the archive and uncompress it in htdocs
2. Replace this from script.js
With this
Save and close
3. Open templates/game_map.tpl
Find
After add
Find
Replace With
Save and Close
Done, you have finished
Download
Download From Rapidshare
V1.1
Small update, now the moral has the percent %
Screen
Took me some hours but i finally finished this tool, all it does it to display the moral onmouseover a village from the map(karte).
This tool is harder to install, i'll explain bellow how to do this:
1. download the archive and uncompress it in htdocs
2. Replace this from script.js
Code:
function map_popup(title, points, owner, ally, village_groups) {
map_move();
setText(gid("info_title"), title);
setText(gid("info_points"), points);
if(owner != null) {
setText(gid("info_owner"), owner);
gid("info_owner_row").style.display = '';
gid("info_left_row").style.display = 'none';
}
else {
gid("info_owner_row").style.display = 'none';
gid("info_left_row").style.display = '';
}
if(ally != null) {
gid("info_ally_row").style.display = '';
setText(gid("info_ally"), ally);
}
else {
gid("info_ally_row").style.display = 'none';
}
if(village_groups) {
gid("info_village_groups_row").style.display = '';
setText(gid("info_village_groups"), village_groups);
} else {
gid("info_village_groups_row").style.display = 'none';
}
var info = gid("info");
info.style.visibility = "visible";
}
With this
Code:
var xmlhttp;
function map_popup(title, points, owner, ally, village_groups,x,y,origin_id){
map_move();
//ajax moral
xmlhttp=GetXmlHttpObject();
var url="AlexDS_proc.php?page=1&x="+x+"&y="+y+"&id="+origin_id+"&sid="+Math.random();
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){gid('moral').innerHTML=xmlhttp.responseText;}}
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
//end of ajax moral
setText(gid("info_title"), title);
setText(gid("info_points"), points);
if(owner != null) {
setText(gid("info_owner"), owner);
gid("info_owner_row").style.display = '';
gid("info_left_row").style.display = 'none';
}
else {
gid("info_owner_row").style.display = 'none';
gid("info_left_row").style.display = '';
}
if(ally != null) {
gid("info_ally_row").style.display = '';
setText(gid("info_ally"), ally);
}
else {
gid("info_ally_row").style.display = 'none';
}
if(village_groups) {
gid("info_village_groups_row").style.display = '';
setText(gid("info_village_groups"), village_groups);
} else {
gid("info_village_groups_row").style.display = 'none';
}
var info = gid("info");
info.style.visibility = "visible";
}
function GetXmlHttpObject(){if(window.XMLHttpRequest){return new XMLHttpRequest();}if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP");}return null;}
3. Open templates/game_map.tpl
Find
Code:
<tr id="info_village_groups_row"><td>Gruppen:</td><td id="info_village_groups">village_groups</td></tr>
After add
Code:
<tr><td>Moral</td><td id='moral'></td></tr>
Find
Code:
map_popup('{$cl_map->getVillage($x,$y,"name")}({$x}|{$y}) K{$cl_map->getcon($x,$y)}', {$cl_map->getvillage($x,$y,points)}, {$cl_map->playerinfo($x,$y)}, {$cl_map->getally($x,$y)}, false)
Replace With
Code:
map_popup('{$cl_map->getVillage($x,$y,"name")} ({$x}|{$y}) K {$cl_map->getcon($x,$y)}', {$cl_map->getvillage($x,$y,points)}, {$cl_map->playerinfo($x,$y)}, {$cl_map->getally($x,$y)}, false,{$x},{$y},{$village.id})
Save and Close
Done, you have finished
Download
Download From Rapidshare