Latest Neocron News and Information

  • New test server patch #563 has been released to Vedeena

Difference between revisions of "Metadata:Mapping/Map.js"

From Neocron Wiki
Jump to: navigation, search
(New improved way to generate the map key, without having to edit this file every time a new key is added)
Line 1: Line 1:
 
/* NC-Wiki Jquery File - Do not delete! */
 
/* NC-Wiki Jquery File - Do not delete! */
 
// Function to hide unsed map key elements
 
function hideMapKey(class_name)
 
{
 
// Check the map areas for the class
 
if ($kjq('area.'+class_name).length==0)
 
{
 
// Not found anything - so hide it on the map
 
$kjq('li.'+class_name+'_key').hide();
 
}
 
}
 
 
  
 
$kjq(document).ready(function($)
 
$kjq(document).ready(function($)
Line 17: Line 5:
 
// Add functions and stuff here
 
// Add functions and stuff here
  
// NC-Wiki map
+
// NC-Wiki map - enabled the plugin
$('.ncwiki_map').maphilight(
+
$('img.ncwiki_map').maphilight(
 
{
 
{
 
fill: true,
 
fill: true,
Line 30: Line 18:
 
alwaysOn: false
 
alwaysOn: false
 
});
 
});
 +
 +
// Function to hide unsed map key elements
 
// Dont hide map on the Template:Mapkey page
 
// Dont hide map on the Template:Mapkey page
 
// Otherwise you cannot preview it!
 
// Otherwise you cannot preview it!
// This will be improved to pickup the classes from the keymaps area
 
 
if (wgPageName!='Template:Mapkey')
 
if (wgPageName!='Template:Mapkey')
 
{
 
{
hideMapKey('map_default');
+
// Ok find the map key elemetns
hideMapKey('map_outpost');
+
$('li.map_key').each(function ()
hideMapKey('map_outpost_lab');
+
{
hideMapKey('map_outpost_mine');
+
// Get the classnames out
hideMapKey('map_outpost_factory');
+
classnames=$(this).attr('class').split(" ");
hideMapKey('map_outpost_fortress');
+
 
hideMapKey('map_outpost_uplink');
+
for (var i=0; i<classnames.length; i++)
hideMapKey('map_asg');
+
{
hideMapKey('map_gogo');
+
// Is a class ending in _key ?
hideMapKey('map_genrep');
+
 
hideMapKey('map_interest');
+
if ((classnames[i]!='map_key') &&
hideMapKey('map_cave');
+
  (classnames[i].substring(classnames[i].length-4,classnames[i].length)=='_key'))
hideMapKey('map_city');
+
{
hideMapKey('map_city_entrance');
+
// Ok got the clasname lets see if it's being shown on the map
hideMapKey('map_city_entrance_nc');
+
myclass=classnames[i].substring(0,classnames[i].length-4);
hideMapKey('map_city_entrance_doy');
+
if ($('area.'+myclass).length==0)
hideMapKey('map_city_entrance_th');
+
{
hideMapKey('map_city_entrance_mb');
+
// Not found anything - so hide it on the map
hideMapKey('map_city_entrance_tg');
+
$('li.'+myclass+'_key').hide();
hideMapKey('map_npc');
+
}
 +
}
 +
}
 +
});
 
}
 
}
 +
 +
// End of mapkey functions
  
 
// End of functions
 
// End of functions
 
});
 
});

Revision as of 20:22, 20 May 2008

Sorry you do not have permissions to view this page.