From 501d33cdddacd1bb9bed4e4a25992f95b5431a0b Mon Sep 17 00:00:00 2001 From: Letter N <24603524+LetterN@users.noreply.github.com> Date: Fri, 19 Feb 2021 10:32:24 +0800 Subject: [PATCH] agony --- code/_globalvars/lists/flavor_misc.dm | 1 + code/_onclick/hud/robot.dm | 2 +- code/modules/admin/verbs/secrets.dm | 2 +- .../clock_helpers/scripture_checks.dm | 2 +- .../clockcult/clock_items/clockwork_slab.dm | 21 +- .../modules/mob/living/silicon/robot/death.dm | 1 + .../packages/tgui/interfaces/ClockworkSlab.js | 358 ++++++++++-------- .../tgui/interfaces/CommunicationsConsole.js | 26 +- tgui/public/tgui.bundle.js | 2 +- 9 files changed, 229 insertions(+), 186 deletions(-) diff --git a/code/_globalvars/lists/flavor_misc.dm b/code/_globalvars/lists/flavor_misc.dm index 8793dbabc1..5a68ee8d56 100644 --- a/code/_globalvars/lists/flavor_misc.dm +++ b/code/_globalvars/lists/flavor_misc.dm @@ -126,6 +126,7 @@ GLOBAL_LIST_INIT(ai_core_display_screens, list( "Not Malf", "Patriot", "Pirate", + "Portrait", "President", "Rainbow", "Clown", diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 2d73437f6e..33a9cec80c 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -285,7 +285,7 @@ /obj/screen/robot/lamp name = "headlamp" - icon_state = "lamp0" + icon_state = "lamp_off" var/mob/living/silicon/robot/robot /obj/screen/robot/lamp/Click() diff --git a/code/modules/admin/verbs/secrets.dm b/code/modules/admin/verbs/secrets.dm index 342b8f0bfe..6255198b63 100644 --- a/code/modules/admin/verbs/secrets.dm +++ b/code/modules/admin/verbs/secrets.dm @@ -613,7 +613,7 @@ var/mob/chosen = players[1] if (chosen.client) chosen.client.prefs.copy_to(spawnedMob) - spawnedMob.key = chosen.key + chosen.transfer_ckey(spawnedMob) players -= chosen if (ishuman(spawnedMob) && ispath(humanoutfit, /datum/outfit)) var/mob/living/carbon/human/H = spawnedMob diff --git a/code/modules/antagonists/clockcult/clock_helpers/scripture_checks.dm b/code/modules/antagonists/clockcult/clock_helpers/scripture_checks.dm index 66e20b6e87..53e70e1404 100644 --- a/code/modules/antagonists/clockcult/clock_helpers/scripture_checks.dm +++ b/code/modules/antagonists/clockcult/clock_helpers/scripture_checks.dm @@ -19,7 +19,7 @@ update_slab_info() for(var/mob/M in GLOB.player_list) if(is_servant_of_ratvar(M) || isobserver(M)) - M.playsound_local(M, 'sound/magic/clockwork/scripture_tier_up.ogg', 50, FALSE, pressure_affected = FALSE) + M.playsound_local(M, 'sound/magic/clockwork/scripture_tier_up.ogg', 20, FALSE, pressure_affected = FALSE) /proc/update_slab_info(obj/item/clockwork/slab/set_slab) generate_all_scripture() diff --git a/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm b/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm index ff6dc12ce1..8060b7b0cd 100644 --- a/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm +++ b/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm @@ -21,8 +21,10 @@ var/recollecting = TRUE //if we're looking at fancy recollection. tutorial enabled by default var/recollection_category = "Default" - var/list/quickbound = list(/datum/clockwork_scripture/spatial_gateway, \ - /datum/clockwork_scripture/ranged_ability/kindle, /datum/clockwork_scripture/ranged_ability/hateful_manacles) //quickbound scripture, accessed by index + var/list/quickbound = list( + /datum/clockwork_scripture/spatial_gateway, + /datum/clockwork_scripture/ranged_ability/kindle, + /datum/clockwork_scripture/ranged_ability/hateful_manacles) //quickbound scripture, accessed by index var/maximum_quickbound = 5 //how many quickbound scriptures we can have var/obj/structure/destructible/clockwork/trap/linking //If we're linking traps together, which ones we're doing @@ -326,6 +328,7 @@ "requirement" = "Unlock powerful equipment and structures by converting five servants or if [DisplayPower(JUDGEMENT_UNLOCK_THRESHOLD)] of power is reached..", "ready" = SSticker.scripture_states[SCRIPTURE_JUDGEMENT] ) + // no need to learn shit, ratvar is free .["recollection_categories"] = list() if(GLOB.ratvar_awakens) return @@ -340,19 +343,25 @@ ) .["rec_section"] = get_recollection(recollection_category) generate_all_scripture() - //needs a new place to live, preferably when clockcult unlocks/downgrades a tier. Smart enough to earlyreturn. + //needs a new place to live, preferably when clockcult unlocks/downgrades a tier. + //comsig maybe? /obj/item/clockwork/slab/ui_act(action, params) + . = ..() + if(.) + return switch(action) if("toggle") recollecting = !recollecting + . = TRUE if("recite") INVOKE_ASYNC(src, .proc/recite_scripture, text2path(params["script"]), usr, FALSE) + . = TRUE if("bind") var/datum/clockwork_scripture/path = text2path(params["script"]) //we need a path and not a string if(!ispath(path, /datum/clockwork_scripture) || !initial(path.quickbind) || initial(path.tier) == SCRIPTURE_PERIPHERAL) //fuck you href bus to_chat(usr, "Nice try using href exploits") - return + return FALSE var/found_index = quickbound.Find(path) if(found_index) //hey, we already HAVE this bound if(LAZYLEN(quickbound) == found_index) //if it's the last scripture, remove it instead of leaving a null @@ -361,6 +370,7 @@ quickbound[found_index] = null //otherwise, leave it as a null so the scripture maintains position update_quickbind() else + // todo: async this due to ((input)) but its fine for now var/target_index = input("Position of [initial(path.name)], 1 to [maximum_quickbound]?", "Input") as num|null if(isnum(target_index) && target_index > 0 && target_index <= maximum_quickbound && !..()) var/datum/clockwork_scripture/S @@ -368,10 +378,11 @@ S = quickbound[target_index] if(S != path) quickbind_to_slot(path, target_index) + . = TRUE if("rec_category") recollection_category = params["category"] update_static_data() - return TRUE + . = TRUE /obj/item/clockwork/slab/proc/quickbind_to_slot(datum/clockwork_scripture/scripture, index) //takes a typepath(typecast for initial()) and binds it to a slot if(!ispath(scripture) || !scripture || (scripture in quickbound)) diff --git a/code/modules/mob/living/silicon/robot/death.dm b/code/modules/mob/living/silicon/robot/death.dm index 626382f6bc..4fd2888e00 100644 --- a/code/modules/mob/living/silicon/robot/death.dm +++ b/code/modules/mob/living/silicon/robot/death.dm @@ -23,6 +23,7 @@ locked = FALSE //unlock cover + update_mobility() if(!QDELETED(builtInCamera) && builtInCamera.status) builtInCamera.toggle_cam(src,0) toggle_headlamp(TRUE) //So borg lights are disabled when killed. diff --git a/tgui/packages/tgui/interfaces/ClockworkSlab.js b/tgui/packages/tgui/interfaces/ClockworkSlab.js index 48512fd59c..aebaaaf797 100644 --- a/tgui/packages/tgui/interfaces/ClockworkSlab.js +++ b/tgui/packages/tgui/interfaces/ClockworkSlab.js @@ -1,3 +1,11 @@ +/** + * @file + * @copyright 2021 LetterN (https://github.com/LetterN) + * @author Original LetterN (https://github.com/LetterN) + * @author Changes arturlang + * @license MIT + */ + import { useBackend, useSharedState } from '../backend'; import { map } from 'common/collections'; import { Section, Tabs, Table, Button, Box, NoticeBox, Divider } from '../components'; @@ -15,14 +23,9 @@ export const ClockworkSlab = (props, context) => { const { act, data } = useBackend(context); const { recollection = true, - recollection_categories = [], - rec_section = null, - rec_binds = [], scripture = {}, tier_infos = {}, power = "0 W", - power_unformatted = 0, - HONOR_RATVAR = false, // is ratvar free yet? } = data; const [ tab, @@ -42,117 +45,7 @@ export const ClockworkSlab = (props, context) => { height={420}> {recollection ? ( // tutorial -
act('toggle')}> - Recital - - )}> - - {HONOR_RATVAR ? ( - - {REC_RATVAR} - - ) : ( - - - Chetr nyy hagehguf naq ubabe Ratvar. - - - NOTICE: This information is out of date. - Read the Ark & You primer in your backpack - or read the wiki page for current info. - - - These pages serve as the archives of Ratvar, the - Clockwork Justiciar. This section of your slab - has information on being as a Servant, advice - for what to do next, and pointers for serving the - master well. You should recommended that you check this - area for help if you get stuck or need guidance on - what to do next. -

- Disclaimer: Many objects, terms, and phrases, such as - Servant, Cache, and Slab, are capitalized like proper - nouns. This is a quirk of the Ratvarian language do - not let it confuse you! You are free to use the names - in pronoun form when speaking in normal languages. -
-
- )} -
- {recollection_categories?.map(cat => ( - -
- -
- ))} - - - - {rec_section?.title ? ( - rec_section.title - ) : ( - '500 Slab Internal archives not found.' - )} - -

- {rec_section?.info ? ( - rec_section.info - ) : ( - "One of the cogscarabs must've misplaced this section." - )} -
-
- - - - Quickbound Scripture - -
- - You can have up to five scriptures bound to - action buttons for easy use. - -

- {rec_binds?.map(bind => ( - - A Quickbind slot ({rec_binds.indexOf(bind)+1}), - currently set to  - - {bind?.name ? bind.name : "None"} - - . -
-
- ))} -
-
+ ) : (
{ - {scriptInTab?.map(script => ( - - - - {script.name} - - {` - ${script.descname} - ${script.invokers || ''} - `} - - - - - - - - - ))} +
@@ -272,3 +118,187 @@ export const ClockworkSlab = (props, context) => { ); }; + +export const CSScripture = (props, context) => { + const { act, data } = useBackend(context); + const { + power_unformatted = 0, + } = data; + const { + scriptInTab, + } = props; + + return ( + scriptInTab?.map(script => ( + + + + {script.name} + + {` + ${script.descname} + ${script.invokers || ''} + `} + + + + + + + + + )) + ); +}; + +export const CSTutorial = (props, context) => { + const { act, data } = useBackend(context); + const { + recollection_categories = [], + rec_section = null, + rec_binds = [], + HONOR_RATVAR = false, // is ratvar free yet? + } = data; + return ( +
act('toggle')}> + Recital + + )}> + + {HONOR_RATVAR ? ( + + {REC_RATVAR} + + ) : ( + + + Chetr nyy hagehguf naq ubabe Ratvar. + + + NOTICE: This information is out of date. + Read the Ark & You primer in your backpack + or read the wiki page for current info. + + These pages serve as the archives of Ratvar, the + Clockwork Justiciar. This section of your slab + has information on being as a Servant, advice + for what to do next, and pointers for serving the + master well. You should recommended that you check this + area for help if you get stuck or need guidance on + what to do next. +

+ + Disclaimer: Many objects, terms, and phrases, such as + Servant, Cache, and Slab, are capitalized like proper + nouns. This is a quirk of the Ratvarian language do + not let it confuse you! You are free to use the names + in pronoun form when speaking in normal languages. + +
+ )} +
+ {recollection_categories?.map(cat => ( + +
+ +
+ ))} + + + + {rec_section?.title ? ( + rec_section.title + ) : ( + '500 Slab Internal archives not found.' + )} + +

+ {rec_section?.info ? ( + rec_section.info + ) : ( + "One of the cogscarabs must've misplaced this section." + )} +
+
+ + + + Quickbound Scripture + +
+ + You can have up to five scriptures bound to + action buttons for easy use. + +

+ {rec_binds?.map(bind => ( + + A Quickbind slot ({rec_binds.indexOf(bind)+1}), + currently set to  + + {bind?.name ? bind.name : "None"} + + . +
+
+ ))} +
+
+ ); +}; diff --git a/tgui/packages/tgui/interfaces/CommunicationsConsole.js b/tgui/packages/tgui/interfaces/CommunicationsConsole.js index 08fccd3790..ba7a9932a0 100644 --- a/tgui/packages/tgui/interfaces/CommunicationsConsole.js +++ b/tgui/packages/tgui/interfaces/CommunicationsConsole.js @@ -15,7 +15,7 @@ const SWIPE_NEEDED = "SWIPE_NEEDED"; const sortByCreditCost = sortBy(shuttle => shuttle.creditCost); -const AlertButton = (props, context) => { +export const AlertButton = (props, context) => { const { act, data } = useBackend(context); const { alertLevelTick, canSetAlertLevel } = data; const { alertLevel, setShowAlertLevelConfirm } = props; @@ -44,7 +44,7 @@ const AlertButton = (props, context) => { ); }; -const MessageModal = (props, context) => { +export const MessageModal = (props, context) => { const { data } = useBackend(context); const { maxMessageLength } = data; @@ -106,7 +106,7 @@ const MessageModal = (props, context) => { ); }; -const NoConnectionModal = () => { +export const NoConnectionModal = () => { return ( @@ -140,7 +140,7 @@ const NoConnectionModal = () => { ); }; -const PageBuyingShuttle = (props, context) => { +export const PageBuyingShuttle = (props, context) => { const { act, data } = useBackend(context); return ( @@ -196,7 +196,7 @@ const PageBuyingShuttle = (props, context) => { ); }; -const PageChangingStatus = (props, context) => { +export const PageChangingStatus = (props, context) => { const { act, data } = useBackend(context); const { maxStatusLineLength } = data; @@ -294,7 +294,7 @@ const PageChangingStatus = (props, context) => { ); }; -const PageMain = (props, context) => { +export const PageMain = (props, context) => { const { act, data } = useBackend(context); const { alertLevel, @@ -336,9 +336,9 @@ const PageMain = (props, context) => { return (
- { - shuttleCalled - ? { tooltipPosition="bottom-right" onClick={() => act("recallShuttle")} /> - :