From ccae3aebd57f7860e5a691c39b5d3aef5d301659 Mon Sep 17 00:00:00 2001 From: Artur Date: Fri, 8 May 2020 19:50:49 +0300 Subject: [PATCH] Trying to get the sleeper and clockworkslab to work --- .../clockcult/clock_items/clockwork_slab.dm | 77 ++--- .../chemistry/machinery/chem_heater.dm | 2 +- tgui/packages/tgui/interfaces/ChemHeater.js | 2 +- .../packages/tgui/interfaces/ClockworkSlab.js | 269 ++++++++---------- tgui/packages/tgui/interfaces/Sleeper.js | 245 ++++++++-------- tgui/packages/tgui/public/tgui.bundle.js | 2 +- 6 files changed, 271 insertions(+), 326 deletions(-) diff --git a/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm b/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm index fed5b3e827..5ba472b5d1 100644 --- a/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm +++ b/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm @@ -171,7 +171,7 @@ return FALSE if(!is_servant_of_ratvar(user)) to_chat(user, "The information on [src]'s display shifts rapidly. After a moment, your head begins to pound, and you tear your eyes away.") - if(user.confused || user.dizziness) //We dont want this to stack. + if(user.confused || user.dizziness) user.confused += 5 user.dizziness += 5 return FALSE @@ -201,7 +201,7 @@ if(!ui) ui = new(user, src, ui_key, "ClockworkSlab", name, ui_x, ui_z, master_ui, state) ui.open() - + /obj/item/clockwork/slab/proc/recite_scripture(datum/clockwork_scripture/scripture, mob/living/user) if(!scripture || !user || !user.canUseTopic(src) || (!no_cost && !can_recite_scripture(user))) return FALSE @@ -432,40 +432,26 @@ data["scriptures"] = list() for(var/s in GLOB.all_scripture) var/datum/clockwork_scripture/S = GLOB.all_scripture[s] - if(S.tier == selected_scripture) //display only scriptures of the selected tier - var/scripture_color = get_component_color_bright(S.primary_component) - var/list/temp_info = list("name" = "[S.name]", - "descname" = "([S.descname])", - "tip" = "[S.desc]\n[S.usage_tip]", - "required" = "([DisplayPower(S.power_cost)][S.special_power_text ? "+ [replacetext(S.special_power_text, "POWERCOST", "[DisplayPower(S.special_power_cost)]")]" : ""])", - "type" = "[S.type]", - "quickbind" = S.quickbind) - if(S.important) - temp_info["name"] = "[temp_info["name"]]" - var/found = quickbound.Find(S.type) - if(found) - temp_info["bound"] = "[found]" - if(S.invokers_required > 1) - temp_info["invokers"] = "Invokers: [S.invokers_required]" - data["scripture"] += list(temp_info) - return data + var/scripture_color = get_component_color_bright(S.primary_component) + var/list/temp_info = list("name" = "[S.name]", + "descname" = "([S.descname])", + "tip" = "[S.desc]\n[S.usage_tip]", + "required" = "([DisplayPower(S.power_cost)][S.special_power_text ? "+ [replacetext(S.special_power_text, "POWERCOST", "[DisplayPower(S.special_power_cost)]")]" : ""])", + "type" = "[S.type]", + "quickbind" = S.quickbind) + if(S.important) + temp_info["name"] = "[temp_info["name"]]" + var/found = quickbound.Find(S.type) + if(found) + temp_info["bound"] = "[found]" + if(S.invokers_required > 1) + temp_info["invokers"] = "Invokers: [S.invokers_required]" + data["scripture"] += list(temp_info) + return data /obj/item/clockwork/slab/ui_static_data(mob/user) var/list/data = list() - switch(selected_scripture) //display info based on selected scripture tier - if(SCRIPTURE_DRIVER) - data["tier_info"] = "These scriptures are permanently unlocked." - if(SCRIPTURE_SCRIPT) - if(SSticker.scripture_states[SCRIPTURE_SCRIPT]) - data["tier_info"] = "These scriptures are permanently unlocked." - else - data["tier_info"] = "These scriptures will automatically unlock when the Ark is halfway ready or if [DisplayPower(SCRIPT_UNLOCK_THRESHOLD)] of power is reached." - if(SCRIPTURE_APPLICATION) - if(SSticker.scripture_states[SCRIPTURE_APPLICATION]) - data["tier_info"] = "These scriptures are permanently unlocked." - else - data["tier_info"] = "Unlock these optional scriptures by converting another servant or if [DisplayPower(APPLICATION_UNLOCK_THRESHOLD)] of power is reached.." - + data["tier_info"] = "These scriptures are permanently unlocked." data["selected"] = selected_scripture data["scripturecolors"] = "Scriptures in yellow are related to construction and building.
\ Scriptures in red are related to attacking and offense.
\ @@ -474,19 +460,18 @@ Scriptures with italicized names are important to success." generate_all_scripture() data["recollection"] = recollecting - if(recollecting) - data["recollection_categories"] = GLOB.ratvar_awakens ? list() : list(\ - list("name" = "Getting Started", "desc" = "First-time servant? Read this first."), \ - list("name" = "Basics", "desc" = "A primer on how to play as a servant."), \ - list("name" = "Terminology", "desc" = "Common acronyms, words, and terms."), \ - list("name" = "Components", "desc" = "Information on components, your primary resource."), \ - list("name" = "Scripture", "desc" = "Information on scripture, ancient tools used by the cult."), \ - list("name" = "Power", "desc" = "The power system that certain objects use to function."), \ - list("name" = "Conversion", "desc" = "Converting the crew, cyborgs, and very walls to your cause."), \ - ) - data["rec_text"] = recollection() - data["rec_section"] = GLOB.ratvar_awakens ? "" : get_recollection_text(recollection_category) - data["rec_binds"] = GLOB.ratvar_awakens ? "" : get_recollection_quickbinds() + data["recollection_categories"] = GLOB.ratvar_awakens ? list() : list(\ + list("name" = "Getting Started", "desc" = "First-time servant? Read this first."), \ + list("name" = "Basics", "desc" = "A primer on how to play as a servant."), \ + list("name" = "Terminology", "desc" = "Common acronyms, words, and terms."), \ + list("name" = "Components", "desc" = "Information on components, your primary resource."), \ + list("name" = "Scripture", "desc" = "Information on scripture, ancient tools used by the cult."), \ + list("name" = "Power", "desc" = "The power system that certain objects use to function."), \ + list("name" = "Conversion", "desc" = "Converting the crew, cyborgs, and very walls to your cause."), \ + ) + data["rec_text"] = recollection() + data["rec_section"] = GLOB.ratvar_awakens ? "" : get_recollection_text(recollection_category) + data["rec_binds"] = GLOB.ratvar_awakens ? "" : get_recollection_quickbinds() return data /obj/item/clockwork/slab/ui_act(action, params) diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm index d2e7b5f883..f0d6bab381 100644 --- a/code/modules/reagents/chemistry/machinery/chem_heater.dm +++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm @@ -103,7 +103,7 @@ 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, "ChemHeater", name, 275, 400, master_ui, state) + ui = new(user, src, ui_key, "ChemHeater", name, 280, 400, master_ui, state) ui.open() /obj/machinery/chem_heater/ui_data() diff --git a/tgui/packages/tgui/interfaces/ChemHeater.js b/tgui/packages/tgui/interfaces/ChemHeater.js index c47564a51a..b49349d4d7 100644 --- a/tgui/packages/tgui/interfaces/ChemHeater.js +++ b/tgui/packages/tgui/interfaces/ChemHeater.js @@ -62,7 +62,7 @@ export const ChemHeater = (props, context) => { {beakerCurrentVolume} / {beakerMaxVolume} units, - {data.beakerCurrentpH} pH + {data.currentpH} pH