From 950ce9f79131002c15365193df0ceb0f6554a612 Mon Sep 17 00:00:00 2001 From: Arthri <41360489+Arthri@users.noreply.github.com> Date: Thu, 18 Apr 2024 21:02:57 +0800 Subject: [PATCH] ORM points are now claimed by swiping IDs rather than inserting it (#24878) * Swipe instead of insert ID to claim points * Build and update tgui * Fix ORM trying to smelt ID * Update UIs when points are claimed * Add fingerprints on claim * ???? TGUI why --------- Co-authored-by: Arthri <41360489+a@users.noreply.github.com> Co-authored-by: /tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> --- code/modules/mining/machine_redemption.dm | 70 ++++--------------- .../packages/tgui/interfaces/OreRedemption.js | 41 ----------- tgui/public/tgui.bundle.js | 2 +- 3 files changed, 15 insertions(+), 98 deletions(-) diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index b2f9cb8bb06..47f9ab77c8c 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -38,8 +38,6 @@ "Virology" = list(MAT_PLASMA, MAT_URANIUM, MAT_GOLD) ) // Variables - /// The currently inserted ID. - var/obj/item/card/id/inserted_id = null /// The number of unclaimed points. var/points = 0 /// Sheet multiplier applied when smelting ore. Updated by [/obj/machinery/proc/RefreshParts]. @@ -126,7 +124,6 @@ /obj/machinery/mineral/ore_redemption/Destroy() // Move any stuff inside us out var/turf/T = get_turf(src) - inserted_id?.forceMove(T) inserted_disk?.forceMove(T) var/datum/component/material_container/materials = GetComponent(/datum/component/material_container) materials.retrieve_all() @@ -151,10 +148,6 @@ if(!..()) return update_icon(UPDATE_ICON_STATE) - if(inserted_id && !(stat & NOPOWER)) - visible_message("The ID slot indicator light flickers on [src] as it spits out a card before powering down.") - inserted_id.forceMove(get_turf(src)) - inserted_id = null /obj/machinery/mineral/ore_redemption/update_icon_state() if(has_power()) @@ -194,7 +187,19 @@ return ..() if(istype(I, /obj/item/card/id)) - try_insert_id(user) + var/obj/item/card/id/ID = I + if(!points) + to_chat(usr, "There are no points to claim."); + return + if(anyone_claim || (req_access_claim in ID.access)) + ID.mining_points += points + ID.total_mining_points += points + to_chat(usr, "[points] Mining Points claimed. You have earned a total of [ID.total_mining_points] Mining Points this Shift!") + points = 0 + SStgui.update_uis(src) + else + to_chat(usr, "Required access not found.") + add_fingerprint(usr) return else if(istype(I, /obj/item/disk/design_disk)) @@ -258,7 +263,6 @@ var/datum/component/material_container/materials = GetComponent(/datum/component/material_container) // General info - data["id"] = inserted_id ? list("name" = "[inserted_id.registered_name] ([inserted_id.assignment])", "points" = inserted_id.mining_points, "total_points" = inserted_id.total_mining_points) : null data["points"] = points data["disk"] = inserted_disk ? list( "name" = inserted_disk.name, @@ -301,18 +305,8 @@ . = TRUE switch(action) - if("claim") - if(!inserted_id || !points) - return - if(anyone_claim || (req_access_claim in inserted_id.access)) - inserted_id.mining_points += points - inserted_id.total_mining_points += points - to_chat(usr, "[points] Mining Points claimed. You have earned a total of [inserted_id.total_mining_points] Mining Points this Shift!") - points = 0 - else - to_chat(usr, "Required access not found.") if("sheet", "alloy") - if(!(check_access(inserted_id) || allowed(usr))) + if(!allowed(usr)) to_chat(usr, "Required access not found.") return FALSE var/id = params["id"] @@ -345,18 +339,6 @@ unload_mineral(A) else unload_mineral(result) - if("insert_id") - try_insert_id(usr) - if("eject_id") - if(!inserted_id) - return FALSE - if(ishuman(usr)) - usr.put_in_hands(inserted_id) - usr.visible_message("[usr] retrieves [inserted_id] from [src].", \ - "You retrieve [inserted_id] from [src].") - else - inserted_id.forceMove(get_turf(src)) - inserted_id = null if("eject_disk") if(!inserted_disk) return FALSE @@ -488,30 +470,6 @@ if(!supply_consoles[C.department] || length(supply_consoles[C.department] - mats_in_stock)) C.createMessage("Ore Redemption Machine", "New Minerals Available!", msg, RQ_NORMALPRIORITY) -/** - * Tries to insert the ID card held by the given user into the machine. - * - * Arguments: - * * user - The ID whose active hand to check for an ID card to insert. - */ -/obj/machinery/mineral/ore_redemption/proc/try_insert_id(mob/user) - . = FALSE - var/obj/item/card/id/I = user.get_active_hand() - if(!istype(I)) - return - if(inserted_id) - to_chat(user, "There is already an ID inside!") - return - if(!user.drop_item()) - return - I.forceMove(src) - inserted_id = I - SStgui.update_uis(src) - interact(user) - user.visible_message("[user] inserts [I] into [src].", \ - "You insert [I] into [src].") - return TRUE - /obj/machinery/mineral/ore_redemption/proc/try_refill_storage(mob/living/silicon/robot/robot) . = FALSE if(!istype(robot)) diff --git a/tgui/packages/tgui/interfaces/OreRedemption.js b/tgui/packages/tgui/interfaces/OreRedemption.js index 77f9f271349..b798b665503 100644 --- a/tgui/packages/tgui/interfaces/OreRedemption.js +++ b/tgui/packages/tgui/interfaces/OreRedemption.js @@ -45,39 +45,6 @@ const IdDisk = (properties, context) => { - - {id ? ( -