diff --git a/html/templates/ship/ship_modal.html b/html/templates/ship/ship_modal.html index 447f60c..858c6db 100644 --- a/html/templates/ship/ship_modal.html +++ b/html/templates/ship/ship_modal.html @@ -1,18 +1,8 @@
Ship
- - - - - - - - - - - - +fuel capacity: ${ship.fuel.capacity}
-Name : ${ship.registration.name}
`); + $(".infos").append(`Faction : ${ship.registration.factionSymbol}
`); + $(".infos").append(`Role : ${ship.registration.role}
`); + } + }) + modal.show(); + }); + temp_engine.add_event(".nav", "click", (e) => { + const id_ship = $(e.target).attr("data-symbol"); + ships.forEach(ship =>{ + if(ship.symbol==id_ship) + { + $(".infos").html(""); + $(".infos").append(`Current system : ${ship.nav.systemSymbol}
`); + $(".infos").append(`Current waypoint : ${ship.nav.waypointSymbol}
`); + $(".infos").append(`Current status : ${ship.nav.status}
`); + $(".infos").append(`Flight mode : ${ship.nav.flightMode}
`); + } + }) + modal.show(); + }); + temp_engine.add_event(".crew", "click", (e) => { + const id_ship = $(e.target).attr("data-symbol"); + ships.forEach(ship =>{ + if(ship.symbol==id_ship) + { + $(".infos").html(""); + $(".infos").append(`Current member : ${ship.crew.current}
`); + $(".infos").append(`Capacity : ${ship.crew.capacity}
`); + $(".infos").append(`required member : ${ship.crew.required}
`); + $(".infos").append(`Moral : ${ship.crew.morale}
`); + } + }) + modal.show(); + }); + temp_engine.add_event(".frame", "click", (e) => { + const id_ship = $(e.target).attr("data-symbol"); + ships.forEach(ship =>{ + if(ship.symbol==id_ship) + { + $(".infos").html(""); + $(".infos").append(`Name : ${ship.frame.name}
`); + $(".infos").append(`Description : ${ship.frame.description}
`); + $(".infos").append(`Fuel capacity : ${ship.frame.fuelCapacity}
`); + $(".infos").append(`Condition : ${ship.frame.condition}
`); + $(".infos").append(`Power : ${ship.frame.requirements.power}
`); + $(".infos").append(`Crew : ${ship.frame.requirements.crew}
`); + + } + }) + modal.show(); + }); + temp_engine.add_event(".react", "click", (e) => { + const id_ship = $(e.target).attr("data-symbol"); + ships.forEach(ship =>{ + if(ship.symbol==id_ship) + { + $(".infos").html(""); + $(".infos").append(`Name : ${ship.reactor.name}
`); + $(".infos").append(`Description : ${ship.reactor.description}
`); + $(".infos").append(`Condition : ${ship.reactor.condition}
`); + $(".infos").append(`Power : ${ship.reactor.powerOutput}
`); + $(".infos").append(`Crew : ${ship.reactor.requirements.crew}
`); + } + }) + modal.show(); + }); + temp_engine.add_event(".engine", "click", (e) => { + const id_ship = $(e.target).attr("data-symbol"); + ships.forEach(ship =>{ + if(ship.symbol==id_ship) + { + $(".infos").html(""); + $(".infos").append(`Name : ${ship.engine.name}
`); + $(".infos").append(`Description : ${ship.engine.description}
`); + $(".infos").append(`Condition : ${ship.engine.condition}
`); + $(".infos").append(`Speed : ${ship.engine.speed}
`); + $(".infos").append(`Crew : ${ship.engine.requirements.crew}
`); + $(".infos").append(`Power : ${ship.engine.requirements.power}
`); + } + }) + modal.show(); + }); + temp_engine.add_event(".fuel", "click", (e) => { + const id_ship = $(e.target).attr("data-symbol"); + ships.forEach(ship =>{ + if(ship.symbol==id_ship) + { + $(".infos").html(""); + $(".infos").append(`current fuel : ${ship.fuel.current}
`); + $(".infos").append(`Description : ${ship.fuel.capacity}
`); + $(".infos").append(`Condition : ${ship.fuel.consumed.amount}
`); + $(".infos").append(`Speed : ${ship.fuel.consumed.timestamp}
`); + } + }) + modal.show(); + }); }); temp_engine.add_event(".btn-close", "click", () => { modal.close(); }); - - - }); temp_engine.render("templates/ship/ship.html");