Reworks and Cleans Up Ambience Code (#14652)

* Reworks and Cleans Up Ambience Code

* Removes Unused Defines; Minor Code Comments

* Cleans Up Code Comments

* Changelog

* Changelog Update
This commit is contained in:
SleepyGemmy
2022-08-21 21:25:24 +02:00
committed by GitHub
parent 1f536c64ac
commit 14d7cc6a4d
12 changed files with 171 additions and 182 deletions

View File

@@ -46,9 +46,9 @@
working = hard_drive && processor_unit && damage < broken_damage && computer_use_power()
check_update_ui_need()
if(working && enabled && world.time > ambience_last_played + 30 SECONDS && prob(3))
playsound(get_turf(src), /decl/sound_category/computerbeep_sound, 30, 1, 10, required_preferences = SOUND_AMBIENCE)
ambience_last_played = world.time
if(!is_portable && working && enabled && world.time > ambience_last_played_time + 30 SECONDS && prob(3))
playsound(get_turf(src), /decl/sound_category/computerbeep_sound, 30, 1, 10, required_preferences = ASFX_AMBIENCE)
ambience_last_played_time = world.time
/obj/item/modular_computer/proc/get_preset_programs(preset_type)
for(var/datum/modular_computer_app_presets/prs in ntnet_global.available_software_presets)

View File

@@ -21,7 +21,7 @@
var/base_idle_power_usage = 5 // Power usage when the computer is idle and screen is off (currently only applies to laptops)
var/enrolled = 0 // Weather the computer is enrolled in the company device management or not. 0 - unconfigured 1 - enrolled (work device) 2 - unenrolled (private device)
var/_app_preset_type // Used for specifying the software preset of the console
var/ambience_last_played // Last time sound was played
var/ambience_last_played_time // Last time sound was played
var/pAI_lock = FALSE // Toggles whether pAI can interact with the modular computer while installed in it
var/obj/item/card/id/registered_id = null // ID used for chat client registering
var/scan_mode = null // Mode used for health/reagent scanners
@@ -29,6 +29,7 @@
var/doorcode = "smindicate"
var/hidden = FALSE
var/initial_name
var/is_portable = FALSE // Used to prevent the ambient beeps from playing.
// 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

View File

@@ -13,6 +13,7 @@
hardware_flag = PROGRAM_TABLET
max_hardware_size = 1
w_class = ITEMSIZE_SMALL
is_portable = TRUE
/obj/item/modular_computer/handheld/Initialize()
. = ..()