mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 11:36:24 +01:00
Merge commit '179a607a90ad7ec62bdaff4e6fe72af60ee56442' of https://github.com/tgstation/tgstation into upstream-24-10b
This commit is contained in:
@@ -47,26 +47,26 @@
|
||||
|
||||
/obj/item/circuit_component/soundemitter/populate_options()
|
||||
var/static/component_options = list(
|
||||
"Buzz" = 'sound/machines/buzz-sigh.ogg',
|
||||
"Buzz Twice" = 'sound/machines/buzz-two.ogg',
|
||||
"Buzz" = 'sound/machines/buzz/buzz-sigh.ogg',
|
||||
"Buzz Twice" = 'sound/machines/buzz/buzz-two.ogg',
|
||||
"Chime" = 'sound/machines/chime.ogg',
|
||||
"Honk" = 'sound/items/bikehorn.ogg',
|
||||
"Ping" = 'sound/machines/ping.ogg',
|
||||
"Sad Trombone" = 'sound/misc/sadtrombone.ogg',
|
||||
"Warn" = 'sound/machines/warning-buzzer.ogg',
|
||||
"Slow Clap" = 'sound/machines/slowclap.ogg',
|
||||
"Moth Buzz" = 'sound/voice/moth/scream_moth.ogg',
|
||||
"Squeak" = 'sound/items/toysqueak1.ogg',
|
||||
"Rip" = 'sound/items/poster_ripped.ogg',
|
||||
"Moth Buzz" = 'sound/mobs/humanoids/moth/scream_moth.ogg',
|
||||
"Squeak" = 'sound/items/toy_squeak/toysqueak1.ogg',
|
||||
"Rip" = 'sound/items/poster/poster_ripped.ogg',
|
||||
"Coinflip" = 'sound/items/coinflip.ogg',
|
||||
"Megaphone" = 'sound/items/megaphone.ogg',
|
||||
"Warpwhistle" = 'sound/magic/warpwhistle.ogg',
|
||||
"Hiss" = 'sound/voice/hiss1.ogg',
|
||||
"Lizard" = 'sound/voice/lizard/lizard_scream_1.ogg',
|
||||
"Flashbang" = 'sound/weapons/flashbang.ogg',
|
||||
"Flash" = 'sound/weapons/flash.ogg',
|
||||
"Whip" = 'sound/weapons/whip.ogg',
|
||||
"Laugh Track" = 'sound/items/SitcomLaugh1.ogg',
|
||||
"Warpwhistle" = 'sound/effects/magic/warpwhistle.ogg',
|
||||
"Hiss" = 'sound/mobs/non-humanoids/hiss/hiss1.ogg',
|
||||
"Lizard" = 'sound/mobs/humanoids/lizard/lizard_scream_1.ogg',
|
||||
"Flashbang" = 'sound/items/weapons/flashbang.ogg',
|
||||
"Flash" = 'sound/items/weapons/flash.ogg',
|
||||
"Whip" = 'sound/items/weapons/whip.ogg',
|
||||
"Laugh Track" = 'sound/items/sitcom_laugh/sitcomLaugh1.ogg',
|
||||
"Gavel" = 'sound/items/gavel.ogg',
|
||||
)
|
||||
sound_file = add_option_port("Sound Option", component_options)
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
var/new_option = input_options.value
|
||||
switch(new_option)
|
||||
if(COMP_INPUT_STRING)
|
||||
var/player_input = tgui_input_text(player, "Input a value", "Input value")
|
||||
var/player_input = tgui_input_text(player, "Input a value", "Input value", max_length = MAX_MESSAGE_LEN)
|
||||
if(isnull(player_input))
|
||||
return
|
||||
input_response.set_output(player_input)
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
/// The result from the output
|
||||
var/datum/port/output/output
|
||||
var/datum/port/output/distance
|
||||
|
||||
// Directions outputs
|
||||
var/datum/port/output/north
|
||||
@@ -30,9 +31,10 @@
|
||||
. += create_ui_notice("Maximum Range: [max_range] tiles", "orange", "info")
|
||||
|
||||
/obj/item/circuit_component/direction/populate_ports()
|
||||
input_port = add_input_port("Organism", PORT_TYPE_ATOM)
|
||||
input_port = add_input_port("Targeted Entity", PORT_TYPE_ATOM)
|
||||
|
||||
output = add_output_port("Direction", PORT_TYPE_STRING)
|
||||
distance = add_output_port("Distance", PORT_TYPE_NUMBER)
|
||||
|
||||
north = add_output_port("North", PORT_TYPE_SIGNAL)
|
||||
east = add_output_port("East", PORT_TYPE_SIGNAL)
|
||||
@@ -45,8 +47,9 @@
|
||||
if(!object)
|
||||
return
|
||||
var/turf/location = get_location()
|
||||
var/measured_distance = get_dist(location, object)
|
||||
|
||||
if(object.z != location.z || get_dist(location, object) > max_range)
|
||||
if(object.z != location.z || measured_distance > max_range)
|
||||
output.set_output(null)
|
||||
return
|
||||
|
||||
@@ -61,3 +64,6 @@
|
||||
east.set_output(COMPONENT_SIGNAL)
|
||||
if(direction & WEST)
|
||||
west.set_output(COMPONENT_SIGNAL)
|
||||
|
||||
distance.set_output(measured_distance)
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
ready = FALSE
|
||||
|
||||
/obj/item/circuit_component/thought_listener/proc/thought_listen(mob/living/owner)
|
||||
var/message = tgui_input_text(owner, input_desc.value ? input_desc.value : "", input_name.value ? input_name.value : "Thought Listener", "")
|
||||
var/message = tgui_input_text(owner, input_desc.value ? input_desc.value : "", input_name.value ? input_name.value : "Thought Listener", "", max_length = MAX_MESSAGE_LEN)
|
||||
if(QDELETED(owner) || owner.stat >= SOFT_CRIT)
|
||||
return
|
||||
output.set_output(message)
|
||||
|
||||
@@ -37,6 +37,15 @@
|
||||
if(!length(bit_array))
|
||||
return
|
||||
|
||||
for(var/iteration in 1 to length(bit_array))
|
||||
var/to_convert = number.value
|
||||
var/is_negative
|
||||
if(number.value < 0)
|
||||
is_negative = TRUE
|
||||
to_convert = -to_convert
|
||||
var/len = length(bit_array)
|
||||
for(var/iteration in 1 to len)
|
||||
var/datum/port/output/bit = bit_array[iteration]
|
||||
bit.set_output(number.value & (2 ** (iteration - 1)))
|
||||
if(iteration == 1 && is_negative)
|
||||
bit.set_output(1)
|
||||
continue
|
||||
bit.set_output(!!(to_convert & (1<< (len - iteration))))
|
||||
|
||||
Reference in New Issue
Block a user