Thread Rating:
  • 5 Vote(s) - 3.4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ajaxed Moral
#1
Ajaxed Moral V1.1

V1.1
Small update, now the moral has the percent %


Screen
[Image: moralupdated.th.png]

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;}
Save and close

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 Wink

Download
Download From Rapidshare
Reply


Messages In This Thread
Ajaxed Moral - by hip_hop_x - 08.08.2009, 03:22
RE: Ajaxed Moral - by Black Arrow - 08.08.2009, 07:35
RE: Ajaxed Moral - by knollenmax - 08.08.2009, 09:45
RE: Ajaxed Moral - by hip_hop_x - 08.08.2009, 10:05
RE: Ajaxed Moral - by Black Arrow - 08.08.2009, 10:23
RE: Ajaxed Moral - by Yannici - 08.08.2009, 10:35
RE: Ajaxed Moral - by Black Arrow - 08.08.2009, 10:55
RE: Ajaxed Moral - by Yannici - 08.08.2009, 11:02
RE: Ajaxed Moral - by Black Arrow - 08.08.2009, 11:03
RE: Ajaxed Moral - by hip_hop_x - 08.08.2009, 11:29
RE: Ajaxed Moral - by SlimShady95 - 13.09.2009, 15:55
RE: Ajaxed Moral - by benji889 - 13.09.2009, 17:17
RE: Ajaxed Moral - by SlimShady95 - 14.09.2009, 17:42
RE: Ajaxed Moral - by Arthas - 10.10.2009, 20:41
RE: Ajaxed Moral - by Jonas1309 - 11.10.2009, 08:05
RE: Ajaxed Moral - by m1cr0 - 11.10.2009, 11:48
RE: Ajaxed Moral - by knollenmax - 11.10.2009, 16:50
RE: Ajaxed Moral - by Arthas - 11.10.2009, 16:56
RE: Ajaxed Moral - by Bettdecke1 - 14.10.2009, 05:48
RE: Ajaxed Moral - by m1cr0 - 14.10.2009, 09:27
RE: Ajaxed Moral - by Bettdecke1 - 14.10.2009, 12:04
RE: Ajaxed Moral - by m1cr0 - 24.10.2009, 11:43
RE: Ajaxed Moral - by Azzarrel - 15.11.2009, 19:52
RE: Ajaxed Moral - by hip_hop_x - 02.12.2009, 21:40
RE: Ajaxed Moral - by HuGoB0Zz - 03.06.2010, 10:39
RE: Ajaxed Moral - by HuGoB0Zz - 04.06.2010, 07:37
RE: Ajaxed Moral - by Troasca - 05.06.2010, 11:05
RE: Ajaxed Moral - by SlimShady95 - 05.06.2010, 12:42
RE: Ajaxed Moral - by hip_hop_x - 24.06.2010, 12:53
RE: Ajaxed Moral - by Arthas - 24.06.2010, 13:16
RE: Ajaxed Moral - by Jujan - 06.08.2017, 12:03
RE: Ajaxed Moral - by Jujan - 10.08.2017, 13:14
RE: Ajaxed Moral - by Jujan - 23.08.2017, 20:31



Users browsing this thread: 1 Guest(s)