diff --git a/database/tables/Stats.sql b/database/tables/Stats.sql index ba05300..2b61c1b 100644 --- a/database/tables/Stats.sql +++ b/database/tables/Stats.sql @@ -6,6 +6,7 @@ CREATE TABLE IF NOT EXISTS `Stats` ( `order` tinyint(3) NOT NULL, `stat` varchar(20) NOT NULL, `name` varchar(50) NOT NULL, + `nickname` varchar(10) DEFAULT NULL, `unit` varchar(15) NOT NULL, `group` varchar(18) NOT NULL, `ocr` tinyint(1) NOT NULL DEFAULT '0', @@ -17,34 +18,34 @@ CREATE TABLE IF NOT EXISTS `Stats` ( UNIQUE KEY `order` (`order`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -INSERT INTO `Stats` (`order`, `stat`, `name`, `unit`, `group`, `ocr`, `graph`, `leaderboard`, `prediction`) VALUES -(0, 'ap', 'AP', 'AP', '', 1, 1, 7, 0), -(3, 'innovator', 'Innovator', '', '', 0, 0, 0, 0), -(6, 'unique_visits', 'Unique Portals Visited', 'visits', 'Discovery', 1, 1, 7, 1), -(9, 'portals_discovered', 'Portals Discovered', 'discoveries', 'Discovery', 1, 0, 7, 0), -(12, 'xm_collected', 'XM Collected', 'XM', 'Discovery', 1, 1, 7, 0), -(15, 'distance_walked', 'Distance Walked', 'km', 'Health', 1, 1, 7, 1), -(18, 'res_deployed', 'Resonators Deployed', 'deployments', 'Building', 1, 1, 7, 1), -(21, 'links_created', 'Links Created', 'links', 'Building', 1, 1, 7, 1), -(24, 'fields_created', 'Control Fields Created', 'fields', 'Building', 1, 1, 7, 1), -(27, 'mu_captured', 'Mind Units Captured', 'MUs', 'Building', 1, 1, 7, 1), -(30, 'longest_link', 'Longest Link Ever Created', 'km', 'Building', 1, 0, 1, 0), -(33, 'largest_field', 'Largest Control Field', 'MUs', 'Building', 1, 0, 1, 0), -(36, 'xm_recharged', 'XM Recharged', 'XM', 'Building', 1, 1, 7, 1), -(39, 'portals_captured', 'Portals Captured', 'captures', 'Building', 1, 1, 7, 1), -(42, 'unique_captures', 'Unique Portals Captured', 'unique captures', 'Building', 1, 1, 7, 1), -(45, 'mods_deployed', 'Mods Deployed', 'mods', 'Building', 1, 1, 7, 1), -(48, 'res_destroyed', 'Resonators Destroyed', 'resonators', 'Combat', 1, 1, 7, 1), -(51, 'portals_neutralized', 'Portals Neutralized', 'portals', 'Combat', 1, 1, 7, 0), -(54, 'links_destroyed', 'Enemy Links Destroyed', 'links', 'Combat', 1, 1, 7, 0), -(57, 'fields_destroyed', 'Enemy Control Fields Destroyed', 'fields', 'Combat', 1, 1, 7, 0), -(60, 'oldest_portal', 'Max Time Portal Held', 'days', 'Defense', 1, 0, 1, 0), -(63, 'oldest_link', 'Max Time Link Maintained', 'days', 'Defense', 1, 0, 1, 0), -(66, 'oldest_link_days', 'Max Link Length x Days', 'km-days', 'Defense', 1, 0, 1, 0), -(69, 'oldest_field', 'Max Time Field Held', 'days', 'Defense', 1, 0, 1, 0), -(72, 'largest_field_days', 'Largest Field MUs x Days', 'MU-days', 'Defense', 1, 0, 1, 0), -(75, 'unique_missions', 'Unique Missions Completed', 'missions', 'Missions', 1, 1, 7, 1), -(78, 'hacks', 'Hacks', 'hacks', 'Resource Gathering', 1, 1, 7, 1), -(81, 'glyphs', 'Glyph Hack Points', 'points', 'Resource Gathering', 1, 1, 7, 1), -(84, 'hacking_streak', 'Longest Hacking Streak', 'days', 'Resource Gathering', 1, 0, 1, 0), -(87, 'recruits', 'Agents Successfully Recruited', 'agents', 'Mentoring', 1, 0, 7, 0); +INSERT INTO `Stats` (`order`, `stat`, `name`, `nickname`, `unit`, `group`, `ocr`, `graph`, `leaderboard`, `prediction`) VALUES +(0, 'ap', 'AP', 'AP', 'AP', '', 1, 1, 7, 0), +(3, 'innovator', 'Innovator', NULL, '', '', 0, 0, 0, 0), +(6, 'unique_visits', 'Unique Portals Visited', 'UPV', 'visits', 'Discovery', 1, 1, 7, 1), +(9, 'portals_discovered', 'Portals Discovered', NULL, 'discoveries', 'Discovery', 1, 0, 7, 0), +(12, 'xm_collected', 'XM Collected', NULL, 'XM', 'Discovery', 1, 1, 7, 0), +(15, 'distance_walked', 'Distance Walked', 'KM Walked', 'km', 'Health', 1, 1, 7, 1), +(18, 'res_deployed', 'Resonators Deployed', 'Deploys', 'deploys', 'Building', 1, 1, 7, 1), +(21, 'links_created', 'Links Created', 'Links', 'links', 'Building', 1, 1, 7, 1), +(24, 'fields_created', 'Control Fields Created', 'Fields', 'fields', 'Building', 1, 1, 7, 1), +(27, 'mu_captured', 'Mind Units Captured', 'MU', 'MUs', 'Building', 1, 1, 7, 1), +(30, 'longest_link', 'Longest Link Ever Created', NULL, 'km', 'Building', 1, 0, 1, 0), +(33, 'largest_field', 'Largest Control Field', NULL, 'MUs', 'Building', 1, 0, 1, 0), +(36, 'xm_recharged', 'XM Recharged', NULL, 'XM', 'Building', 1, 1, 7, 1), +(39, 'portals_captured', 'Portals Captured', 'Captures', 'captures', 'Building', 1, 1, 7, 1), +(42, 'unique_captures', 'Unique Portals Captured', 'UPC', 'unique captures', 'Building', 1, 1, 7, 1), +(45, 'mods_deployed', 'Mods Deployed', 'Mods', 'mods', 'Building', 1, 1, 7, 1), +(48, 'res_destroyed', 'Resonators Destroyed', 'Destroys', 'resonators', 'Combat', 1, 1, 7, 1), +(51, 'portals_neutralized', 'Portals Neutralized', NULL, 'portals', 'Combat', 1, 1, 7, 0), +(54, 'links_destroyed', 'Enemy Links Destroyed', NULL, 'links', 'Combat', 1, 1, 7, 0), +(57, 'fields_destroyed', 'Enemy Control Fields Destroyed', NULL, 'fields', 'Combat', 1, 1, 7, 0), +(60, 'oldest_portal', 'Max Time Portal Held', NULL, 'days', 'Defense', 1, 0, 1, 0), +(63, 'oldest_link', 'Max Time Link Maintained', NULL, 'days', 'Defense', 1, 0, 1, 0), +(66, 'oldest_link_days', 'Max Link Length x Days', NULL, 'km-days', 'Defense', 1, 0, 1, 0), +(69, 'oldest_field', 'Max Time Field Held', NULL, 'days', 'Defense', 1, 0, 1, 0), +(72, 'largest_field_days', 'Largest Field MUs x Days', NULL, 'MU-days', 'Defense', 1, 0, 1, 0), +(75, 'unique_missions', 'Unique Missions Completed', 'Missions', 'missions', 'Missions', 1, 1, 7, 1), +(78, 'hacks', 'Hacks', 'Hanks', 'hacks', 'Resource Gathering', 1, 1, 7, 1), +(81, 'glyphs', 'Glyph Hack Points', NULL, 'points', 'Resource Gathering', 1, 1, 7, 1), +(84, 'hacking_streak', 'Longest Hacking Streak', NULL, 'days', 'Resource Gathering', 1, 0, 1, 0), +(87, 'recruits', 'Agents Successfully Recruited', NULL, 'agents', 'Mentoring', 1, 0, 7, 0); diff --git a/resources/css/style.less b/resources/css/style.less index 2730943..3f12822 100755 --- a/resources/css/style.less +++ b/resources/css/style.less @@ -10,7 +10,7 @@ @upcoming-badge-time-margin: @upcoming-badge-height / 7; @upcoming-badge-width: 270; -@ratio-height: 105; +@ratio-height: 115; @ratio-seperator-padding: @ratio-height / 5; @ratio-width: 180; @@ -501,10 +501,6 @@ table#stat-entry { } } } - - div.badge-name { - display: none; - } } .badge-icon-75 { diff --git a/src/BlueHerons/StatTracker/StatTracker.php b/src/BlueHerons/StatTracker/StatTracker.php index 1bd3575..12c6184 100644 --- a/src/BlueHerons/StatTracker/StatTracker.php +++ b/src/BlueHerons/StatTracker/StatTracker.php @@ -207,7 +207,7 @@ public function setBaseURL($request) { */ public static function getStats() { if (!is_array(self::$stats)) { - $stmt = self::db()->query("SELECT stat as `key`, name, `group`, unit, ocr, graph, leaderboard FROM Stats ORDER BY `order` ASC;"); + $stmt = self::db()->query("SELECT stat as `key`, name, `nickname`, `group`, unit, ocr, graph, leaderboard FROM Stats ORDER BY `order` ASC;"); $rows = $stmt->fetchAll(); foreach($rows as $row) { @@ -215,6 +215,7 @@ public static function getStats() { extract($row); $stat->stat = $key; $stat->name = $name; + $stat->nickname = $nickname; $stat->group = $group; $stat->unit = $unit; $stat->ocr = $ocr; diff --git a/views/dashboard.twig b/views/dashboard.twig index 48c2282..dcddd69 100644 --- a/views/dashboard.twig +++ b/views/dashboard.twig @@ -40,10 +40,12 @@
+
:
+
@@ -145,12 +147,10 @@ function onPageLoad() { ratio.stat2.level = "level-icon-75 {{faction_class}} l" + ratio.stat2.level; } - $(html).find(".badge-1 .badge-image").addClass(ratio.stat1.badge) - .addClass(ratio.stat1.level) - .attr("title", ratio.stat1.name); - $(html).find(".badge-2 .badge-image").addClass(ratio.stat2.badge) - .addClass(ratio.stat2.level) - .attr("title", ratio.stat2.name); + $(html).find(".badge-1 .badge-image").addClass(ratio.stat1.badge + " " + ratio.stat1.level); + $(html).find(".badge-2 .badge-image").addClass(ratio.stat2.badge + " " + ratio.stat2.level); + $(html).find(".badge-1 .badge-name").html(ratio.stat1.name); + $(html).find(".badge-2 .badge-name").html(ratio.stat2.name); $(html).find(".value").html(format(ratio.ratio)); $("#ratios").append(html);