mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-21 12:04:48 +01:00
Adds a pointer to the extraction location for Contractor uplinks (#16497)
* Contractor extraction point locator V1 * `update_static_data()` revert
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
|
||||
/datum/contractor_hub/ui_act(action, list/params)
|
||||
/datum/contractor_hub/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
if(..())
|
||||
return
|
||||
|
||||
@@ -44,7 +43,6 @@
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "Contractor", "Syndicate Contractor Uplink", 500, 600, master_ui, state)
|
||||
ui.open()
|
||||
ui.set_autoupdate(FALSE)
|
||||
|
||||
/datum/contractor_hub/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
@@ -67,6 +65,7 @@
|
||||
|
||||
switch(page)
|
||||
if(HUB_PAGE_CONTRACTS)
|
||||
var/contract_target
|
||||
var/list/contracts_out = list()
|
||||
data["contracts"] = contracts_out
|
||||
for(var/c in contracts)
|
||||
@@ -99,15 +98,26 @@
|
||||
contract_data["dead_extraction"] = C.dead_extraction
|
||||
if(CONTRACT_STATUS_FAILED)
|
||||
contract_data["fail_reason"] = C.fail_reason
|
||||
|
||||
if(C.contract.extraction_zone)
|
||||
contract_target = C.contract.target?.current
|
||||
var/area/A = get_area(user)
|
||||
contract_data["objective"] = list(
|
||||
extraction_zone = C.contract.extraction_zone.map_name,
|
||||
reward_tc = C.reward_tc[C.chosen_difficulty],
|
||||
reward_credits = C.reward_credits,
|
||||
extraction_name = C.contract.extraction_zone.map_name,
|
||||
locs = list(
|
||||
user_area_id = A.uid,
|
||||
user_coords = ATOM_COORDS(user),
|
||||
target_area_id = C.contract.extraction_zone.uid,
|
||||
target_coords = ATOM_COORDS(C.contract.extraction_zone),
|
||||
),
|
||||
rewards = list(tc = C.reward_tc[C.chosen_difficulty], credits = C.reward_credits)
|
||||
)
|
||||
contracts_out += list(contract_data)
|
||||
|
||||
data["can_extract"] = current_contract?.contract.can_start_extraction_process(ui_host(), usr) || FALSE
|
||||
data["can_extract"] = FALSE
|
||||
if(contract_target)
|
||||
data["can_extract"] = current_contract?.contract.can_start_extraction_process(user, contract_target)
|
||||
|
||||
if(HUB_PAGE_SHOP)
|
||||
var/list/buyables = list()
|
||||
for(var/p in purchases)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
GLOBAL_LIST_EMPTY(GPS_list)
|
||||
|
||||
#define EMP_DISABLE_TIME 30 SECONDS
|
||||
#define POS_VECTOR(A) list(A.x, A.y, A.z)
|
||||
|
||||
/**
|
||||
* # GPS
|
||||
@@ -83,11 +82,11 @@ GLOBAL_LIST_EMPTY(GPS_list)
|
||||
return data
|
||||
var/turf/T = get_turf(src)
|
||||
data["area"] = get_area_name(src, TRUE)
|
||||
data["position"] = POS_VECTOR(T)
|
||||
data["position"] = ATOM_COORDS(T)
|
||||
|
||||
// Saved location
|
||||
if(locked_location)
|
||||
data["saved"] = POS_VECTOR(locked_location)
|
||||
data["saved"] = ATOM_COORDS(locked_location)
|
||||
else
|
||||
data["saved"] = null
|
||||
|
||||
@@ -104,7 +103,7 @@ GLOBAL_LIST_EMPTY(GPS_list)
|
||||
var/list/signal = list("tag" = G.gpstag, "area" = null, "position" = null)
|
||||
if(!G.emped)
|
||||
signal["area"] = get_area_name(G, TRUE)
|
||||
signal["position"] = POS_VECTOR(GT)
|
||||
signal["position"] = ATOM_COORDS(GT)
|
||||
signals += list(signal)
|
||||
data["signals"] = signals
|
||||
|
||||
@@ -219,4 +218,3 @@ GLOBAL_LIST_EMPTY(GPS_list)
|
||||
. = ..()
|
||||
|
||||
#undef EMP_DISABLE_TIME
|
||||
#undef POS_VECTOR
|
||||
|
||||
Reference in New Issue
Block a user