From 061dc94b3873209655425dfad2b5267c46df3716 Mon Sep 17 00:00:00 2001 From: magatsuchi <88991542+magatsuchi@users.noreply.github.com> Date: Wed, 20 Apr 2022 18:06:17 -0500 Subject: [PATCH] [NO GBP] more tablet additions (#66358) About The Pull Request actually makes the damn action button for the flashlight on your device work, as well as fixing clown/silicon/mime names properly showing up fixes not chunky finger people not being able to use pdas Why It's Good For The Game tweaks to make the tablet more user friendly Changelog cl fix: actually makes the flashlight action button work, and fixes silicon/clown/mime names showing up properly on tablets/messenger /cl --- code/datums/action.dm | 3 +++ code/modules/mob/living/silicon/pai/pai.dm | 6 ++++++ code/modules/mob/living/silicon/silicon.dm | 8 ++++++++ code/modules/mob/mob.dm | 3 +++ .../computers/item/computer.dm | 17 +++++++++++++++++ .../computers/item/computer_ui.dm | 4 +--- .../computers/item/role_tablet_presets.dm | 8 ++++++++ .../modular_computers/computers/item/tablet.dm | 1 + 8 files changed, 47 insertions(+), 3 deletions(-) diff --git a/code/datums/action.dm b/code/datums/action.dm index 0b180de7773..ba7e41cd4ef 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -265,6 +265,9 @@ /datum/action/item_action/startchainsaw name = "Pull The Starting Cord" +/datum/action/item_action/toggle_computer_light + name = "Toggle Flashlight" + /datum/action/item_action/toggle_gunlight name = "Toggle Gunlight" diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 5510e5c33ad..5eed839b807 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -184,6 +184,8 @@ ADD_TRAIT(src, TRAIT_IMMOBILIZED, PAI_FOLDED) ADD_TRAIT(src, TRAIT_HANDS_BLOCKED, PAI_FOLDED) + return INITIALIZE_HINT_LATELOAD + /mob/living/silicon/pai/Destroy() QDEL_NULL(atmos_analyzer) QDEL_NULL(internal_instrument) @@ -200,6 +202,10 @@ GLOB.pai_list -= src return ..() +/mob/living/silicon/pai/LateInitialize() + . = ..() + modularInterface.saved_identification = name + /mob/living/silicon/pai/make_laws() laws = new /datum/ai_laws/pai() return TRUE diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 0b0e6c4d688..82f81df154c 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -454,3 +454,11 @@ var/datum/computer_file/program/robotact/program = modularInterface.get_robotact() if(program) program.force_full_update() + +/// Same as the normal character name replacement, but updates the contents of the modular interface. +/mob/living/silicon/fully_replace_character_name(oldname, newname) + . = ..() + if(!modularInterface) + stack_trace("Silicon [src] ( [type] ) was somehow missing their integrated tablet. Please make a bug report.") + create_modularInterface() + modularInterface.saved_identification = newname diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 8fd2cc53368..60bbf54ca40 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1046,6 +1046,9 @@ var/obj/item/modular_computer/tablet/pda/PDA = A if(PDA.saved_identification == oldname) PDA.saved_identification = newname + var/obj/item/computer_hardware/identifier/display = PDA.all_components[MC_IDENTIFY] + if(display) + display.UpdateDisplay() if(!search_id) break search_pda = 0 diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index e7b30d69a04..9b6b4dbbb99 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -55,6 +55,9 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar var/saved_identification = null // next two values are the currently imprinted id and job values var/saved_job = null + /// Allow people with chunky fingers to use? + var/allow_chunky = FALSE + var/honkamnt = 0 /// honk honk honk honk honk honkh onk honkhnoohnk var/list/idle_threads // Idle programs on background. They still receive process calls but can't be interacted with. @@ -68,6 +71,8 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar var/obj/item/paicard/pai = null + var/datum/action/item_action/toggle_computer_light/light_butt + /obj/item/modular_computer/Initialize(mapload) . = ..() @@ -81,6 +86,8 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar soundloop = new(src, enabled) if(id) id.UpdateDisplay() + if(has_light) + light_butt = new(src) update_appearance() Add_Messenger() @@ -100,10 +107,19 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar if(istype(pai)) QDEL_NULL(pai) + if(istype(light_butt)) + QDEL_NULL(light_butt) physical = null return ..() +/obj/item/modular_computer/ui_action_click(mob/user, actiontype) + if(istype(actiontype, light_butt)) + toggle_flashlight() + else + ..() + + /obj/item/modular_computer/pre_attack_secondary(atom/A, mob/living/user, params) if(active_program?.tap(A, user, params)) user.do_attack_animation(A) //Emulate this animation since we kill the attack in three lines @@ -527,6 +543,7 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar set_light(comp_light_luminosity, 1, comp_light_color) else set_light(0) + update_appearance() return TRUE /** diff --git a/code/modules/modular_computers/computers/item/computer_ui.dm b/code/modules/modular_computers/computers/item/computer_ui.dm index 7319751bc8d..cd2b780e8a3 100644 --- a/code/modules/modular_computers/computers/item/computer_ui.dm +++ b/code/modules/modular_computers/computers/item/computer_ui.dm @@ -4,8 +4,6 @@ // Operates TGUI /obj/item/modular_computer/ui_interact(mob/user, datum/tgui/ui) - if(issilicon(user)) // silicons have some issues regarding real_name - saved_identification = user.real_name if(!enabled) if(ui) ui.close() @@ -15,7 +13,7 @@ ui.close() return - if(HAS_TRAIT(user, TRAIT_CHUNKYFINGERS)) + if(HAS_TRAIT(user, TRAIT_CHUNKYFINGERS) && !allow_chunky) to_chat(user, span_warning("Your fingers are too big to use this right now!")) return diff --git a/code/modules/modular_computers/computers/item/role_tablet_presets.dm b/code/modules/modular_computers/computers/item/role_tablet_presets.dm index 9206c53eb08..2af091636c9 100644 --- a/code/modules/modular_computers/computers/item/role_tablet_presets.dm +++ b/code/modules/modular_computers/computers/item/role_tablet_presets.dm @@ -212,6 +212,14 @@ insert_type = /obj/item/pen/fountain display_overlays = FALSE +/obj/item/modular_computer/tablet/pda/curator/Initialize(mapload) + . = ..() + var/obj/item/computer_hardware/hard_drive/hdd = all_components[MC_HDD] + + if(hdd) + for(var/datum/computer_file/program/messenger/msg in hdd.stored_files) + msg.allow_emojis = TRUE + /obj/item/modular_computer/tablet/pda/syndicate name = "military PDA" greyscale_colors = "#891417#80FF80" diff --git a/code/modules/modular_computers/computers/item/tablet.dm b/code/modules/modular_computers/computers/item/tablet.dm index 0b7994a4fa0..b11ec252de7 100644 --- a/code/modules/modular_computers/computers/item/tablet.dm +++ b/code/modules/modular_computers/computers/item/tablet.dm @@ -253,6 +253,7 @@ greyscale_colors = "#999875#a92323" bypass_state = TRUE + allow_chunky = TRUE var/default_disk = 0