diff --git a/code/game/machinery/telecomms/computers/message.dm b/code/game/machinery/telecomms/computers/message.dm index 7110201aae4..4f576ed9f16 100644 --- a/code/game/machinery/telecomms/computers/message.dm +++ b/code/game/machinery/telecomms/computers/message.dm @@ -394,7 +394,12 @@ // Get out list of viable tablets var/list/viewable_tablets = list() for (var/obj/item/modular_computer/tablet in GLOB.TabletMessengers) - if(!tablet.saved_identification || tablet.invisible) + var/obj/item/computer_hardware/hard_drive/hdd = tablet.all_components[MC_HDD] + if(hdd) + var/datum/computer_file/program/messenger/message_app = locate() in hdd.stored_files + if(message_app.invisible) + continue + if(!tablet.saved_identification) continue viewable_tablets += tablet if(length(viewable_tablets) > 0) diff --git a/code/modules/mob_spawn/mob_spawn.dm b/code/modules/mob_spawn/mob_spawn.dm index cc7ba78ae30..bec24f7d19a 100644 --- a/code/modules/mob_spawn/mob_spawn.dm +++ b/code/modules/mob_spawn/mob_spawn.dm @@ -292,9 +292,12 @@ . = ..() if(conceal_presence) // We don't want corpse PDAs to show up in the messenger list. - var/obj/item/modular_computer/tablet/pda/messenger = locate(/obj/item/modular_computer/tablet/pda/) in spawned_human + var/obj/item/modular_computer/tablet/pda/messenger = locate() in spawned_human if(messenger) - messenger.invisible = TRUE + var/obj/item/computer_hardware/hard_drive/hdd = messenger.all_components[MC_HDD] + var/datum/computer_file/program/messenger/message_app = locate() in hdd.stored_files + if(message_app) + message_app.invisible = TRUE // Or on crew monitors var/obj/item/clothing/under/sensor_clothes = spawned_human.w_uniform if(istype(sensor_clothes)) diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index 1e4a5170909..63762a2ecdd 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -1,8 +1,8 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar to GLOB.PDAs (used primarily with ntmessenger.dm) // This is the base type that does all the hardware stuff. -// Other types expand it - tablets use a direct subtypes, and -// consoles and laptops use "procssor" item that is held inside machinery piece +// Other types expand it - tablets and laptops are subtypes +// consoles use "procssor" item that is held inside it. /obj/item/modular_computer name = "modular microcomputer" desc = "A small portable microcomputer." @@ -14,28 +14,38 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar armor = list(MELEE = 0, BULLET = 20, LASER = 20, ENERGY = 100, BOMB = 0, BIO = 0, FIRE = 0, ACID = 0) light_system = MOVABLE_LIGHT_DIRECTIONAL - var/bypass_state = FALSE // bypassing the set icon state - - var/enabled = 0 // Whether the computer is turned on. - var/upgradable = TRUE // whether or not the computer can be upgraded - var/deconstructable = TRUE // whether or not the computer can be deconstructed - var/screen_on = 1 // Whether the computer is active/opened/it's screen is on. - var/device_theme = "ntos" // Sets the theme for the main menu, hardware config, and file browser apps. Overridden by certain non-NT devices. - var/datum/computer_file/program/active_program = null // A currently active program running on the computer. - ///The type of device this computer is, as a flag + ///Flag of the type of device the modular computer is, deciding what types of apps it can run. var/hardware_flag = NONE -// Options: PROGRAM_ALL PROGRAM_CONSOLE | | PROGRAM_LAPTOP | PROGRAM_TABLET - var/last_power_usage = 0 - var/last_battery_percent = 0 // Used for deciding if battery percentage has chandged - var/last_world_time = "00:00" - var/list/last_header_icons - ///Looping sound for when the computer is on +// Options: PROGRAM_ALL | PROGRAM_CONSOLE | PROGRAM_LAPTOP | PROGRAM_TABLET + + ///Whether the icon state should be bypassed entirely, used for PDAs. + var/bypass_state = FALSE + ///The theme, used for the main menu, some hardware config, and file browser apps. + var/device_theme = "ntos" + + ///Bool on whether the computer is currently active or not. + var/enabled = FALSE + ///If the screen is open, only used by laptops. + var/screen_on = TRUE + + ///Looping sound for when the computer is on. var/datum/looping_sound/computer/soundloop ///Whether or not this modular computer uses the looping sound var/looping_sound = TRUE - var/base_active_power_usage = 50 // Power usage when the computer is open (screen is active) and can be interacted with. Remember hardware can use power too. - var/base_idle_power_usage = 5 // Power usage when the computer is idle and screen is off (currently only applies to laptops) + ///If the computer has a flashlight/LED light built-in. + var/has_light = FALSE + /// How far the computer's light can reach, is not editable by players. + var/comp_light_luminosity = 3 + /// The built-in light's color, editable by players. + var/comp_light_color = "#FFFFFF" + + ///The last recorded amount of power used. + var/last_power_usage = 0 + ///Power usage when the computer is open (screen is active) and can be interacted with. Remember hardware can use power too. + var/base_active_power_usage = 50 + ///Power usage when the computer is idle and screen is off (currently only applies to laptops) + var/base_idle_power_usage = 5 // Modular computers can run on various devices. Each DEVICE (Laptop, Console, Tablet,..) // must have it's own DMI file. Icon states must be called exactly the same in all files, but may look differently @@ -45,11 +55,6 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar var/icon_state_powered = null // Icon state when the computer is turned on. var/icon_state_menu = "menu" // Icon state overlay when the computer is turned on, but no program is loaded that would override the screen. var/display_overlays = TRUE // If FALSE, don't draw overlays on this device at all - var/max_hardware_size = 0 // Maximal hardware w_class. Tablets/PDAs have 1, laptops 2, consoles 4. - var/steel_sheet_cost = 5 // Amount of steel sheets refunded when disassembling an empty frame of this computer. - - /// Amount of programs that can be ran at once - var/max_idle_programs = 2 /// List of "connection ports" in this computer and the components with which they are plugged var/list/all_components = list() @@ -57,33 +62,36 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar var/list/expansion_bays /// Number of total expansion bays this computer has available. var/max_bays = 0 + ///The w_class (size) hardware it can handle, laptops get extra, computers get more. + var/max_hardware_size = 0 - var/saved_identification = null // next two values are the currently imprinted id and job values - var/saved_job = null + ///The full name of the stored ID card's identity. These vars should probably be on the PDA. + var/saved_identification + ///The job title of the stored ID card + var/saved_job + ///The program currently active on the tablet. + var/datum/computer_file/program/active_program + ///Idle programs on background. They still receive process calls but can't be interacted with. + var/list/idle_threads + /// Amount of programs that can be ran at once + var/max_idle_programs = 2 + + ///The 'computer' itself, as an obj. Primarily used for Adjacent() and UI visibility checks, especially for computers. + var/obj/physical + ///Amount of steel sheets refunded when disassembling an empty frame of this computer. + var/steel_sheet_cost = 5 + + ///A pAI currently loaded into the modular computer. + var/obj/item/pai_card/inserted_pai /// Allow people with chunky fingers to use? var/allow_chunky = FALSE - var/honkamnt = 0 /// honk honk honk honk honk honkh onk honkhnoohnk + ///If hit by a Clown virus, remaining honks left until it stops. + var/honkvirus_amount = 0 ///Whether the PDA can still use NTNet while out of NTNet's reach. var/long_ranged = FALSE - var/list/idle_threads // Idle programs on background. They still receive process calls but can't be interacted with. - var/obj/physical = null // Object that represents our computer. It's used for Adjacent() and UI visibility checks. - var/has_light = FALSE //If the computer has a flashlight/LED light/what-have-you installed - - /// How far the computer's light can reach, is not editable by players. - var/comp_light_luminosity = 3 - /// The built-in light's color, editable by players. - var/comp_light_color = "#FFFFFF" - - var/invisible = FALSE // whether or not the tablet is invisible in messenger and other apps - - var/datum/picture/saved_image // the saved image used for messaging purpose like come on dude - - /// Stored pAI in the computer - var/obj/item/pai_card/inserted_pai = null - ///The amount of paper currently stored in the PDA var/stored_paper = 10 ///The max amount of paper that can be held at once. @@ -742,7 +750,7 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar return // Insert new hardware - if(istype(attacking_item, /obj/item/computer_hardware) && upgradable) + if(istype(attacking_item, /obj/item/computer_hardware)) if(install_component(attacking_item, user)) playsound(src, 'sound/machines/card_slide.ogg', 50) return @@ -751,7 +759,7 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar /obj/item/modular_computer/screwdriver_act(mob/user, obj/item/tool) . = ..() - if(!deconstructable) + if((resistance_flags & INDESTRUCTIBLE) || (flags_1 & NODECONSTRUCT_1)) return if(!length(all_components)) balloon_alert(user, "no components installed!") diff --git a/code/modules/modular_computers/computers/item/computer_ui.dm b/code/modules/modular_computers/computers/item/computer_ui.dm index dc06395e2a3..324a9710d78 100644 --- a/code/modules/modular_computers/computers/item/computer_ui.dm +++ b/code/modules/modular_computers/computers/item/computer_ui.dm @@ -40,8 +40,8 @@ to_chat(user, span_danger("\The [src] beeps three times, it's screen displaying a \"DISK ERROR\" warning.")) return // No HDD, No HDD files list or no stored files. Something is very broken. - if(honkamnt > 0) // EXTRA annoying, huh! - honkamnt-- + if(honkvirus_amount > 0) // EXTRA annoying, huh! + honkvirus_amount-- playsound(src, 'sound/items/bikehorn.ogg', 30, TRUE) ui = SStgui.try_update_ui(user, src, ui) @@ -59,8 +59,6 @@ return data - - /obj/item/modular_computer/ui_data(mob/user) var/list/data = get_header_data() data["device_theme"] = device_theme 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 b228f39f1a5..22163a343d1 100644 --- a/code/modules/modular_computers/computers/item/role_tablet_presets.dm +++ b/code/modules/modular_computers/computers/item/role_tablet_presets.dm @@ -390,9 +390,16 @@ greyscale_colors = "#891417#80FF80" saved_identification = "John Doe" saved_job = "Citizen" - invisible = TRUE device_theme = "syndicate" +/obj/item/modular_computer/tablet/pda/syndicate/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.invisible = TRUE + /obj/item/modular_computer/tablet/pda/clear name = "clear PDA" icon_state = "pda-clear" diff --git a/code/modules/modular_computers/computers/item/tablet.dm b/code/modules/modular_computers/computers/item/tablet.dm index 34cbd30e6a2..07e8c968b55 100644 --- a/code/modules/modular_computers/computers/item/tablet.dm +++ b/code/modules/modular_computers/computers/item/tablet.dm @@ -26,8 +26,16 @@ var/has_variants = TRUE var/finish_color = null - var/list/contained_item = list(/obj/item/pen, /obj/item/toy/crayon, /obj/item/lipstick, /obj/item/flashlight/pen, /obj/item/clothing/mask/cigarette) + ///The item currently inserted into the PDA, starts with a pen. var/obj/item/inserted_item = /obj/item/pen + ///List of items that can be stored in a PDA + var/static/list/contained_item = list( + /obj/item/pen, + /obj/item/toy/crayon, + /obj/item/lipstick, + /obj/item/flashlight/pen, + /obj/item/clothing/mask/cigarette, + ) /obj/item/modular_computer/tablet/update_icon_state() if(has_variants && !bypass_state) @@ -53,7 +61,6 @@ . = ..() if(HAS_TRAIT(src, TRAIT_PDA_MESSAGE_MENU_RIGGED)) explode(usr, from_message_menu = TRUE) - return /obj/item/modular_computer/tablet/add_context(atom/source, list/context, obj/item/held_item, mob/user) . = ..() diff --git a/code/modules/modular_computers/computers/machinery/modular_computer.dm b/code/modules/modular_computers/computers/machinery/modular_computer.dm index 46cdf20e322..05f87fca064 100644 --- a/code/modules/modular_computers/computers/machinery/modular_computer.dm +++ b/code/modules/modular_computers/computers/machinery/modular_computer.dm @@ -12,7 +12,7 @@ idle_power_usage = BASE_MACHINE_IDLE_CONSUMPTION * 0.05 ///A flag that describes this device type - var/hardware_flag = 0 + var/hardware_flag = NONE ///Power usage during last tick var/last_power_usage = 0 /// Amount of programs that can be ran at once diff --git a/code/modules/modular_computers/file_system/programs/ntmessenger.dm b/code/modules/modular_computers/file_system/programs/ntmessenger.dm index b44a196d2c5..cb69aa38fbe 100644 --- a/code/modules/modular_computers/file_system/programs/ntmessenger.dm +++ b/code/modules/modular_computers/file_system/programs/ntmessenger.dm @@ -27,7 +27,9 @@ /// even more wisdom from PDA.dm - "no everyone spamming" (prevents people from spamming the same message over and over) var/last_text_everyone /// Scanned photo for sending purposes. - var/datum/picture/picture + var/datum/picture/saved_image + /// Whether the user is invisible to the message list. + var/invisible = FALSE /// Whether or not we allow emojis to be sent by the user. var/allow_emojis = FALSE /// Whether or not we're currently looking at the message list. @@ -53,7 +55,7 @@ if(!istype(attacking_item, /obj/item/photo)) return FALSE var/obj/item/photo/pic = attacking_item - computer.saved_image = pic.picture + saved_image = pic.picture ProcessPhoto() return TRUE @@ -86,7 +88,7 @@ if(!drive) continue for(var/datum/computer_file/program/messenger/app in drive.stored_files) - if(!P.saved_identification || !P.saved_job || P.invisible || app.monitor_hidden) + if(!P.saved_identification || !P.saved_job || app.invisible || app.monitor_hidden) continue dictionary += P @@ -96,8 +98,8 @@ return "[messenger.saved_identification] ([messenger.saved_job])" /datum/computer_file/program/messenger/proc/ProcessPhoto() - if(computer.saved_image) - var/icon/img = computer.saved_image.picture_image + if(saved_image) + var/icon/img = saved_image.picture_image var/deter_path = "tmp_msg_photo[rand(0, 99999)].png" usr << browse_rsc(img, deter_path) // funny random assignment for now, i'll make an actual key later photo_path = deter_path @@ -194,7 +196,7 @@ return UI_UPDATE if("PDA_clearPhoto") - computer.saved_image = null + saved_image = null photo_path = null return UI_UPDATE diff --git a/code/modules/modular_computers/hardware/card_slot.dm b/code/modules/modular_computers/hardware/card_slot.dm index 9e2ce5e3c96..285cd3e961f 100644 --- a/code/modules/modular_computers/hardware/card_slot.dm +++ b/code/modules/modular_computers/hardware/card_slot.dm @@ -17,8 +17,7 @@ if(holder) if(holder.active_program) holder.active_program.event_idremoved(0) - for(var/p in holder.idle_threads) - var/datum/computer_file/program/computer_program = p + for(var/datum/computer_file/program/computer_program as anything in holder.idle_threads) computer_program.event_idremoved(1) holder.update_slot_icon() diff --git a/code/modules/modular_computers/hardware/virus_disk.dm b/code/modules/modular_computers/hardware/virus_disk.dm index d89af44fbe4..d51744c2a58 100644 --- a/code/modules/modular_computers/hardware/virus_disk.dm +++ b/code/modules/modular_computers/hardware/virus_disk.dm @@ -17,7 +17,7 @@ if(target) user.show_message(span_notice("Success!")) charges-- - target.honkamnt = rand(15, 25) + target.honkvirus_amount = rand(15, 25) else to_chat(user, span_notice("ERROR: Could not find device.")) diff --git a/modular_skyrat/modules/cryosleep/code/cryopod.dm b/modular_skyrat/modules/cryosleep/code/cryopod.dm index ff09b6e22be..fa28b7bae0d 100644 --- a/modular_skyrat/modules/cryosleep/code/cryopod.dm +++ b/modular_skyrat/modules/cryosleep/code/cryopod.dm @@ -357,7 +357,10 @@ GLOBAL_LIST_EMPTY(valid_cryopods) if(control_computer) if(istype(item_content, /obj/item/modular_computer)) var/obj/item/modular_computer/computer = item_content - computer.invisible = TRUE + var/obj/item/computer_hardware/hard_drive/hdd = computer.all_components[MC_HDD] + if(hdd) + for(var/datum/computer_file/program/messenger/message_app in hdd.stored_files) + message_app.invisible = TRUE item_content.dropped(mob_occupant) mob_occupant.transferItemToLoc(item_content, control_computer, force = TRUE, silent = TRUE) control_computer.frozen_item += item_content