Skip to content

Commit

Permalink
Mostly redoes the CAS UI (#13965)
Browse files Browse the repository at this point in the history
* Mostly redoes the CAS UI

* Fix warning

---------

Co-authored-by: TiviPlus <[email protected]>
  • Loading branch information
TiviPlus and TiviPlus authored Sep 20, 2023
1 parent 15f977e commit ff067a4
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 157 deletions.
2 changes: 1 addition & 1 deletion code/game/objects/structures/dropship_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@
S.start()

/obj/structure/ship_ammo/cas/minirocket/illumination
name = "illumination rocket-launched flare stack"
name = "illumination rocket flare stack"
desc = "A pack of laser guided mini rockets, each loaded with a payload of white-star illuminant and a parachute, while extremely ineffective at damaging the enemy, it is very effective at lighting the battlefield so marines can damage the enemy. Moving this will require some sort of lifter."
icon_state = "minirocket_ilm"
point_cost = 25 // Not a real rocket, so its cheap
Expand Down
8 changes: 5 additions & 3 deletions code/modules/condor/cas_chair.dm
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@
owner.turn_on_engines()
if(PLANE_STATE_PREPARED)
owner.turn_off_engines()
if(action == "eject")
if(owner.state != PLANE_STATE_ACTIVATED)
return
resisted_against()
ui.close()

if(owner.state == PLANE_STATE_ACTIVATED)
return
Expand Down Expand Up @@ -219,9 +224,6 @@
if("change_weapon")
var/selection = text2num(params["selection"])
owner.active_weapon = owner.equipments[selection]
if("deselect")
owner.active_weapon = null
. = TRUE
if("cycle_attackdir")
if(params["newdir"] == null)
owner.attackdir = turn(owner.attackdir, 90)
Expand Down
41 changes: 10 additions & 31 deletions code/modules/condor/cas_shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -255,43 +255,22 @@
.["plane_mode"] = mode
.["fuel_left"] = fuel_left
.["fuel_max"] = fuel_max
.["ship_status"] = getStatusText()
.["attackdir"] = uppertext(dir2text(attackdir))
.["active_lasers"] = length(GLOB.active_cas_targets)

var/element_nbr = 1
.["all_weapons"] = list()
for(var/i in equipments)
var/obj/structure/dropship_equipment/cas/weapon/weapon = i
.["all_weapons"] += list(list("name"= sanitize(copytext(weapon.name,1,MAX_MESSAGE_LEN)), "ammo" = weapon?.ammo_equipped?.ammo_count, "eqp_tag" = element_nbr))
for(var/obj/structure/dropship_equipment/cas/weapon/weapon in equipments)
.["all_weapons"] += list(list(
"name"= sanitize(copytext(weapon.name,1,MAX_MESSAGE_LEN)),
"ammo" = weapon.ammo_equipped?.ammo_count,
"max_ammo" = weapon.ammo_equipped?.max_ammo_count,
"ammo_name" = weapon.ammo_equipped?.name,
"eqp_tag" = element_nbr,
))
if(weapon == active_weapon)
.["active_weapon_tag"] = element_nbr
element_nbr++
.["active_lasers"] = length(GLOB.active_cas_targets)
.["active_weapon_name"] = null
.["active_weapon_ammo"] = null
.["active_weapon_max_ammo"] = null
.["active_weapon_ammo_name"] = null
if(active_weapon)
.["active_weapon_name"] = sanitize(copytext(active_weapon?.name,1,MAX_MESSAGE_LEN))
if(active_weapon.ammo_equipped)
.["active_weapon_ammo"] = active_weapon.ammo_equipped.ammo_count
.["active_weapon_max_ammo"] = active_weapon.ammo_equipped.max_ammo_count
.["active_weapon_ammo_name"] = active_weapon.ammo_equipped.name

/obj/docking_port/mobile/marine_dropship/casplane/getStatusText()
switch(mode)
if(SHUTTLE_IDLE, SHUTTLE_RECHARGING)
switch(state)
if(PLANE_STATE_FLYING)
return "In-mission"
if(PLANE_STATE_PREPARED)
return "Engines online and ready for launch."
if(PLANE_STATE_ACTIVATED)
return "Engines Offline. Idle mode engaged."
if(SHUTTLE_IGNITING)
return "Accelerating to new destination."
if(SHUTTLE_PREARRIVAL)
return "Decelerating."
return "Unknown status"

/// Used to intercept JUMP links.
/obj/docking_port/mobile/marine_dropship/casplane/proc/handle_topic(datum/source, mob/user, list/href_list)
Expand Down
Loading

0 comments on commit ff067a4

Please sign in to comment.