diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm index 92bb26924e3..d7567ce575c 100644 --- a/code/game/objects/items/stacks/sheets/mineral.dm +++ b/code/game/objects/items/stacks/sheets/mineral.dm @@ -181,6 +181,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ singular_name = "diamond" origin_tech = "materials=6" sheettype = "diamond" + merge_type = /obj/item/stack/sheet/mineral/diamond materials = list(MAT_DIAMOND=MINERAL_MATERIAL_AMOUNT) point_value = 25 @@ -197,6 +198,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ singular_name = "uranium sheet" origin_tech = "materials=5" sheettype = "uranium" + merge_type = /obj/item/stack/sheet/mineral/uranium materials = list(MAT_URANIUM=MINERAL_MATERIAL_AMOUNT) point_value = 20 @@ -210,6 +212,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ singular_name = "plasma sheet" origin_tech = "plasmatech=2;materials=2" sheettype = "plasma" + merge_type = /obj/item/stack/sheet/mineral/plasma materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT) resistance_flags = FLAMMABLE max_integrity = 100 @@ -252,6 +255,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ singular_name = "gold bar" origin_tech = "materials=4" sheettype = "gold" + merge_type = /obj/item/stack/sheet/mineral/gold materials = list(MAT_GOLD=MINERAL_MATERIAL_AMOUNT) point_value = 20 @@ -265,6 +269,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ singular_name = "silver bar" origin_tech = "materials=4" sheettype = "silver" + merge_type = /obj/item/stack/sheet/mineral/silver materials = list(MAT_SILVER=MINERAL_MATERIAL_AMOUNT) point_value = 20 @@ -278,6 +283,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ singular_name = "bananium sheet" origin_tech = "materials=4" sheettype = "bananium" + merge_type = /obj/item/stack/sheet/mineral/bananium materials = list(MAT_BANANIUM=MINERAL_MATERIAL_AMOUNT) point_value = 50 @@ -294,6 +300,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ singular_name = "beret" origin_tech = "materials=4" sheettype = "tranquillite" + merge_type = /obj/item/stack/sheet/mineral/tranquillite materials = list(MAT_TRANQUILLITE=MINERAL_MATERIAL_AMOUNT) wall_allowed = FALSE //no tranquilite walls in code point_value = 50 @@ -319,6 +326,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ throw_speed = 1 throw_range = 3 sheettype = "titanium" + merge_type = /obj/item/stack/sheet/mineral/titanium materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT) point_value = 20 @@ -349,6 +357,7 @@ GLOBAL_LIST_INIT(titanium_recipes, list( throw_speed = 1 throw_range = 3 sheettype = "plastitanium" + merge_type = /obj/item/stack/sheet/mineral/plastitanium materials = list(MAT_TITANIUM=2000, MAT_PLASMA=2000) point_value = 45 diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm index dbb41229e27..ccd58bae8e6 100644 --- a/code/modules/mining/laborcamp/laborstacker.dm +++ b/code/modules/mining/laborcamp/laborstacker.dm @@ -1,5 +1,3 @@ -GLOBAL_LIST(labor_sheet_values) - /**********************Prisoners' Console**************************/ /obj/machinery/mineral/labor_claim_console @@ -14,6 +12,7 @@ GLOBAL_LIST(labor_sheet_values) var/obj/machinery/door/airlock/release_door var/door_tag = "prisonshuttle" var/obj/item/radio/intercom/announcer + var/static/list/sheet_values /obj/machinery/mineral/labor_claim_console/Initialize() . = ..() @@ -21,14 +20,13 @@ GLOBAL_LIST(labor_sheet_values) announcer.config(list("Security" = 0)) locate_stacking_machine() - if(!GLOB.labor_sheet_values) - var/sheet_list = list() + if(!sheet_values) for(var/sheet_type in subtypesof(/obj/item/stack/sheet)) var/obj/item/stack/sheet/sheet = sheet_type if(!initial(sheet.point_value) || (initial(sheet.merge_type) && initial(sheet.merge_type) != sheet_type)) //ignore no-value sheets and x/fifty subtypes continue - sheet_list += list(list("ore" = initial(sheet.name), "value" = initial(sheet.point_value))) - GLOB.labor_sheet_values = sheet_list + sheet_values += list(list("ore" = initial(sheet.name), "value" = initial(sheet.point_value))) + sheet_values = sortTim(sheet_values, /proc/cmp_sheet_list) /obj/machinery/mineral/labor_claim_console/Destroy() . = ..() @@ -45,7 +43,7 @@ GLOBAL_LIST(labor_sheet_values) I.forceMove(src) inserted_id = I to_chat(user, "You insert [I].") - SSnanoui.update_uis(src) + SStgui.update_uis(src) return else to_chat(user, "There's an ID inserted already.") @@ -53,75 +51,78 @@ GLOBAL_LIST(labor_sheet_values) return ..() /obj/machinery/mineral/labor_claim_console/attack_hand(mob/user) - ui_interact(user) + tgui_interact(user) /obj/machinery/mineral/labor_claim_console/attack_ghost(mob/user) attack_hand(user) -/obj/machinery/mineral/labor_claim_console/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = GLOB.default_state) - ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) +/obj/machinery/mineral/labor_claim_console/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_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.tmpl", name, 450, 625, state) + ui = new(user, src, ui_key, "LaborClaimConsole", name, 315, 470, master_ui, state) ui.open() -/obj/machinery/mineral/labor_claim_console/ui_data(mob/user) +/obj/machinery/mineral/labor_claim_console/tgui_data(mob/user) var/list/data = list() var/can_go_home = FALSE - data["emagged"] = (emagged) ? TRUE : FALSE + data["emagged"] = emagged + data["id_inserted"] = inserted_id != null if(inserted_id) - data["id"] = inserted_id data["id_name"] = inserted_id.registered_name - data["points"] = inserted_id.points - data["goal"] = inserted_id.goal + data["id_points"] = inserted_id.points + data["id_goal"] = inserted_id.goal if(check_auth()) can_go_home = TRUE if(stacking_machine) data["unclaimed_points"] = stacking_machine.points - data["ores"] = GLOB.labor_sheet_values + data["ores"] = sheet_values data["can_go_home"] = can_go_home return data -/obj/machinery/mineral/labor_claim_console/Topic(href, href_list) +/obj/machinery/mineral/labor_claim_console/tgui_act(action, params) if(..()) - return TRUE + return - if(href_list["handle_id"]) - if(inserted_id) - if(!usr.put_in_hands(inserted_id)) - inserted_id.forceMove(get_turf(src)) - inserted_id = null - else - var/obj/item/I = usr.get_active_hand() - if(istype(I, /obj/item/card/id/prisoner)) - if(!usr.unEquip(I)) - return - I.forceMove(src) - inserted_id = I - if(href_list["claim_points"]) - inserted_id.points += stacking_machine.points - stacking_machine.points = 0 - to_chat(usr, "Points transferred.") - if(href_list["move_shuttle"]) - if(!alone_in_area(get_area(src), usr)) - to_chat(usr, "Prisoners are only allowed to be released while alone.") - else - switch(SSshuttle.moveShuttle("laborcamp", "laborcamp_home", TRUE, usr)) - if(1) - to_chat(usr, "Shuttle not found.") - if(2) - to_chat(usr, "Shuttle already at station.") - if(3) - to_chat(usr, "No permission to dock could be granted.") - else - if(!(emagged)) - var/message = "[inserted_id.registered_name] has returned to the station. Minerals and Prisoner ID card ready for retrieval." - announcer.autosay(message, "Labor Camp Controller", "Security") - to_chat(usr, "Shuttle received message and will be sent shortly.") - usr.create_log(MISC_LOG, "used [src] to call the laborcamp shuttle") + switch(action) + if("handle_id") + if(inserted_id) + if(!usr.put_in_hands(inserted_id)) + inserted_id.forceMove(get_turf(src)) + inserted_id = null + else + var/obj/item/I = usr.get_active_hand() + if(istype(I, /obj/item/card/id/prisoner)) + if(!usr.unEquip(I)) + return + I.forceMove(src) + inserted_id = I + if("claim_points") + if(!inserted_id) + return + inserted_id.points += stacking_machine.points + stacking_machine.points = 0 + to_chat(usr, "Points transferred.") + if("move_shuttle") + if(!alone_in_area(get_area(src), usr)) + to_chat(usr, "Prisoners are only allowed to be released while alone.") + else + switch(SSshuttle.moveShuttle("laborcamp", "laborcamp_home", TRUE, usr)) + if(1) + to_chat(usr, "Shuttle not found.") + if(2) + to_chat(usr, "Shuttle already at station.") + if(3) + to_chat(usr, "No permission to dock could be granted.") + else + if(!emagged) + var/message = "[inserted_id.registered_name] has returned to the station. Minerals and Prisoner ID card ready for retrieval." + announcer.autosay(message, "Labor Camp Controller", "Security") + to_chat(usr, "Shuttle received message and will be sent shortly.") + usr.create_log(MISC_LOG, "used [src] to call the laborcamp shuttle") return TRUE diff --git a/code/modules/telesci/bscrystal.dm b/code/modules/telesci/bscrystal.dm index d5df0bf9402..ccba4b27a8b 100644 --- a/code/modules/telesci/bscrystal.dm +++ b/code/modules/telesci/bscrystal.dm @@ -62,6 +62,7 @@ GLOBAL_LIST_INIT(bluespace_crystal_recipes, list(new/datum/stack_recipe("Breakdo icon_state = "polycrystal" desc = "A stable polycrystal, made of fused-together bluespace crystals. You could probably break one off." origin_tech = "bluespace=6;materials=3" + merge_type = /obj/item/stack/sheet/bluespace_crystal materials = list(MAT_BLUESPACE = MINERAL_MATERIAL_AMOUNT) attack_verb = list("bluespace polybashed", "bluespace polybattered", "bluespace polybludgeoned", "bluespace polythrashed", "bluespace polysmashed") toolspeed = 1 diff --git a/nano/templates/labor_claim_console.tmpl b/nano/templates/labor_claim_console.tmpl deleted file mode 100644 index efbdb5796d6..00000000000 --- a/nano/templates/labor_claim_console.tmpl +++ /dev/null @@ -1,76 +0,0 @@ - - - - -