yet another batch. MAJOR: APC
This commit is contained in:
@@ -9,8 +9,6 @@
|
||||
icon_state = "bus"
|
||||
density = TRUE
|
||||
circuit = /obj/item/circuitboard/machine/ntnet_relay
|
||||
ui_x = 400
|
||||
ui_y = 300
|
||||
|
||||
var/datum/ntnet/NTNet = null // This is mostly for backwards reference and to allow varedit modifications from ingame.
|
||||
var/enabled = 1 // Set to 0 if the relay was turned off
|
||||
@@ -64,15 +62,12 @@
|
||||
SSnetworks.station_network.add_log("Quantum relay switched from overload recovery mode to normal operation mode.")
|
||||
..()
|
||||
|
||||
/obj/machinery/ntnet_relay/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)
|
||||
|
||||
/obj/machinery/ntnet_relay/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "NtnetRelay", "NTNet Quantum Relay", ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "NtnetRelay")
|
||||
ui.open()
|
||||
|
||||
|
||||
/obj/machinery/ntnet_relay/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["enabled"] = enabled
|
||||
@@ -81,7 +76,6 @@
|
||||
data["dos_crashed"] = dos_failure
|
||||
return data
|
||||
|
||||
|
||||
/obj/machinery/ntnet_relay/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
@@ -118,4 +112,4 @@
|
||||
D.target = null
|
||||
D.error = "Connection to quantum relay severed"
|
||||
|
||||
return ..()
|
||||
return ..()
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/**
|
||||
* Finds and extracts seeds from an object
|
||||
*
|
||||
* Checks if the object is such that creates a seed when extracted. Used by seed
|
||||
* extractors or posably anything that would create seeds in some way. The seeds
|
||||
* are dropped either at the extractor, if it exists, or where the original object
|
||||
* was and it qdel's the object
|
||||
*
|
||||
* Arguments:
|
||||
* * O - Object containing the seed, can be the loc of the dumping of seeds
|
||||
* * t_max - Amount of seed copies to dump, -1 is ranomized
|
||||
* * extractor - Seed Extractor, used as the dumping loc for the seeds and seed multiplier
|
||||
* * user - checks if we can remove the object from the inventory
|
||||
* *
|
||||
*/
|
||||
/proc/seedify(obj/item/O, t_max, obj/machinery/seed_extractor/extractor, mob/living/user)
|
||||
var/t_amount = 0
|
||||
var/list/seeds = list()
|
||||
@@ -46,20 +61,22 @@
|
||||
icon_state = "sextractor"
|
||||
density = TRUE
|
||||
circuit = /obj/item/circuitboard/machine/seed_extractor
|
||||
var/piles = list()
|
||||
/// Associated list of seeds, they are all weak refs. We check the len to see how many refs we have for each
|
||||
// seed
|
||||
var/list/piles = list()
|
||||
var/max_seeds = 1000
|
||||
var/seed_multiplier = 1
|
||||
|
||||
/obj/machinery/seed_extractor/RefreshParts()
|
||||
for(var/obj/item/stock_parts/matter_bin/B in component_parts)
|
||||
max_seeds = 1000 * B.rating
|
||||
max_seeds = initial(max_seeds) * B.rating
|
||||
for(var/obj/item/stock_parts/manipulator/M in component_parts)
|
||||
seed_multiplier = M.rating
|
||||
seed_multiplier = initial(seed_multiplier) * M.rating
|
||||
|
||||
/obj/machinery/seed_extractor/examine(mob/user)
|
||||
. = ..()
|
||||
if(in_range(user, src) || isobserver(user))
|
||||
. += "<span class='notice'>The status display reads: Extracting <b>[seed_multiplier]</b> seed(s) per piece of produce.<br>Machine can store up to <b>[max_seeds]</b> seeds.</span>"
|
||||
. += "<span class='notice'>The status display reads: Extracting <b>[seed_multiplier]</b> seed(s) per piece of produce.<br>Machine can store up to <b>[max_seeds]%</b> seeds.</span>"
|
||||
|
||||
/obj/machinery/seed_extractor/attackby(obj/item/O, mob/user, params)
|
||||
|
||||
@@ -102,78 +119,26 @@
|
||||
else
|
||||
return ..()
|
||||
|
||||
/datum/seed_pile
|
||||
var/name = ""
|
||||
var/lifespan = 0 //Saved stats
|
||||
var/endurance = 0
|
||||
var/maturation = 0
|
||||
var/production = 0
|
||||
var/yield = 0
|
||||
var/potency = 0
|
||||
var/amount = 0
|
||||
/**
|
||||
* Generate seed string
|
||||
*
|
||||
* Creates a string based of the traits of a seed. We use this string as a bucket for all
|
||||
* seeds that match as well as the key the ui uses to get the seed. We also use the key
|
||||
* for the data shown in the ui. Javascript parses this string to display
|
||||
*
|
||||
* Arguments:
|
||||
* * O - seed to generate the string from
|
||||
*/
|
||||
/obj/machinery/seed_extractor/proc/generate_seed_string(obj/item/seeds/O)
|
||||
return "name=[O.name];lifespan=[O.lifespan];endurance=[O.endurance];maturation=[O.maturation];production=[O.production];yield=[O.yield];potency=[O.potency];instability=[O.instability]"
|
||||
|
||||
/datum/seed_pile/New(var/name, var/life, var/endur, var/matur, var/prod, var/yie, var/poten, var/am = 1)
|
||||
src.name = name
|
||||
src.lifespan = life
|
||||
src.endurance = endur
|
||||
src.maturation = matur
|
||||
src.production = prod
|
||||
src.yield = yie
|
||||
src.potency = poten
|
||||
src.amount = am
|
||||
|
||||
/obj/machinery/seed_extractor/ui_interact(mob/user)
|
||||
. = ..()
|
||||
if (stat)
|
||||
return FALSE
|
||||
|
||||
var/dat = "<b>Stored seeds:</b><br>"
|
||||
|
||||
if (contents.len == 0)
|
||||
dat += "<font color='red'>No seeds</font>"
|
||||
else
|
||||
dat += "<table cellpadding='3' style='text-align:center;'><tr><td>Name</td><td>Lifespan</td><td>Endurance</td><td>Maturation</td><td>Production</td><td>Yield</td><td>Potency</td><td>Stock</td></tr>"
|
||||
for (var/datum/seed_pile/O in piles)
|
||||
dat += "<tr><td>[O.name]</td><td>[O.lifespan]</td><td>[O.endurance]</td><td>[O.maturation]</td>"
|
||||
dat += "<td>[O.production]</td><td>[O.yield]</td><td>[O.potency]</td><td>"
|
||||
dat += "<a href='byond://?src=[REF(src)];name=[O.name];li=[O.lifespan];en=[O.endurance];ma=[O.maturation];pr=[O.production];yi=[O.yield];pot=[O.potency]'>Vend</a> ([O.amount] left)</td></tr>"
|
||||
dat += "</table>"
|
||||
var/datum/browser/popup = new(user, "seed_ext", name, 700, 400)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/obj/machinery/seed_extractor/Topic(var/href, var/list/href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
|
||||
href_list["li"] = text2num(href_list["li"])
|
||||
href_list["en"] = text2num(href_list["en"])
|
||||
href_list["ma"] = text2num(href_list["ma"])
|
||||
href_list["pr"] = text2num(href_list["pr"])
|
||||
href_list["yi"] = text2num(href_list["yi"])
|
||||
href_list["pot"] = text2num(href_list["pot"])
|
||||
|
||||
for (var/datum/seed_pile/N in piles)//Find the pile we need to reduce...
|
||||
if (href_list["name"] == N.name && href_list["li"] == N.lifespan && href_list["en"] == N.endurance && href_list["ma"] == N.maturation && href_list["pr"] == N.production && href_list["yi"] == N.yield && href_list["pot"] == N.potency)
|
||||
if(N.amount <= 0)
|
||||
return
|
||||
N.amount = max(N.amount - 1, 0)
|
||||
if (N.amount <= 0)
|
||||
piles -= N
|
||||
qdel(N)
|
||||
break
|
||||
|
||||
for (var/obj/T in contents)//Now we find the seed we need to vend
|
||||
var/obj/item/seeds/O = T
|
||||
if (O.plantname == href_list["name"] && O.lifespan == href_list["li"] && O.endurance == href_list["en"] && O.maturation == href_list["ma"] && O.production == href_list["pr"] && O.yield == href_list["yi"] && O.potency == href_list["pot"])
|
||||
O.forceMove(drop_location())
|
||||
break
|
||||
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/** Add Seeds Proc.
|
||||
*
|
||||
* Adds the seeds to the contents and to an associated list that pregenerates the data
|
||||
* needed to go to the ui handler
|
||||
*
|
||||
**/
|
||||
/obj/machinery/seed_extractor/proc/add_seed(obj/item/seeds/O)
|
||||
if(contents.len >= 999)
|
||||
to_chat(usr, "<span class='notice'>\The [src] is full.</span>")
|
||||
@@ -188,10 +153,47 @@
|
||||
if(!M.transferItemToLoc(O, src))
|
||||
return FALSE
|
||||
|
||||
. = TRUE
|
||||
for (var/datum/seed_pile/N in piles)
|
||||
if (O.plantname == N.name && O.lifespan == N.lifespan && O.endurance == N.endurance && O.maturation == N.maturation && O.production == N.production && O.yield == N.yield && O.potency == N.potency)
|
||||
++N.amount
|
||||
return
|
||||
var/seed_string = generate_seed_string(O)
|
||||
if(piles[seed_string])
|
||||
piles[seed_string] += WEAKREF(O)
|
||||
else
|
||||
piles[seed_string] = list(WEAKREF(O))
|
||||
|
||||
. = TRUE
|
||||
|
||||
/obj/machinery/seed_extractor/ui_state(mob/user)
|
||||
return GLOB.notcontained_state
|
||||
|
||||
/obj/machinery/seed_extractor/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "SeedExtractor", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/seed_extractor/ui_data()
|
||||
var/list/V = list()
|
||||
for(var/key in piles)
|
||||
if(piles[key])
|
||||
var/len = length(piles[key])
|
||||
if(len)
|
||||
V[key] = len
|
||||
|
||||
. = list()
|
||||
.["seeds"] = V
|
||||
|
||||
/obj/machinery/seed_extractor/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
switch(action)
|
||||
if("select")
|
||||
var/item = params["item"]
|
||||
if(piles[item] && length(piles[item]) > 0)
|
||||
var/datum/weakref/WO = piles[item][1]
|
||||
var/obj/item/seeds/O = WO.resolve()
|
||||
if(O)
|
||||
piles[item] -= WO
|
||||
O.forceMove(drop_location())
|
||||
. = TRUE
|
||||
//to_chat(usr, "<span class='notice'>[src] clanks to life briefly before vending [prize.equipment_name]!</span>")
|
||||
|
||||
piles += new /datum/seed_pile(O.plantname, O.lifespan, O.endurance, O.maturation, O.production, O.yield, O.potency)
|
||||
|
||||
@@ -8,10 +8,13 @@
|
||||
language_holder = null
|
||||
. = ..()
|
||||
|
||||
/datum/language_menu/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.language_menu_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/datum/language_menu/ui_state(mob/user)
|
||||
return GLOB.language_menu_state
|
||||
|
||||
/datum/language_menu/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "LanguageMenu", "Language Menu", 700, 600, master_ui, state)
|
||||
ui = new(user, src, "LanguageMenu")
|
||||
ui.open()
|
||||
|
||||
/datum/language_menu/ui_data(mob/user)
|
||||
|
||||
@@ -34,13 +34,13 @@
|
||||
if(U.check_acedia())
|
||||
to_chat(user, "<span class='notice'>None of this matters, why are you reading this? You put [title] down.</span>")
|
||||
return
|
||||
user.visible_message("[user] opens [title] and begins reading intently.")
|
||||
user.visible_message("<span class='notice'>[user] opens [title] and begins reading intently.</span>")
|
||||
ask_name(user)
|
||||
|
||||
|
||||
/obj/item/book/codex_gigas/proc/perform_research(mob/user, devilName)
|
||||
if(!devilName)
|
||||
user.visible_message("[user] closes [title] without looking anything up.")
|
||||
user.visible_message("<span class='notice'>[user] closes [title] without looking anything up.</span>")
|
||||
return
|
||||
inUse = TRUE
|
||||
var/speed = 300
|
||||
@@ -50,7 +50,7 @@
|
||||
if(U.job in list("Curator")) // the curator is both faster, and more accurate than normal crew members at research
|
||||
speed = 100
|
||||
correctness = 100
|
||||
correctness -= U.getOrganLoss(ORGAN_SLOT_BRAIN) *0.5 //Brain damage makes researching hard.
|
||||
correctness -= U.getOrganLoss(ORGAN_SLOT_BRAIN) * 0.5 //Brain damage makes researching hard.
|
||||
speed += U.getOrganLoss(ORGAN_SLOT_BRAIN) * 3
|
||||
if(do_after(user, speed, 0, user))
|
||||
var/usedName = devilName
|
||||
@@ -95,11 +95,10 @@
|
||||
currentSection = SUFFIX
|
||||
return currentSection != oldSection
|
||||
|
||||
/obj/item/book/codex_gigas/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)
|
||||
/obj/item/book/codex_gigas/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "CodexGigas", name, 450, 450, master_ui, state)
|
||||
ui = new(user, src, "CodexGigas", name)
|
||||
ui.open()
|
||||
|
||||
/obj/item/book/codex_gigas/ui_data(mob/user)
|
||||
|
||||
@@ -35,13 +35,13 @@
|
||||
return
|
||||
|
||||
if(existing_message)
|
||||
user.visible_message("<span class='notice'>[user] starts erasing [existing_message].</span>", "<span class='notice'>You start erasing [existing_message].</span>", "<span class='italics'>You hear a chipping sound.</span>")
|
||||
playsound(loc, 'sound/items/gavel.ogg', 50, 1, -1)
|
||||
user.visible_message("<span class='notice'>[user] starts erasing [existing_message].</span>", "<span class='notice'>You start erasing [existing_message].</span>", "<span class='hear'>You hear a chipping sound.</span>")
|
||||
playsound(loc, 'sound/items/gavel.ogg', 50, TRUE, -1)
|
||||
if(do_after(user, tool_speed, target = existing_message))
|
||||
user.visible_message("<span class='notice'>[user] erases [existing_message].</span>", "<span class='notice'>You erase [existing_message][existing_message.creator_key == user.ckey ? ", refunding a use" : ""].</span>")
|
||||
existing_message.persists = FALSE
|
||||
qdel(existing_message)
|
||||
playsound(loc, 'sound/items/gavel.ogg', 50, 1, -1)
|
||||
playsound(loc, 'sound/items/gavel.ogg', 50, TRUE, -1)
|
||||
if(existing_message.creator_key == user.ckey)
|
||||
refund_use()
|
||||
return
|
||||
@@ -54,12 +54,12 @@
|
||||
if(!target.Adjacent(user) && locate(/obj/structure/chisel_message) in T)
|
||||
to_chat(user, "<span class='warning'>Someone wrote here before you chose! Find another spot.</span>")
|
||||
return
|
||||
playsound(loc, 'sound/items/gavel.ogg', 50, 1, -1)
|
||||
user.visible_message("<span class='notice'>[user] starts engraving a message into [T]...</span>", "<span class='notice'>You start engraving a message into [T]...</span>", "<span class='italics'>You hear a chipping sound.</span>")
|
||||
playsound(loc, 'sound/items/gavel.ogg', 50, TRUE, -1)
|
||||
user.visible_message("<span class='notice'>[user] starts engraving a message into [T]...</span>", "<span class='notice'>You start engraving a message into [T]...</span>", "<span class='hear'>You hear a chipping sound.</span>")
|
||||
if(can_use() && do_after(user, tool_speed, target = T) && can_use()) //This looks messy but it's actually really clever!
|
||||
if(!locate(/obj/structure/chisel_message) in T)
|
||||
user.visible_message("<span class='notice'>[user] leaves a message for future spacemen!</span>", "<span class='notice'>You engrave a message into [T]!</span>", "<span class='italics'>You hear a chipping sound.</span>")
|
||||
playsound(loc, 'sound/items/gavel.ogg', 50, 1, -1)
|
||||
user.visible_message("<span class='notice'>[user] leaves a message for future spacemen!</span>", "<span class='notice'>You engrave a message into [T]!</span>", "<span class='hear'>You hear a chipping sound.</span>")
|
||||
playsound(loc, 'sound/items/gavel.ogg', 50, TRUE, -1)
|
||||
var/obj/structure/chisel_message/M = new(T)
|
||||
M.register(user, message)
|
||||
remove_use()
|
||||
@@ -112,12 +112,10 @@
|
||||
desc = "A message from a past traveler."
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "soapstone_message"
|
||||
layer = HIGH_OBJ_LAYER
|
||||
layer = LATTICE_LAYER
|
||||
density = FALSE
|
||||
anchored = TRUE
|
||||
max_integrity = 30
|
||||
layer = LATTICE_LAYER
|
||||
light_power = 0.3
|
||||
|
||||
var/hidden_message
|
||||
var/creator_key
|
||||
@@ -206,10 +204,13 @@
|
||||
/obj/structure/chisel_message/interact()
|
||||
return
|
||||
|
||||
/obj/structure/chisel_message/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.always_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/structure/chisel_message/ui_state(mob/user)
|
||||
return GLOB.always_state
|
||||
|
||||
/obj/structure/chisel_message/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "EngravedMessage", name, 600, 300, master_ui, state)
|
||||
ui = new(user, src, "EngravedMessage", name)
|
||||
ui.open()
|
||||
|
||||
/obj/structure/chisel_message/ui_data(mob/user)
|
||||
|
||||
@@ -8,8 +8,6 @@ GLOBAL_LIST(labor_sheet_values)
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = FALSE
|
||||
ui_x = 315
|
||||
ui_y = 430
|
||||
|
||||
var/obj/machinery/mineral/stacking_machine/laborstacker/stacking_machine = null
|
||||
var/machinedir = SOUTH
|
||||
@@ -35,11 +33,10 @@ GLOBAL_LIST(labor_sheet_values)
|
||||
/proc/cmp_sheet_list(list/a, list/b)
|
||||
return a["value"] - b["value"]
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/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)
|
||||
/obj/machinery/mineral/labor_claim_console/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "LaborClaimConsole", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "LaborClaimConsole", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/ui_data(mob/user)
|
||||
@@ -121,7 +118,7 @@ GLOBAL_LIST(labor_sheet_values)
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker
|
||||
force_connect = TRUE
|
||||
var/points = 0 //The unclaimed value of ore stacked.
|
||||
|
||||
damage_deflection = 21
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker/process_sheet(obj/item/stack/sheet/inp)
|
||||
points += inp.point_value * inp.amount
|
||||
..()
|
||||
@@ -141,7 +138,7 @@ GLOBAL_LIST(labor_sheet_values)
|
||||
icon_state = "console"
|
||||
density = FALSE
|
||||
|
||||
/obj/machinery/mineral/labor_points_checker/attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
|
||||
/obj/machinery/mineral/labor_points_checker/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
@@ -195,10 +195,10 @@
|
||||
to_chat(user, "<span class='notice'>You change [src]'s I/O settings, setting the input to [dir2text(input_dir)] and the output to [dir2text(output_dir)].</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/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)
|
||||
/obj/machinery/mineral/ore_redemption/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "OreRedemptionMachine", "Ore Redemption Machine", 440, 550, master_ui, state)
|
||||
ui = new(user, src, "OreRedemptionMachine")
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/ui_data(mob/user)
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
icon_state = "mining"
|
||||
density = TRUE
|
||||
circuit = /obj/item/circuitboard/machine/mining_equipment_vendor
|
||||
ui_x = 425
|
||||
ui_y = 600
|
||||
var/icon_deny = "mining-deny"
|
||||
var/obj/item/card/id/inserted_id
|
||||
var/list/prize_list = list( //if you add something to this, please, for the love of god, sort it by price/type. use tabs and not spaces.
|
||||
@@ -101,17 +99,15 @@
|
||||
else
|
||||
icon_state = "[initial(icon_state)]-off"
|
||||
|
||||
/obj/machinery/mineral/equipment_vendor/ui_base_html(html)
|
||||
var/datum/asset/spritesheet/assets = get_asset_datum(/datum/asset/spritesheet/vending)
|
||||
. = replacetext(html, "<!--customheadhtml-->", assets.css_tag())
|
||||
/obj/machinery/mineral/equipment_vendor/ui_assets(mob/user)
|
||||
return list(
|
||||
get_asset_datum(/datum/asset/spritesheet/vending),
|
||||
)
|
||||
|
||||
/obj/machinery/mineral/equipment_vendor/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)
|
||||
/obj/machinery/mineral/equipment_vendor/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
var/datum/asset/assets = get_asset_datum(/datum/asset/spritesheet/vending)
|
||||
assets.send(user)
|
||||
ui = new(user, src, ui_key, "MiningVendor", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "MiningVendor", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/mineral/equipment_vendor/ui_static_data(mob/user)
|
||||
@@ -136,10 +132,12 @@
|
||||
if(C)
|
||||
.["user"] = list()
|
||||
.["user"]["points"] = C.mining_points
|
||||
if(C.assignment)
|
||||
.["user"]["job"] = C.assignment
|
||||
else
|
||||
.["user"]["job"] = "No Job"
|
||||
if(C.registered_account)
|
||||
.["user"]["name"] = C.registered_account.account_holder
|
||||
if(C.registered_account.account_job)
|
||||
.["user"]["job"] = C.registered_account.account_job.title
|
||||
else
|
||||
.["user"]["job"] = "No Job"
|
||||
|
||||
/obj/machinery/mineral/equipment_vendor/ui_act(action, params)
|
||||
if(..())
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
density = TRUE
|
||||
pressure_resistance = 5*ONE_ATMOSPHERE
|
||||
|
||||
var/ui_x = 335
|
||||
var/ui_y = 415
|
||||
|
||||
/obj/structure/ore_box/attackby(obj/item/W, mob/user, params)
|
||||
if (istype(W, /obj/item/stack/ore))
|
||||
user.transferItemToLoc(W, src)
|
||||
@@ -38,7 +35,7 @@
|
||||
ui_interact(user)
|
||||
. = ..()
|
||||
|
||||
/obj/structure/ore_box/attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
|
||||
/obj/structure/ore_box/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
@@ -61,11 +58,10 @@
|
||||
stoplag()
|
||||
drop = drop_location()
|
||||
|
||||
/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)
|
||||
/obj/structure/ore_box/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "OreBox", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "OreBox", name)
|
||||
ui.open()
|
||||
|
||||
/obj/structure/ore_box/ui_data()
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
set name = "Notification preferences"
|
||||
set desc = "Notification preferences"
|
||||
|
||||
var/datum/notificationpanel/panel = new(usr)
|
||||
var/datum/notificationpanel/panel = new(usr)
|
||||
|
||||
panel.ui_interact(usr)
|
||||
|
||||
|
||||
|
||||
/datum/notificationpanel
|
||||
var/client/user
|
||||
|
||||
@@ -21,10 +19,13 @@
|
||||
else
|
||||
src.user = user
|
||||
|
||||
/datum/notificationpanel/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.observer_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/datum/notificationpanel/ui_state(mob/user)
|
||||
return GLOB.observer_state
|
||||
|
||||
/datum/notificationpanel/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "NotificationPreferences", "Notification Preferences", 270, 360, master_ui, state)
|
||||
ui = new(user, src, "NotificationPreferences")
|
||||
ui.open()
|
||||
|
||||
/datum/notificationpanel/ui_data(mob/user)
|
||||
@@ -35,8 +36,7 @@
|
||||
"key" = key,
|
||||
"enabled" = (user.ckey in GLOB.poll_ignore[key]),
|
||||
"desc" = GLOB.poll_ignore_desc[key]
|
||||
))
|
||||
|
||||
))
|
||||
|
||||
/datum/notificationpanel/ui_act(action, params)
|
||||
if(..())
|
||||
|
||||
@@ -6,9 +6,12 @@
|
||||
qdel(src)
|
||||
owner = new_owner
|
||||
|
||||
/datum/orbit_menu/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.observer_state)
|
||||
/datum/orbit_menu/ui_state(mob/user)
|
||||
return GLOB.observer_state
|
||||
|
||||
/datum/orbit_menu/ui_interact(mob/user, datum/tgui/ui)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "Orbit", "Orbit", 350, 700, master_ui, state)
|
||||
ui = new(user, src, "Orbit")
|
||||
ui.open()
|
||||
|
||||
/datum/orbit_menu/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
@@ -16,11 +19,10 @@
|
||||
return
|
||||
|
||||
if (action == "orbit")
|
||||
var/list/pois = getpois(skip_mindless = 1)
|
||||
var/atom/movable/poi = pois[params["name"]]
|
||||
var/ref = params["ref"]
|
||||
var/atom/movable/poi = (locate(ref) in GLOB.mob_list) || (locate(ref) in GLOB.poi_list)
|
||||
if (poi != null)
|
||||
owner.ManualFollow(poi)
|
||||
ui.close()
|
||||
|
||||
/datum/orbit_menu/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
@@ -39,6 +41,8 @@
|
||||
|
||||
var/poi = pois[name]
|
||||
|
||||
serialized["ref"] = REF(poi)
|
||||
|
||||
var/mob/M = poi
|
||||
if (istype(M))
|
||||
if (isobserver(M))
|
||||
|
||||
@@ -310,11 +310,16 @@
|
||||
else
|
||||
ui_interact(owner)
|
||||
|
||||
/datum/action/innate/swap_body/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.always_state)
|
||||
/datum/action/innate/swap_body/ui_host(mob/user)
|
||||
return owner
|
||||
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/datum/action/innate/swap_body/ui_state(mob/user)
|
||||
return GLOB.not_incapacitated_state
|
||||
|
||||
/datum/action/innate/swap_body/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "SlimeBodySwapper", name, 400, 400, master_ui, state)
|
||||
ui = new(user, src, "SlimeBodySwapper", name)
|
||||
ui.open()
|
||||
|
||||
/datum/action/innate/swap_body/ui_data(mob/user)
|
||||
@@ -384,7 +389,8 @@
|
||||
return
|
||||
switch(action)
|
||||
if("swap")
|
||||
var/mob/living/carbon/human/selected = locate(params["ref"])
|
||||
var/datum/species/jelly/slime/SS = H.dna.species
|
||||
var/mob/living/carbon/human/selected = locate(params["ref"]) in SS.bodies
|
||||
if(!can_swap(selected))
|
||||
return
|
||||
SStgui.close_uis(src)
|
||||
|
||||
@@ -19,11 +19,13 @@
|
||||
return ..()
|
||||
return UI_CLOSE
|
||||
|
||||
/datum/robot_control/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.always_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/datum/robot_control/ui_state(mob/user)
|
||||
return GLOB.always_state
|
||||
|
||||
/datum/robot_control/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "RemoteRobotControl", "Remote Robot Control", 500, 500, master_ui, state)
|
||||
ui = new(user, src, "RemoteRobotControl")
|
||||
ui.open()
|
||||
|
||||
/datum/robot_control/ui_data(mob/user)
|
||||
|
||||
@@ -29,9 +29,6 @@
|
||||
model = "MULE"
|
||||
bot_core_type = /obj/machinery/bot_core/mulebot
|
||||
|
||||
var/ui_x = 350
|
||||
var/ui_y = 425
|
||||
|
||||
var/id
|
||||
|
||||
path_image_color = "#7F5200"
|
||||
@@ -170,18 +167,17 @@
|
||||
return
|
||||
ui_interact(user)
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/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)
|
||||
/mob/living/simple_animal/bot/mulebot/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "Mule", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "Mule", name)
|
||||
ui.open()
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["on"] = on
|
||||
data["locked"] = locked
|
||||
data["siliconUser"] = hasSiliconAccessInArea(user)
|
||||
data["siliconUser"] = user.has_unlimited_silicon_privilege
|
||||
data["mode"] = mode ? mode_name[mode] : "Ready"
|
||||
data["modeStatus"] = ""
|
||||
switch(mode)
|
||||
@@ -191,8 +187,7 @@
|
||||
data["modeStatus"] = "average"
|
||||
if(BOT_NO_ROUTE)
|
||||
data["modeStatus"] = "bad"
|
||||
else
|
||||
data["load"] = load ? load.name : null
|
||||
data["load"] = load ? load.name : null //IF YOU CHANGE THE NAME OF THIS, UPDATE MULEBOT/PARANORMAL/UI_DATA.
|
||||
data["destination"] = destination ? destination : null
|
||||
data["home"] = home_destination
|
||||
data["destinations"] = GLOB.deliverybeacontags
|
||||
@@ -206,18 +201,20 @@
|
||||
return data
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/ui_act(action, params)
|
||||
var/silicon_access = hasSiliconAccessInArea(usr)
|
||||
if(..() || (locked && silicon_access))
|
||||
if(..() || (locked && !usr.has_unlimited_silicon_privilege))
|
||||
return
|
||||
switch(action)
|
||||
if("lock")
|
||||
if(silicon_access)
|
||||
if(usr.has_unlimited_silicon_privilege)
|
||||
locked = !locked
|
||||
. = TRUE
|
||||
if("power")
|
||||
if(on)
|
||||
turn_off()
|
||||
else if(cell && !open)
|
||||
else if(open)
|
||||
to_chat(usr, "<span class='warning'>[name]'s maintenance panel is open!</span>")
|
||||
return
|
||||
else if(cell)
|
||||
if(!turn_on())
|
||||
to_chat(usr, "<span class='warning'>You can't switch on [src]!</span>")
|
||||
return
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
ui_interact(user)
|
||||
|
||||
// Operates TGUI
|
||||
/obj/item/modular_computer/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)
|
||||
/obj/item/modular_computer/ui_interact(mob/user, datum/tgui/ui)
|
||||
if(!enabled)
|
||||
if(ui)
|
||||
ui.close()
|
||||
@@ -14,7 +14,7 @@
|
||||
return 0
|
||||
|
||||
// Robots don't really need to see the screen, their wireless connection works as long as computer is on.
|
||||
if(!screen_on && !hasSiliconAccessInArea(user))
|
||||
if(!screen_on && !issilicon(user))
|
||||
if(ui)
|
||||
ui.close()
|
||||
return 0
|
||||
@@ -33,19 +33,17 @@
|
||||
to_chat(user, "<span class='danger'>\The [src] beeps three times, it's screen displaying a \"DISK ERROR\" warning.</span>")
|
||||
return // No HDD, No HDD files list or no stored files. Something is very broken.
|
||||
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if (!ui)
|
||||
var/datum/asset/assets = get_asset_datum(/datum/asset/simple/headers)
|
||||
assets.send(user)
|
||||
assets = get_asset_datum(/datum/asset/simple/arcade)
|
||||
assets.send(user)
|
||||
ui = new(user, src, ui_key, "NtosMain", "NtOS Main menu", 400, 500, master_ui, state)
|
||||
ui = new(user, src, "NtosMain")
|
||||
ui.set_autoupdate(TRUE)
|
||||
ui.open()
|
||||
ui.set_autoupdate(state = 1)
|
||||
ui.send_asset(get_asset_datum(/datum/asset/simple/headers))
|
||||
|
||||
|
||||
/obj/item/modular_computer/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
data["device_theme"] = device_theme
|
||||
data["programs"] = list()
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = all_components[MC_HDD]
|
||||
for(var/datum/computer_file/program/P in hard_drive.stored_files)
|
||||
@@ -143,6 +141,7 @@
|
||||
set_light(comp_light_luminosity, 1, comp_light_color)
|
||||
else
|
||||
set_light(0)
|
||||
return TRUE
|
||||
|
||||
if("PC_light_color")
|
||||
var/mob/user = usr
|
||||
|
||||
@@ -31,15 +31,10 @@
|
||||
var/available_on_ntnet = 1
|
||||
/// Whether the program can be downloaded from SyndiNet (accessible via emagging the computer). Set to 1 to enable.
|
||||
var/available_on_syndinet = 0
|
||||
/// ID of TGUI interface
|
||||
/// Name of the tgui interface
|
||||
var/tgui_id
|
||||
/// Default size of TGUI window, in pixels
|
||||
var/ui_x = 575
|
||||
var/ui_y = 700
|
||||
/// Example: "something.gif" - a header image that will be rendered in computer's UI when this program is running at background. Images are taken from /icons/program_icons. Be careful not to use too large images!
|
||||
var/ui_header = null
|
||||
///Assets specific to programs
|
||||
var/list/special_assets = list()
|
||||
|
||||
/datum/computer_file/program/New(obj/item/modular_computer/comp = null)
|
||||
..()
|
||||
@@ -69,12 +64,12 @@
|
||||
/datum/computer_file/program/proc/generate_network_log(text)
|
||||
if(computer)
|
||||
return computer.add_log(text)
|
||||
return FALSE
|
||||
return 0
|
||||
|
||||
/datum/computer_file/program/proc/is_supported_by_hardware(hardware_flag = 0, loud = 0, mob/user = null)
|
||||
if(!(hardware_flag & usage_flags))
|
||||
if(loud && computer && user)
|
||||
to_chat(user, "<span class='danger'>\The [computer] flashes an \"Hardware Error - Incompatible software\" warning.</span>")
|
||||
to_chat(user, "<span class='danger'>\The [computer] flashes a \"Hardware Error - Incompatible software\" warning.</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
@@ -143,13 +138,27 @@
|
||||
// This is performed on program startup. May be overridden to add extra logic. Remember to include ..() call. Return 1 on success, 0 on failure.
|
||||
// When implementing new program based device, use this to run the program.
|
||||
/datum/computer_file/program/proc/run_program(mob/living/user)
|
||||
if(can_run(user, TRUE))
|
||||
if(can_run(user, 1))
|
||||
if(requires_ntnet && network_destination)
|
||||
generate_network_log("Connection opened to [network_destination].")
|
||||
program_state = PROGRAM_STATE_ACTIVE
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/**
|
||||
*
|
||||
*Called by the device when it is emagged.
|
||||
*
|
||||
*Emagging the device allows certain programs to unlock new functions. However, the program will
|
||||
*need to be downloaded first, and then handle the unlock on their own in their run_emag() proc.
|
||||
*The device will allow an emag to be run multiple times, so the user can re-emag to run the
|
||||
*override again, should they download something new. The run_emag() proc should return TRUE if
|
||||
*the emagging affected anything, and FALSE if no change was made (already emagged, or has no
|
||||
*emag functions).
|
||||
**/
|
||||
/datum/computer_file/program/proc/run_emag()
|
||||
return FALSE
|
||||
|
||||
// Use this proc to kill the program. Designed to be implemented by each program if it requires on-quit logic, such as the NTNRC client.
|
||||
/datum/computer_file/program/proc/kill_program(forced = FALSE)
|
||||
program_state = PROGRAM_STATE_KILLED
|
||||
@@ -157,18 +166,12 @@
|
||||
generate_network_log("Connection to [network_destination] closed.")
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/computer_file/program/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)
|
||||
/datum/computer_file/program/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui && tgui_id)
|
||||
var/datum/asset/assets = get_asset_datum(/datum/asset/simple/headers)
|
||||
assets.send(user)
|
||||
for(var/i in special_assets)
|
||||
assets = get_asset_datum(i)
|
||||
assets.send(user)
|
||||
|
||||
ui = new(user, src, ui_key, tgui_id, filedesc, ui_x, ui_y, state = state)
|
||||
ui = new(user, src, tgui_id, filedesc)
|
||||
ui.open()
|
||||
ui.send_asset(get_asset_datum(/datum/asset/simple/headers))
|
||||
|
||||
// CONVENTIONS, READ THIS WHEN CREATING NEW PROGRAM AND OVERRIDING THIS PROC:
|
||||
// Topic calls are automagically forwarded from NanoModule this program contains.
|
||||
|
||||
@@ -27,9 +27,6 @@
|
||||
var/dev_printer = 0 // 0: None, 1: Standard
|
||||
var/dev_card = 0 // 0: None, 1: Standard
|
||||
|
||||
ui_x = 500
|
||||
ui_y = 400
|
||||
|
||||
// Removes all traces of old order and allows you to begin configuration from scratch.
|
||||
/obj/machinery/lapvend/proc/reset_order()
|
||||
state = 0
|
||||
@@ -224,15 +221,15 @@
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/lapvend/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)
|
||||
/obj/machinery/lapvend/ui_interact(mob/user, datum/tgui/ui)
|
||||
if(stat & (BROKEN | NOPOWER | MAINT))
|
||||
if(ui)
|
||||
ui.close()
|
||||
return FALSE
|
||||
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "ComputerFabricator", "Personal Computer Vendor", ui_x, ui_y, state = state)
|
||||
ui = new(user, src, "ComputerFabricator")
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/lapvend/attackby(obj/item/I, mob/user)
|
||||
@@ -241,7 +238,7 @@
|
||||
if(!user.temporarilyRemoveItemFromInventory(c))
|
||||
return
|
||||
credits += c.value
|
||||
visible_message("<span class='info'><span class='name'>[user]</span> inserts [c.value] credits into [src].</span>")
|
||||
visible_message("<span class='info'><span class='name'>[user]</span> inserts [c.value] cr into [src].</span>")
|
||||
qdel(c)
|
||||
return
|
||||
else if(istype(I, /obj/item/holochip))
|
||||
@@ -257,10 +254,10 @@
|
||||
var/datum/bank_account/account = ID.registered_account
|
||||
var/target_credits = total_price - credits
|
||||
if(!account.adjust_money(-target_credits))
|
||||
say("Insufficient money on card to purchase!")
|
||||
say("Insufficient credits on card to purchase!")
|
||||
return
|
||||
credits += target_credits
|
||||
say("[target_credits] cr has been desposited from your account.")
|
||||
say("[target_credits] cr has been deposited from your account.")
|
||||
return
|
||||
return ..()
|
||||
|
||||
@@ -308,4 +305,4 @@
|
||||
state = 3
|
||||
addtimer(CALLBACK(src, .proc/reset_order), 100)
|
||||
return TRUE
|
||||
return FALSE
|
||||
return FALSE
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/**
|
||||
* Paper
|
||||
* also scraps of paper
|
||||
*
|
||||
@@ -11,12 +11,11 @@
|
||||
#define MODE_WRITING 1
|
||||
#define MODE_STAMPING 2
|
||||
|
||||
|
||||
/**
|
||||
** This is a custom ui state. All it really does is keep track of pen
|
||||
** being used and if they are editing it or not. This way we can keep
|
||||
** the data with the ui rather than on the paper
|
||||
**/
|
||||
* This is a custom ui state. All it really does is keep track of pen
|
||||
* being used and if they are editing it or not. This way we can keep
|
||||
* the data with the ui rather than on the paper
|
||||
*/
|
||||
/datum/ui_state/default/paper_state
|
||||
/// What edit mode we are in and who is
|
||||
/// writing on it right now
|
||||
@@ -33,7 +32,6 @@
|
||||
var/stamp_name = ""
|
||||
var/stamp_class = ""
|
||||
|
||||
|
||||
/datum/ui_state/default/paper_state/proc/copy_from(datum/ui_state/default/paper_state/from)
|
||||
switch(from.edit_mode)
|
||||
if(MODE_READING)
|
||||
@@ -49,12 +47,11 @@
|
||||
stamp_class = from.stamp_class
|
||||
stamp_name = from.stamp_name
|
||||
|
||||
|
||||
/**
|
||||
** Paper is now using markdown (like in github pull notes) for ALL rendering
|
||||
** so we do loose a bit of functionality but we gain in easy of use of
|
||||
** paper and getting rid of that crashing bug
|
||||
**/
|
||||
* Paper is now using markdown (like in github pull notes) for ALL rendering
|
||||
* so we do loose a bit of functionality but we gain in easy of use of
|
||||
* paper and getting rid of that crashing bug
|
||||
*/
|
||||
/obj/item/paper
|
||||
name = "paper"
|
||||
gender = NEUTER
|
||||
@@ -71,6 +68,8 @@
|
||||
resistance_flags = FLAMMABLE
|
||||
max_integrity = 50
|
||||
dog_fashion = /datum/dog_fashion/head
|
||||
// drop_sound = 'sound/items/handling/paper_drop.ogg'
|
||||
// pickup_sound = 'sound/items/handling/paper_pickup.ogg'
|
||||
grind_results = list(/datum/reagent/cellulose = 3)
|
||||
color = "white"
|
||||
/// What's actually written on the paper.
|
||||
@@ -89,9 +88,6 @@
|
||||
var/contact_poison // Reagent ID to transfer on contact
|
||||
var/contact_poison_volume = 0
|
||||
|
||||
// ui stuff
|
||||
var/ui_x = 600
|
||||
var/ui_y = 800
|
||||
// Ok, so WHY are we caching the ui's?
|
||||
// Since we are not using autoupdate we
|
||||
// need some way to update the ui's of
|
||||
@@ -103,7 +99,6 @@
|
||||
// people look at it
|
||||
var/list/viewing_ui = list()
|
||||
|
||||
|
||||
/// When the sheet can be "filled out"
|
||||
/// This is an associated list
|
||||
var/list/form_fields = list()
|
||||
@@ -116,10 +111,10 @@
|
||||
. = ..()
|
||||
|
||||
/**
|
||||
** This proc copies this sheet of paper to a new
|
||||
** sheet, Makes it nice and easy for carbon and
|
||||
** the copyer machine
|
||||
**/
|
||||
* This proc copies this sheet of paper to a new
|
||||
* sheet, Makes it nice and easy for carbon and
|
||||
* the copyer machine
|
||||
*/
|
||||
/obj/item/paper/proc/copy()
|
||||
var/obj/item/paper/N = new(arglist(args))
|
||||
N.info = info
|
||||
@@ -133,10 +128,10 @@
|
||||
return N
|
||||
|
||||
/**
|
||||
** This proc sets the text of the paper and updates the
|
||||
** icons. You can modify the pen_color after if need
|
||||
** be.
|
||||
**/
|
||||
* This proc sets the text of the paper and updates the
|
||||
* icons. You can modify the pen_color after if need
|
||||
* be.
|
||||
*/
|
||||
/obj/item/paper/proc/setText(text)
|
||||
info = text
|
||||
form_fields = null
|
||||
@@ -152,30 +147,16 @@
|
||||
contact_poison = null
|
||||
. = ..()
|
||||
|
||||
|
||||
/obj/item/paper/Initialize()
|
||||
. = ..()
|
||||
pixel_y = rand(-8, 8)
|
||||
pixel_x = rand(-9, 9)
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/paper/update_icon_state()
|
||||
if(info && show_written_words)
|
||||
icon_state = "[initial(icon_state)]_words"
|
||||
|
||||
/obj/item/paper/ui_base_html(html)
|
||||
/// This might change in a future PR
|
||||
var/datum/asset/spritesheet/assets = get_asset_datum(/datum/asset/spritesheet/simple/paper)
|
||||
. = replacetext(html, "<!--customheadhtml-->", assets.css_tag())
|
||||
|
||||
|
||||
/obj/item/paper/examine_more(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/item/paper/proc/show_content(mob/user)
|
||||
user.examinate(src)
|
||||
|
||||
/obj/item/paper/verb/rename()
|
||||
set name = "Rename paper"
|
||||
set category = "Object"
|
||||
@@ -195,17 +176,14 @@
|
||||
name = "paper[(n_name ? text("- '[n_name]'") : null)]"
|
||||
add_fingerprint(usr)
|
||||
|
||||
|
||||
/obj/item/paper/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] scratches a grid on [user.p_their()] wrist with the paper! It looks like [user.p_theyre()] trying to commit sudoku...</span>")
|
||||
return (BRUTELOSS)
|
||||
|
||||
|
||||
/// ONLY USED FOR APRIL FOOLS
|
||||
/obj/item/paper/proc/reset_spamflag()
|
||||
spam_flag = FALSE
|
||||
|
||||
|
||||
/obj/item/paper/attack_self(mob/user)
|
||||
if(rigged && (SSevents.holidays && SSevents.holidays[APRIL_FOOLS]))
|
||||
if(!spam_flag)
|
||||
@@ -214,7 +192,6 @@
|
||||
addtimer(CALLBACK(src, .proc/reset_spamflag), 20)
|
||||
. = ..()
|
||||
|
||||
|
||||
/obj/item/paper/proc/clearpaper()
|
||||
info = ""
|
||||
stamps = null
|
||||
@@ -222,29 +199,28 @@
|
||||
cut_overlays()
|
||||
update_icon_state()
|
||||
|
||||
|
||||
/obj/item/paper/examine(mob/user)
|
||||
/obj/item/paper/examine_more(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
return list("<span class='notice'><i>You try to read [src]...</i></span>")
|
||||
|
||||
/obj/item/paper/can_interact(mob/user)
|
||||
if(!..())
|
||||
return FALSE
|
||||
if(resistance_flags & ON_FIRE) // Are we on fire? Hard ot read if so
|
||||
// Are we on fire? Hard ot read if so
|
||||
if(resistance_flags & ON_FIRE)
|
||||
return FALSE
|
||||
if(user.is_blind()) // Even harder to read if your blind...braile? humm
|
||||
// Even harder to read if your blind...braile? humm
|
||||
if(user.is_blind())
|
||||
return FALSE
|
||||
return user.can_read(src) // checks if the user can read.
|
||||
|
||||
// checks if the user can read.
|
||||
return user.can_read(src)
|
||||
|
||||
/**
|
||||
** This creates the ui, since we are using a custom state but not much else
|
||||
** just makes it easyer to make it. Also we make a custom ui_key as I am
|
||||
** not sure how tgui handles many producers?
|
||||
**/
|
||||
* This creates the ui, since we are using a custom state but not much else
|
||||
* just makes it easyer to make it.
|
||||
*/
|
||||
/obj/item/paper/proc/create_ui(mob/user, datum/ui_state/default/paper_state/state)
|
||||
ui_interact(user, "main", null, FALSE, null, state)
|
||||
|
||||
ui_interact(user, state = state)
|
||||
|
||||
/obj/item/proc/burn_paper_product_attackby_check(obj/item/I, mob/living/user, bypass_clumsy)
|
||||
var/ignition_message = I.ignition_effect(src, user)
|
||||
@@ -319,24 +295,27 @@
|
||||
if(.)
|
||||
info = "[stars(info)]"
|
||||
|
||||
/obj/item/paper/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/default/paper_state/state = new)
|
||||
ui_key = "main-[REF(user)]"
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/item/paper/ui_assets(mob/user)
|
||||
return list(
|
||||
get_asset_datum(/datum/asset/spritesheet/simple/paper),
|
||||
)
|
||||
|
||||
/obj/item/paper/ui_interact(mob/user, datum/tgui/ui,
|
||||
datum/ui_state/default/paper_state/state)
|
||||
// Update the state
|
||||
ui = ui || SStgui.get_open_ui(user, src)
|
||||
if(ui && state)
|
||||
var/datum/ui_state/default/paper_state/current_state = ui.state
|
||||
current_state.copy_from(state)
|
||||
// Update the UI
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
var/datum/asset/assets = get_asset_datum(/datum/asset/spritesheet/simple/paper)
|
||||
assets.send(user)
|
||||
// The x size is because we double the width for the editor
|
||||
ui = new(user, src, ui_key, "PaperSheet", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "PaperSheet", name)
|
||||
state = new
|
||||
ui.set_state(state)
|
||||
ui.set_autoupdate(FALSE)
|
||||
viewing_ui[user] = ui
|
||||
ui.open()
|
||||
else
|
||||
var/datum/ui_state/default/paper_state/last_state = ui.state
|
||||
if(last_state)
|
||||
last_state.copy_from(state)
|
||||
else
|
||||
ui.state = state
|
||||
|
||||
|
||||
/obj/item/paper/ui_close(mob/user)
|
||||
/// close the editing window and change the mode
|
||||
@@ -346,7 +325,7 @@
|
||||
// Again, we have to do this as autoupdate is off
|
||||
/obj/item/paper/proc/update_all_ui()
|
||||
for(var/datum/tgui/ui in viewing_ui)
|
||||
ui.update()
|
||||
ui.process(force = TRUE)
|
||||
|
||||
// Again, we have to do this as autoupdate is off
|
||||
/obj/item/paper/proc/close_all_ui()
|
||||
@@ -382,7 +361,6 @@
|
||||
|
||||
return data
|
||||
|
||||
|
||||
/obj/item/paper/ui_act(action, params, datum/tgui/ui, datum/ui_state/default/paper_state/state)
|
||||
if(..())
|
||||
return
|
||||
@@ -444,21 +422,18 @@
|
||||
|
||||
. = TRUE
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Construction paper
|
||||
*/
|
||||
|
||||
/obj/item/paper/construction
|
||||
|
||||
/obj/item/paper/construction/Initialize()
|
||||
. = ..()
|
||||
color = pick("FF0000", "#33cc33", "#ffb366", "#551A8B", "#ff80d5", "#4d94ff")
|
||||
|
||||
/*
|
||||
/**
|
||||
* Natural paper
|
||||
*/
|
||||
|
||||
/obj/item/paper/natural/Initialize()
|
||||
. = ..()
|
||||
color = "#FFF5ED"
|
||||
|
||||
+25
-62
@@ -849,26 +849,19 @@
|
||||
if((stat & MAINT) && !opened) //no board; no interface
|
||||
return
|
||||
|
||||
/obj/machinery/power/apc/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)
|
||||
|
||||
/obj/machinery/power/apc/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "Apc", name, 480, 460, master_ui, state)
|
||||
ui = new(user, src, "Apc", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/power/apc/ui_data(mob/user)
|
||||
var/obj/item/implant/hijack/H = user.getImplant(/obj/item/implant/hijack)
|
||||
var/abilitiesavail = FALSE
|
||||
if (H && !H.stealthmode && H.toggled)
|
||||
abilitiesavail = TRUE
|
||||
var/list/data = list(
|
||||
"locked" = locked,
|
||||
"lock_nightshift" = nightshift_requires_auth,
|
||||
"failTime" = failure_timer,
|
||||
"isOperating" = operating,
|
||||
"externalPower" = main_status,
|
||||
"powerCellStatus" = (cell?.percent() || null),
|
||||
"powerCellStatus" = cell ? cell.percent() : null,
|
||||
"chargeMode" = chargemode,
|
||||
"chargingStatus" = charging,
|
||||
"totalLoad" = DisplayPower(lastused_total),
|
||||
@@ -877,10 +870,7 @@
|
||||
"malfStatus" = get_malf_status(user),
|
||||
"emergencyLights" = !emergency_lights,
|
||||
"nightshiftLights" = nightshift_lights,
|
||||
"hijackable" = HAS_TRAIT(user,TRAIT_HIJACKER),
|
||||
"hijacker" = hijacker == user ? TRUE : FALSE,
|
||||
"drainavail" = cell && cell.percent() >= 85 && abilitiesavail,
|
||||
"lockdownavail" = cell && cell.percent() >= 35 && abilitiesavail,
|
||||
|
||||
"powerChannels" = list(
|
||||
list(
|
||||
"title" = "Equipment",
|
||||
@@ -974,43 +964,32 @@
|
||||
. = UI_INTERACTIVE
|
||||
|
||||
/obj/machinery/power/apc/ui_act(action, params)
|
||||
if(..() || !can_use(usr, 1))
|
||||
return
|
||||
if(failure_timer)
|
||||
if(action == "reboot")
|
||||
failure_timer = 0
|
||||
update_icon()
|
||||
update()
|
||||
if(action == "hijack" && can_use(usr, 1)) //don't need auth for hijack button
|
||||
hijack(usr)
|
||||
return
|
||||
var/authorized = (!locked || area.hasSiliconAccessInArea(usr, PRIVILEDGES_SILICON|PRIVILEDGES_DRONE) || (integration_cog && (is_servant_of_ratvar(usr))))
|
||||
if((action == "toggle_nightshift") && (!nightshift_requires_auth || authorized))
|
||||
toggle_nightshift_lights()
|
||||
return TRUE
|
||||
if(!authorized)
|
||||
if(..() || !can_use(usr, 1) || (locked && area.hasSiliconAccessInArea(usr, PRIVILEDGES_SILICON|PRIVILEDGES_DRONE) && !failure_timer && action != "toggle_nightshift") || (integration_cog && (is_servant_of_ratvar(usr)))
|
||||
return
|
||||
switch(action)
|
||||
if("lock")
|
||||
if(area.hasSiliconAccessInArea(usr))
|
||||
if((obj_flags & EMAGGED) || (stat & (BROKEN|MAINT)))
|
||||
to_chat(usr, "The APC does not respond to the command.")
|
||||
to_chat(usr, "<span class='warning'>The APC does not respond to the command!</span>")
|
||||
else
|
||||
locked = !locked
|
||||
update_icon()
|
||||
return TRUE
|
||||
. = TRUE
|
||||
if("cover")
|
||||
coverlocked = !coverlocked
|
||||
return TRUE
|
||||
. = TRUE
|
||||
if("breaker")
|
||||
toggle_breaker()
|
||||
return TRUE
|
||||
toggle_breaker(usr)
|
||||
. = TRUE
|
||||
if("toggle_nightshift")
|
||||
toggle_nightshift_lights()
|
||||
. = TRUE
|
||||
if("charge")
|
||||
chargemode = !chargemode
|
||||
if(!chargemode)
|
||||
charging = APC_NOT_CHARGING
|
||||
update_icon()
|
||||
return TRUE
|
||||
. = TRUE
|
||||
if("channel")
|
||||
if(params["eqp"])
|
||||
equipment = setsubsystem(text2num(params["eqp"]))
|
||||
@@ -1024,23 +1003,24 @@
|
||||
environ = setsubsystem(text2num(params["env"]))
|
||||
update_icon()
|
||||
update()
|
||||
return TRUE
|
||||
. = TRUE
|
||||
if("overload")
|
||||
if(area.hasSiliconAccessInArea(usr))
|
||||
if(usr.has_unlimited_silicon_privilege)
|
||||
overload_lighting()
|
||||
return TRUE
|
||||
. = TRUE
|
||||
if("hack")
|
||||
if(get_malf_status(usr))
|
||||
malfhack(usr)
|
||||
return TRUE
|
||||
if("occupy")
|
||||
if(get_malf_status(usr))
|
||||
malfoccupy(usr)
|
||||
return TRUE
|
||||
if("deoccupy")
|
||||
if(get_malf_status(usr))
|
||||
malfvacate()
|
||||
return TRUE
|
||||
if("reboot")
|
||||
failure_timer = 0
|
||||
update_icon()
|
||||
update()
|
||||
if("emergency_lighting")
|
||||
emergency_lights = !emergency_lights
|
||||
for(var/obj/machinery/light/L in area)
|
||||
@@ -1048,31 +1028,14 @@
|
||||
L.no_emergency = emergency_lights
|
||||
INVOKE_ASYNC(L, /obj/machinery/light/.proc/update, FALSE)
|
||||
CHECK_TICK
|
||||
if("drain")
|
||||
cell.use(cell.charge)
|
||||
hijacker.toggleSiliconAccessArea(area)
|
||||
hijacker = null
|
||||
set_hijacked_lighting()
|
||||
update_icon()
|
||||
var/obj/item/implant/hijack/H = usr.getImplant(/obj/item/implant/hijack)
|
||||
H.stealthcooldown = world.time + 2 MINUTES
|
||||
energy_fail(30 SECONDS * (cell.charge / cell.maxcharge))
|
||||
if("lockdown")
|
||||
var/celluse = rand(20,35)
|
||||
celluse = celluse /100
|
||||
for (var/obj/machinery/door/D in GLOB.airlocks)
|
||||
if (get_area(D) == area)
|
||||
INVOKE_ASYNC(D,/obj/machinery/door.proc/hostile_lockdown,usr, FALSE)
|
||||
addtimer(CALLBACK(D,/obj/machinery/door.proc/disable_lockdown, FALSE), 30 SECONDS)
|
||||
cell.charge -= cell.maxcharge*celluse
|
||||
var/obj/item/implant/hijack/H = usr.getImplant(/obj/item/implant/hijack)
|
||||
H.stealthcooldown = world.time + 3 MINUTES
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/apc/proc/toggle_breaker()
|
||||
/obj/machinery/power/apc/proc/toggle_breaker(mob/user)
|
||||
if(!is_operational() || failure_timer)
|
||||
return
|
||||
operating = !operating
|
||||
add_hiddenprint(user) //delete when runtime
|
||||
log_game("[key_name(user)] turned [operating ? "on" : "off"] the [src] in [AREACOORD(src)]")
|
||||
update()
|
||||
update_icon()
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
|
||||
/obj/machinery/gravity_generator/part/get_status()
|
||||
return main_part?.get_status()
|
||||
|
||||
/obj/machinery/gravity_generator/part/attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
|
||||
/obj/machinery/gravity_generator/part/attack_hand(mob/user)
|
||||
return main_part.attack_hand(user)
|
||||
|
||||
/obj/machinery/gravity_generator/part/set_broken()
|
||||
@@ -116,8 +116,6 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
|
||||
sprite_number = 8
|
||||
use_power = IDLE_POWER_USE
|
||||
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OFFLINE
|
||||
ui_x = 400
|
||||
ui_y = 165
|
||||
var/on = TRUE
|
||||
var/breaker = TRUE
|
||||
var/list/parts = list()
|
||||
@@ -222,11 +220,10 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/gravity_generator/main/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)
|
||||
/obj/machinery/gravity_generator/main/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "GravityGenerator", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "GravityGenerator", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/gravity_generator/main/ui_data(mob/user)
|
||||
|
||||
Reference in New Issue
Block a user