mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-12 02:32:10 +00:00
Converts the Cargo Bounties UI to TGUI and adds a modular app for it. (#51509)
* How did this take me like 3 hours but the bounty UI took 4 weeks like fuck * Uses style's suggestions for UI cleanup. * Rebuild TGUI * Squiggly Brackets No. 1 * Squiggly Brackets No. 2 * Rebuilds tgui also sorry style I got lazy * Another tgui update * GREP? * Rebuilds tgui again * Rebuild yet again * How'd you like a nice tender lambchop? * Take me HOOOOOOOME country ROOOOOADS * Updates with Anturk's changes. * Removes unnecessary flex element Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
This commit is contained in:
@@ -83,7 +83,6 @@
|
||||
|
||||
/datum/computer_file/program/arcade/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
|
||||
data["Hitpoints"] = boss_hp
|
||||
data["PlayerHitpoints"] = player_hp
|
||||
data["PlayerMP"] = player_mp
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/datum/computer_file/program/bounty
|
||||
filename = "bounty"
|
||||
filedesc = "Nanotrasen Bounty Hunter"
|
||||
program_icon_state = "bounty"
|
||||
extended_desc = "A basic interface for supply personnel to check and claim bounties."
|
||||
requires_ntnet = TRUE
|
||||
transfer_access = ACCESS_CARGO
|
||||
network_destination = "cargo claims interface"
|
||||
size = 10
|
||||
tgui_id = "NtosBountyConsole"
|
||||
ui_x = 750
|
||||
ui_y = 600
|
||||
///cooldown var for printing paper sheets.
|
||||
var/printer_ready = 0
|
||||
///The cargo account for grabbing the cargo account's credits.
|
||||
var/static/datum/bank_account/cargocash
|
||||
|
||||
/datum/computer_file/program/bounty/proc/print_paper()
|
||||
new /obj/item/paper/bounty_printout(get_turf(computer))
|
||||
|
||||
/datum/computer_file/program/bounty/ui_interact(mob/user, ui_key, datum/tgui/ui, force_open, datum/tgui/master_ui, datum/ui_state/state)
|
||||
if(!GLOB.bounties_list.len)
|
||||
setup_bounties()
|
||||
printer_ready = world.time + PRINTER_TIMEOUT
|
||||
cargocash = SSeconomy.get_dep_account(ACCOUNT_CAR)
|
||||
. = ..()
|
||||
|
||||
/datum/computer_file/program/bounty/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
var/list/bountyinfo = list()
|
||||
for(var/datum/bounty/B in GLOB.bounties_list)
|
||||
bountyinfo += list(list("name" = B.name, "description" = B.description, "reward_string" = B.reward_string(), "completion_string" = B.completion_string() , "claimed" = B.claimed, "can_claim" = B.can_claim(), "priority" = B.high_priority, "bounty_ref" = REF(B)))
|
||||
data["stored_cash"] = cargocash.account_balance
|
||||
data["bountydata"] = bountyinfo
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/bounty/ui_act(action,params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("ClaimBounty")
|
||||
var/datum/bounty/cashmoney = locate(params["bounty"]) in GLOB.bounties_list
|
||||
if(cashmoney)
|
||||
cashmoney.claim()
|
||||
return TRUE
|
||||
if("Print")
|
||||
if(printer_ready < world.time)
|
||||
printer_ready = world.time + PRINTER_TIMEOUT
|
||||
print_paper()
|
||||
return
|
||||
Reference in New Issue
Block a user