Merge pull request #10575 from Arturlang/TGUIs_Nexties

[TESTMERGE] Properly working TGUI Next
This commit is contained in:
Ghom
2020-02-02 17:29:56 +01:00
committed by Archie
parent 7ed460e9fe
commit 291dcf9515
378 changed files with 40549 additions and 9150 deletions
+12 -8
View File
@@ -36,7 +36,7 @@ GLOBAL_LIST(labor_sheet_values)
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "labor_claim_console", name, 450, 475, master_ui, state)
ui = new(user, src, ui_key, "labor_claim_console", name, 315, 430, master_ui, state)
ui.open()
/obj/machinery/mineral/labor_claim_console/ui_data(mob/user)
@@ -46,8 +46,6 @@ GLOBAL_LIST(labor_sheet_values)
data["emagged"] = (obj_flags & EMAGGED) ? 1 : 0
if(obj_flags & EMAGGED)
can_go_home = TRUE
data["status_info"] = "No Prisoner ID detected."
var/obj/item/card/id/I = user.get_idcard(TRUE)
if(istype(I, /obj/item/card/id/prisoner))
var/obj/item/card/id/prisoner/P = I
@@ -57,6 +55,9 @@ GLOBAL_LIST(labor_sheet_values)
data["status_info"] = "Goal met!"
else
data["status_info"] = "You are [(P.goal - P.points)] points away."
else
data["status_info"] = "No Prisoner ID detected."
data["id_points"] = 0
if(stacking_machine)
data["unclaimed_points"] = stacking_machine.points
@@ -78,24 +79,27 @@ GLOBAL_LIST(labor_sheet_values)
P.points += stacking_machine.points
stacking_machine.points = 0
to_chat(usr, "<span class='notice'>Points transferred.</span>")
. = TRUE
else
to_chat(usr, "<span class='notice'>No valid id for point transfer detected.</span>")
to_chat(usr, "<span class='alert'>No valid id for point transfer detected.</span>")
if("move_shuttle")
if(!alone_in_area(get_area(src), usr))
to_chat(usr, "<span class='warning'>Prisoners are only allowed to be released while alone.</span>")
to_chat(usr, "<span class='alert'>Prisoners are only allowed to be released while alone.</span>")
else
switch(SSshuttle.moveShuttle("laborcamp", "laborcamp_home", TRUE))
if(1)
to_chat(usr, "<span class='notice'>Shuttle not found.</span>")
to_chat(usr, "<span class='alert'>Shuttle not found.</span>")
if(2)
to_chat(usr, "<span class='notice'>Shuttle already at station.</span>")
to_chat(usr, "<span class='alert'>Shuttle already at station.</span>")
if(3)
to_chat(usr, "<span class='notice'>No permission to dock could be granted.</span>")
to_chat(usr, "<span class='alert'>No permission to dock could be granted.</span>")
else
if(!(obj_flags & EMAGGED))
Radio.set_frequency(FREQ_SECURITY)
Radio.talk_into(src, "A prisoner has returned to the station. Minerals and Prisoner ID card ready for retrieval.", FREQ_SECURITY)
to_chat(usr, "<span class='notice'>Shuttle received message and will be sent shortly.</span>")
. = TRUE
/obj/machinery/mineral/labor_claim_console/proc/locate_stacking_machine()
stacking_machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
@@ -220,6 +220,7 @@
data["disconnected"] = "mineral withdrawal is on hold"
data["diskDesigns"] = list()
data["hasDisk"] = FALSE
if(inserted_disk)
data["hasDisk"] = TRUE
if(inserted_disk.blueprints.len)
+30 -21
View File
@@ -28,7 +28,7 @@
/obj/structure/ore_box/examine(mob/living/user)
if(Adjacent(user) && istype(user))
show_contents(user)
ui_interact(user)
return ..()
/obj/structure/ore_box/attack_hand(mob/user)
@@ -36,22 +36,11 @@
if(.)
return
if(Adjacent(user))
show_contents(user)
ui_interact(user)
/obj/structure/ore_box/attack_robot(mob/user)
if(Adjacent(user))
show_contents(user)
/obj/structure/ore_box/proc/show_contents(mob/user)
var/dat = text("<b>The contents of the ore box reveal...</b><br>")
var/list/assembled = list()
for(var/obj/item/stack/ore/O in src)
assembled[O.type] += O.amount
for(var/type in assembled)
var/obj/item/stack/ore/O = type
dat += "[initial(O.name)] - [assembled[type]]<br>"
dat += text("<br><br><A href='?src=[REF(src)];removeall=1'>Empty box</A>")
user << browse(dat, "window=orebox")
ui_interact(user)
/obj/structure/ore_box/proc/dump_box_contents()
var/drop = drop_location()
@@ -65,18 +54,38 @@
stoplag()
drop = drop_location()
/obj/structure/ore_box/Topic(href, href_list)
/obj/structure/ore_box/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "ore_box", name, 335, 415, master_ui, state)
ui.open()
/obj/structure/ore_box/ui_data()
var/contents = list()
for(var/obj/item/stack/ore/O in src)
contents[O.type] += O.amount
var/data = list()
data["materials"] = list()
for(var/type in contents)
var/obj/item/stack/ore/O = type
var/name = initial(O.name)
data["materials"] += list(list("name" = name, "amount" = contents[type], "id" = type))
return data
/obj/structure/ore_box/ui_act(action, params)
if(..())
return
if(!Adjacent(usr))
return
usr.set_machine(src)
add_fingerprint(usr)
if(href_list["removeall"])
dump_box_contents()
to_chat(usr, "<span class='notice'>You open the release hatch on the box..</span>")
updateUsrDialog()
usr.set_machine(src)
switch(action)
if("removeall")
dump_box_contents()
to_chat(usr, "<span class='notice'>You open the release hatch on the box..</span>")
/obj/structure/ore_box/deconstruct(disassembled = TRUE, mob/user)
var/obj/item/stack/sheet/mineral/wood/WD = new (loc, 4)