modular
This commit is contained in:
46
static/js/state.js
Normal file
46
static/js/state.js
Normal file
@@ -0,0 +1,46 @@
|
||||
// ================================================================
|
||||
// Global State & Constants
|
||||
// ================================================================
|
||||
window.towns = [];
|
||||
window.selectedTownId = null;
|
||||
window.clientOnline = false; // tracks Tampermonkey script heartbeat
|
||||
window.wasClientOnline = null; // previous known state (null = unknown)
|
||||
window.POLL_INTERVAL = 4000;
|
||||
|
||||
window.BUILDING_NAMES_GR = {
|
||||
main: "Σύγκλητος",
|
||||
storage: "Αποθήκη",
|
||||
farm: "Φάρμα",
|
||||
academy: "Ακαδημία",
|
||||
temple: "Ναός",
|
||||
barracks: "Στρατώνας",
|
||||
docks: "Λιμάνι",
|
||||
market: "Αγορά",
|
||||
hide: "Σπηλιά",
|
||||
lumber: "Ξυλουργείο",
|
||||
stoner: "Λατομείο",
|
||||
ironer: "Ορυχείο Αργύρου",
|
||||
wall: "Τείχος"
|
||||
};
|
||||
|
||||
window.UNIT_NAMES_GR = {
|
||||
sword: "Ξιφομάχος", slinger: "Σφενδονήτης", archer: "Τοξότης", hoplite: "Οπλίτης",
|
||||
rider: "Ιππέας", chariot: "Άρμα", catapult: "Καταπέλτης",
|
||||
big_transporter: "Μεταφορικό", small_transporter: "Γρήγ. Μεταφορικό", bireme: "Διήρης",
|
||||
attack_ship: "Πλοίο Φάρος", trireme: "Τριήρης", colonize_ship: "Αποικιακό",
|
||||
medusa: "Μέδουσα", zyklop: "Κύκλωπας", harpy: "Άρπυια", pegasus: "Πήγασος",
|
||||
minotaur: "Μινώταυρος", manticore: "Μαντιχώρας", cerberus: "Κέρβερος",
|
||||
hydra: "Ύδρα", sea_monster: "Τέρας Θάλασσας", militia: "Εθνοφρουρά"
|
||||
};
|
||||
|
||||
window.RES_ICONS = {
|
||||
wood: '<span class="res-icon res-wood" style="display:inline-block; margin-right:4px;"></span>',
|
||||
stone: '<span class="res-icon res-stone" style="display:inline-block; margin-right:4px;"></span>',
|
||||
iron: '<span class="res-icon res-iron" style="display:inline-block; margin-right:4px;"></span>',
|
||||
pop: '<span class="res-icon res-pop" style="display:inline-block; margin-right:4px;"></span>'
|
||||
};
|
||||
|
||||
window.fmt = function(n) {
|
||||
if (n >= 1000) return (n / 1000).toFixed(1) + 'k';
|
||||
return n;
|
||||
};
|
||||
Reference in New Issue
Block a user