Skip to content

Commit

Permalink
more work
Browse files Browse the repository at this point in the history
  • Loading branch information
ZephyrTFA committed Nov 8, 2023
1 parent 653f636 commit f760734
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
16 changes: 16 additions & 0 deletions code/modules/overmap/helm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
.["aiControls"] = allow_ai_control
.["burnDirection"] = current_ship.burn_direction
.["burnPercentage"] = current_ship.burn_percentage
.["radioFreq"] = "[current_ship.ship_radio_frequency * 0.1] Ghz"
for(var/datum/weakref/engine in current_ship.shuttle_port.engine_list)
var/obj/machinery/power/shuttle/engine/real_engine = engine.resolve()
if(!real_engine)
Expand Down Expand Up @@ -275,13 +276,28 @@
say("Error: [COOLDOWN_TIMELEFT(current_ship, rename_cooldown)/10] seconds until ship designation can be changed.")
update_static_data(usr, ui)
return

if("reload_ship")
reload_ship()
update_static_data(usr, ui)
return

if("update_radio_freq")
var/new_freq = input(ui.user, "Enter new frequency (in XXX.X format)", "Ship Radio Frequency", current_ship.ship_radio_frequency * 10) as num|null
new_freq *= 10
if(!sanitize_frequency(new_freq, TRUE))
say("Error: Invalid frequency.")
return
if(new_freq == current_ship.ship_radio_frequency)
return
current_ship.ship_radio_frequency = new_freq
current_ship.broadcast(src, "Ship Radio Frequency updated.")
return TRUE

if("reload_engines")
current_ship.refresh_engines()
return

if("toggle_ai_control")
if(issilicon(usr))
to_chat(usr, "<span class='warning'>You are unable to toggle AI controls.</span>")
Expand Down
3 changes: 2 additions & 1 deletion code/modules/overmap/ships/controlled_ship_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@

for(var/obj/machinery/computer/helm/helm as anything in helms)
SStgui.close_uis(helm)
helm.say(helm_locked ? "Helm console is now locked." : "Helm console has been unlocked.")
if(!helm.viewer)
helm.say(helm_locked ? "Helm console is now locked." : "Helm console has been unlocked.")

/obj/item/key/ship
name = "ship key"
Expand Down
7 changes: 7 additions & 0 deletions tgui/packages/tgui/interfaces/HelmConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ const ShipControlContent = (_props, context) => {
burnPercentage,
speed,
estThrust,
radioFreq,
} = data;
let flyable = !data.docking && !data.docked;

Expand Down Expand Up @@ -313,6 +314,12 @@ const ShipControlContent = (_props, context) => {
disabled={aiUser}
onClick={() => act('toggle_ai_control')}
/>
<Button
tooltip={`Ship Radio: ${radioFreq}`}
tooltipPosition="left"
icon="radio"
onClick={() => act('update_radio_freq')}
/>
</>
}
>
Expand Down

0 comments on commit f760734

Please sign in to comment.