mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-21 04:48:18 +01:00
Bun, Inferno->React migration (#22529)
Re-creation of https://github.com/Aurorastation/Aurora.3/pull/21046 to skip merge conflict hell. Brings us modern TGUI. **ALTERNATE TITLE: TGUI HELLSCAPE PR ABANDON ALL HOPE YE WHO ENTER HERE** - [x] Migrate build tools (javascript -> typescript, bun for package management). - [x] Upgrade all TGUI dependencies and associated root files to TG-congruent versions (axios, babel, dompurify, eslint, highlight, marked, prettier, sass, source-map, stacktrace-parser, typescript). - [x] InfernoJS -> React migrations - [x] React cleanup and polish (migrate all remaining .js files to appropriate .ts or .tsx filetype, all remaining hooks, linting, error corrections, etc.) - [ ] Test all remaining TGUI interfaces
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
|
||||
/obj/structure/machinery/computer/ship/engines/ui_interact(mob/user, datum/tgui/ui)
|
||||
if(!connected)
|
||||
display_reconnect_dialog(user, "ship control systems")
|
||||
balloon_alert(user, "no connection!")
|
||||
return
|
||||
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
|
||||
@@ -117,6 +117,10 @@
|
||||
return 1
|
||||
|
||||
/obj/structure/machinery/computer/ship/helm/ui_interact(mob/user, datum/tgui/ui)
|
||||
if(!connected)
|
||||
balloon_alert(user, "no connection!")
|
||||
return
|
||||
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "Helm", capitalize_first_letters(name))
|
||||
@@ -126,55 +130,52 @@
|
||||
/obj/structure/machinery/computer/ship/helm/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
if(!connected)
|
||||
display_reconnect_dialog(user, "helm")
|
||||
else
|
||||
var/turf/T = get_turf(connected)
|
||||
var/obj/effect/overmap/visitable/sector/current_sector = locate() in T
|
||||
var/turf/T = get_turf(connected)
|
||||
var/obj/effect/overmap/visitable/sector/current_sector = locate() in T
|
||||
|
||||
data["sector"] = current_sector ? current_sector.name : "Deep Space"
|
||||
data["sector_info"] = current_sector ? current_sector.desc : "Not Available"
|
||||
data["landed"] = connected.get_landed_info()
|
||||
data["ship_coord_x"] = connected.x
|
||||
data["ship_coord_y"] = connected.y
|
||||
data["dest"] = dy && dx
|
||||
data["autopilot_x"] = dx
|
||||
data["autopilot_y"] = dy
|
||||
data["speedlimit"] = speedlimit ? speedlimit*1000 : "Halted"
|
||||
data["accel"] = get_acceleration()
|
||||
data["heading"] = connected.get_heading() ? dir2angle(connected.get_heading()) : 0
|
||||
data["direction"] = dir2angle(connected.dir)
|
||||
data["autopilot"] = autopilot
|
||||
data["manual_control"] = viewing_overmap(user)
|
||||
data["canburn"] = connected.can_burn()
|
||||
data["canturn"] = connected.can_turn()
|
||||
data["cancombatroll"] = connected.can_combat_roll()
|
||||
data["cancombatturn"] = connected.can_combat_turn()
|
||||
data["accellimit"] = accellimit*1000
|
||||
data["sector"] = current_sector ? current_sector.name : "Deep Space"
|
||||
data["sector_info"] = current_sector ? current_sector.desc : "Not Available"
|
||||
data["landed"] = connected.get_landed_info()
|
||||
data["ship_coord_x"] = connected.x
|
||||
data["ship_coord_y"] = connected.y
|
||||
data["dest"] = dy && dx
|
||||
data["autopilot_x"] = dx
|
||||
data["autopilot_y"] = dy
|
||||
data["speedlimit"] = speedlimit ? speedlimit*1000 : "Halted"
|
||||
data["accel"] = get_acceleration()
|
||||
data["heading"] = connected.get_heading() ? dir2angle(connected.get_heading()) : 0
|
||||
data["direction"] = dir2angle(connected.dir)
|
||||
data["autopilot"] = autopilot
|
||||
data["manual_control"] = viewing_overmap(user)
|
||||
data["canburn"] = connected.can_burn()
|
||||
data["canturn"] = connected.can_turn()
|
||||
data["cancombatroll"] = connected.can_combat_roll()
|
||||
data["cancombatturn"] = connected.can_combat_turn()
|
||||
data["accellimit"] = accellimit*1000
|
||||
|
||||
var/speed = round(connected.get_speed()*1000, 0.01)
|
||||
data["speed"] = speed
|
||||
if(connected.get_speed() < SHIP_SPEED_SLOW)
|
||||
data["speed_slow"] = TRUE
|
||||
if(connected.get_speed() > SHIP_SPEED_FAST)
|
||||
data["speed_fast"] = TRUE
|
||||
var/list/speed_xy = connected.get_speed_xy()
|
||||
data["ship_speed_x"] = speed_xy[1]
|
||||
data["ship_speed_y"] = speed_xy[2]
|
||||
var/speed = round(connected.get_speed()*1000, 0.01)
|
||||
data["speed"] = speed
|
||||
if(connected.get_speed() < SHIP_SPEED_SLOW)
|
||||
data["speed_slow"] = TRUE
|
||||
if(connected.get_speed() > SHIP_SPEED_FAST)
|
||||
data["speed_fast"] = TRUE
|
||||
var/list/speed_xy = connected.get_speed_xy()
|
||||
data["ship_speed_x"] = speed_xy[1]
|
||||
data["ship_speed_y"] = speed_xy[2]
|
||||
|
||||
data["ETAnext"] = get_eta()
|
||||
data["ETAnext"] = get_eta()
|
||||
|
||||
var/list/locations[0]
|
||||
for (var/key in known_sectors)
|
||||
var/datum/computer_file/data/waypoint/R = known_sectors[key]
|
||||
var/list/rdata[0]
|
||||
rdata["name"] = R.fields["name"]
|
||||
rdata["x"] = R.fields["x"]
|
||||
rdata["y"] = R.fields["y"]
|
||||
rdata["reference"] = "[REF(R)]"
|
||||
locations.Add(list(rdata))
|
||||
var/list/locations[0]
|
||||
for (var/key in known_sectors)
|
||||
var/datum/computer_file/data/waypoint/R = known_sectors[key]
|
||||
var/list/rdata[0]
|
||||
rdata["name"] = R.fields["name"]
|
||||
rdata["x"] = R.fields["x"]
|
||||
rdata["y"] = R.fields["y"]
|
||||
rdata["reference"] = "[REF(R)]"
|
||||
locations.Add(list(rdata))
|
||||
|
||||
data["locations"] = locations
|
||||
data["locations"] = locations
|
||||
|
||||
return data
|
||||
|
||||
@@ -367,6 +368,10 @@
|
||||
ui_interact(user)
|
||||
|
||||
/obj/structure/machinery/computer/ship/navigation/ui_interact(mob/user, datum/tgui/ui)
|
||||
if(!connected)
|
||||
balloon_alert(user, "no connection!")
|
||||
return
|
||||
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "Nav", capitalize_first_letters(name), ui_x=470, ui_y=320)
|
||||
@@ -376,25 +381,22 @@
|
||||
/obj/structure/machinery/computer/ship/navigation/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
if(!connected)
|
||||
display_reconnect_dialog(user, "navigation")
|
||||
else
|
||||
var/turf/T = get_turf(connected)
|
||||
var/obj/effect/overmap/visitable/sector/current_sector = locate() in T
|
||||
var/turf/T = get_turf(connected)
|
||||
var/obj/effect/overmap/visitable/sector/current_sector = locate() in T
|
||||
|
||||
data["sector"] = current_sector ? current_sector.name : "Deep Space"
|
||||
data["sector_info"] = current_sector ? current_sector.desc : "Not Available"
|
||||
data["ship_coord_x"] = connected.x
|
||||
data["ship_coord_y"] = connected.y
|
||||
data["speed"] = round(connected.get_speed()*1000, 0.01)
|
||||
data["accel"] = round(connected.get_acceleration()*1000, 0.01)
|
||||
var/list/speed_xy = connected.get_speed_xy()
|
||||
data["ship_speed_x"] = speed_xy[1]
|
||||
data["ship_speed_y"] = speed_xy[2]
|
||||
data["direction"] = dir2angle(connected.dir)
|
||||
data["heading"] = connected.get_heading() ? dir2angle(connected.get_heading()) : 0
|
||||
data["ETAnext"] = get_eta()
|
||||
data["viewing"] = viewing_overmap(user)
|
||||
data["sector"] = current_sector ? current_sector.name : "Deep Space"
|
||||
data["sector_info"] = current_sector ? current_sector.desc : "Not Available"
|
||||
data["ship_coord_x"] = connected.x
|
||||
data["ship_coord_y"] = connected.y
|
||||
data["speed"] = round(connected.get_speed()*1000, 0.01)
|
||||
data["accel"] = round(connected.get_acceleration()*1000, 0.01)
|
||||
var/list/speed_xy = connected.get_speed_xy()
|
||||
data["ship_speed_x"] = speed_xy[1]
|
||||
data["ship_speed_y"] = speed_xy[2]
|
||||
data["direction"] = dir2angle(connected.dir)
|
||||
data["heading"] = connected.get_heading() ? dir2angle(connected.get_heading()) : 0
|
||||
data["ETAnext"] = get_eta()
|
||||
data["viewing"] = viewing_overmap(user)
|
||||
|
||||
return data
|
||||
|
||||
|
||||
@@ -22,11 +22,6 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov
|
||||
. += "Consoles like these are typically access-locked."
|
||||
. += "You can remove this lock with <b>wirecutters</b>, but it would take awhile! Alternatively, you can also use a cryptographic sequencer (emag) for instant removal."
|
||||
|
||||
/obj/structure/machinery/computer/ship/proc/display_reconnect_dialog(var/mob/user, var/flavor)
|
||||
var/datum/browser/popup = new (user, "[src]", "[src]")
|
||||
popup.set_content("<center><strong><font color = 'red'>Error</strong></font><br>Unable to connect to [flavor].<br><a href='byond://?src=[REF(src)];sync=1'>Reconnect</a></center>")
|
||||
popup.open()
|
||||
|
||||
/obj/structure/machinery/computer/ship/attackby(obj/item/attacking_item, mob/user)
|
||||
if(attacking_item.tool_behaviour == TOOL_CABLECOIL) // Repair from hotwire
|
||||
var/obj/item/stack/cable_coil/C = attacking_item
|
||||
|
||||
Reference in New Issue
Block a user