mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-20 20:37:34 +01:00
Looping sounds, competently. (#14709)
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
working = hard_drive && processor_unit && damage < broken_damage && computer_use_power()
|
||||
check_update_ui_need()
|
||||
|
||||
if(!is_portable && working && enabled && world.time > ambience_last_played_time + 30 SECONDS && prob(3))
|
||||
if(looping_sound && 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
|
||||
|
||||
@@ -93,6 +93,8 @@
|
||||
install_default_programs()
|
||||
handle_verbs()
|
||||
update_icon()
|
||||
if(looping_sound)
|
||||
soundloop = new(src, enabled)
|
||||
initial_name = name
|
||||
|
||||
/obj/item/modular_computer/Destroy()
|
||||
@@ -105,6 +107,7 @@
|
||||
listening_objects -= src
|
||||
STOP_PROCESSING(SSprocessing, src)
|
||||
QDEL_NULL(listener)
|
||||
QDEL_NULL(soundloop)
|
||||
return ..()
|
||||
|
||||
/obj/item/modular_computer/CouldUseTopic(var/mob/user)
|
||||
@@ -231,10 +234,14 @@
|
||||
visible_message(SPAN_NOTICE("\The [src] shuts down."))
|
||||
SSvueui.close_uis(src)
|
||||
enabled = FALSE
|
||||
if(looping_sound)
|
||||
soundloop.stop(src)
|
||||
update_icon()
|
||||
|
||||
/obj/item/modular_computer/proc/enable_computer(var/mob/user, var/ar_forced=FALSE)
|
||||
enabled = TRUE
|
||||
if(looping_sound)
|
||||
soundloop.start(src)
|
||||
update_icon()
|
||||
|
||||
// Autorun feature
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
var/last_battery_percent = 0 // Used for deciding if battery percentage has chandged
|
||||
var/last_world_time = "00:00"
|
||||
var/list/last_header_icons
|
||||
var/datum/looping_sound/computer/soundloop // Looping sound for when the computer is on
|
||||
var/looping_sound = TRUE // Whether or not this modular computer uses the looping sound. Also handles ambience beeps.
|
||||
var/computer_emagged = FALSE // Whether the computer is emagged.
|
||||
var/apc_powered = FALSE // Set automatically. Whether the computer used APC power last tick.
|
||||
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.
|
||||
@@ -30,7 +32,6 @@
|
||||
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
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
hardware_flag = PROGRAM_TABLET
|
||||
max_hardware_size = 1
|
||||
w_class = ITEMSIZE_SMALL
|
||||
is_portable = TRUE
|
||||
looping_sound = FALSE
|
||||
|
||||
/obj/item/modular_computer/handheld/Initialize()
|
||||
. = ..()
|
||||
@@ -21,4 +21,4 @@
|
||||
|
||||
/obj/item/modular_computer/handheld/proc/set_icon()
|
||||
icon_state_unpowered = icon_state
|
||||
icon_state_broken = icon_state
|
||||
icon_state_broken = icon_state
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
enrolled = 2
|
||||
var/mob/living/silicon/computer_host // Thing that contains this computer. Used for silicon computers
|
||||
looping_sound = FALSE
|
||||
|
||||
/obj/item/modular_computer/silicon/ui_host()
|
||||
. = computer_host
|
||||
@@ -43,7 +44,7 @@
|
||||
|
||||
/obj/item/modular_computer/silicon/Click(location, control, params)
|
||||
return attack_self(usr)
|
||||
|
||||
|
||||
/obj/item/modular_computer/silicon/install_default_hardware()
|
||||
. = ..()
|
||||
processor_unit = new /obj/item/computer_hardware/processor_unit(src)
|
||||
@@ -65,4 +66,4 @@
|
||||
/obj/item/modular_computer/silicon/robot/drone/install_default_programs()
|
||||
hard_drive.store_file(new /datum/computer_file/program/filemanager(src))
|
||||
hard_drive.store_file(new /datum/computer_file/program/ntnetdownload(src))
|
||||
hard_drive.remove_file(hard_drive.find_file_by_name("clientmanager"))
|
||||
hard_drive.remove_file(hard_drive.find_file_by_name("clientmanager"))
|
||||
|
||||
Reference in New Issue
Block a user