Added agent stats

skamkraft_proto
anulax1225 ago%!(EXTRA string=1 year)
parent 84c00ce239
commit 6170022a75
  1. 2
      css/style.css
  2. 2
      html/template.html
  3. 12
      js/scripts/main.js
  4. 2
      js/skama_code/api/agent.js

@ -105,7 +105,7 @@ footer {
box-shadow: 3px 2px white; box-shadow: 3px 2px white;
} }
.pseudo { .stats {
color: white; color: white;
} }

@ -3,7 +3,7 @@
<div class="nav-brand"> <div class="nav-brand">
<img src="assets/logo/logoblancnotext.png" /> <img src="assets/logo/logoblancnotext.png" />
</div> </div>
<p class="pseudo"></p> <div class="stats"></div>
<ul class="nav-links"> <ul class="nav-links">
<li class="nav-link smooth" id="systems-link">System</li> <li class="nav-link smooth" id="systems-link">System</li>
<li class="nav-link smooth" id="login-link">Log in</li> <li class="nav-link smooth" id="login-link">Log in</li>

@ -22,10 +22,20 @@ function loged_links() {
`); `);
} }
function show_stats() {
$(".stats").html(`
<p>Agent name : ${my_agent.name}</p>
<p>Credits : ${my_agent.credits}</p>
<p>Ships : ${my_agent.ships_cpt}</p>
<p>Faction : ${my_agent.faction}</p>
<p>HQ : ${my_agent.hq}</p>
`);
}
function menu_mod(temp_engine) { function menu_mod(temp_engine) {
init_menu(temp_engine); init_menu(temp_engine);
if(my_agent) { if(my_agent) {
$(".pseudo").text(`Agent name : ${my_agent.name}`); show_stats();
loged_links(); loged_links();
} }
} }

@ -9,7 +9,7 @@ export class Agent {
this.credits = agent.credits; this.credits = agent.credits;
this.faction = agent.startingFaction; this.faction = agent.startingFaction;
this.hq = agent.headquarters; this.hq = agent.headquarters;
this.shipsCpt = agent.shipCount; this.ships_cpt = agent.shipCount;
} }
get_agent_system() { get_agent_system() {

Loading…
Cancel
Save