mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 12:05:59 +01:00
Instrument editor now uses TGUI (#81923)
## About The Pull Request Instruments now use TGUI as their editor which is pretty cool. It's mostly a 1:1 remake of the HTML UI except I did make a change to make the playback options a little more compact, leaving some more space for the editor before you have to scroll, and some other minor things that were made to make the UI hopefully nicer to look at and mess with. When there's a song to play - While playing, Repeat section can't be edited  Help section and UI when there's no song put in  ## Why It's Good For The Game It is yet another step in finishing up https://hackmd.io/XLt5MoRvRxuhFbwtk4VAUA?view Instruments especially were in a poor spot because they didn't respect things like ``IN_USE`` to not refresh if it's not the "UI" you are on, and such. ## Changelog 🆑 refactor: Instruments now use TGUI. /🆑 --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
@@ -34,20 +34,7 @@
|
||||
user.visible_message(span_suicide("[user] begins to play 'Gloomy Sunday'! It looks like [user.p_theyre()] trying to commit suicide!"))
|
||||
return BRUTELOSS
|
||||
|
||||
/obj/item/instrument/attack_self(mob/user)
|
||||
if(!ISADVANCEDTOOLUSER(user))
|
||||
to_chat(user, span_warning("You don't have the dexterity to do this!"))
|
||||
return TRUE
|
||||
interact(user)
|
||||
|
||||
/obj/item/instrument/interact(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/item/instrument/ui_interact(mob/living/user)
|
||||
if(!isliving(user) || user.stat != CONSCIOUS || (HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) && !ispAI(user)))
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
/obj/item/instrument/ui_interact(mob/user, datum/tgui/ui)
|
||||
song.ui_interact(user)
|
||||
|
||||
/obj/item/instrument/violin
|
||||
@@ -130,9 +117,9 @@
|
||||
. = ..()
|
||||
AddElement(/datum/element/spooky)
|
||||
|
||||
/obj/item/instrument/trumpet/spectral/attack(mob/living/carbon/C, mob/user)
|
||||
playsound (src, 'sound/runtime/instruments/trombone/En4.mid', 100,1,-1)
|
||||
..()
|
||||
/obj/item/instrument/trumpet/spectral/attack(mob/living/target_mob, mob/living/user, params)
|
||||
playsound(src, 'sound/runtime/instruments/trombone/En4.mid', 1000, 1, -1)
|
||||
return ..()
|
||||
|
||||
/obj/item/instrument/saxophone
|
||||
name = "saxophone"
|
||||
@@ -154,9 +141,9 @@
|
||||
. = ..()
|
||||
AddElement(/datum/element/spooky)
|
||||
|
||||
/obj/item/instrument/saxophone/spectral/attack(mob/living/carbon/C, mob/user)
|
||||
playsound (src, 'sound/runtime/instruments/saxophone/En4.mid', 100,1,-1)
|
||||
..()
|
||||
/obj/item/instrument/saxophone/spectral/attack(mob/living/target_mob, mob/living/user, params)
|
||||
playsound(src, 'sound/runtime/instruments/trombone/En4.mid', 1000, 1, -1)
|
||||
return ..()
|
||||
|
||||
/obj/item/instrument/trombone
|
||||
name = "trombone"
|
||||
@@ -178,9 +165,9 @@
|
||||
. = ..()
|
||||
AddElement(/datum/element/spooky)
|
||||
|
||||
/obj/item/instrument/trombone/spectral/attack(mob/living/carbon/C, mob/user)
|
||||
playsound (src, 'sound/runtime/instruments/trombone/Cn4.mid', 100,1,-1)
|
||||
..()
|
||||
/obj/item/instrument/trombone/spectral/attack(mob/living/target_mob, mob/living/user, params)
|
||||
playsound(src, 'sound/runtime/instruments/trombone/Cn4.mid', 1000, 1, -1)
|
||||
return ..()
|
||||
|
||||
/obj/item/instrument/recorder
|
||||
name = "recorder"
|
||||
@@ -201,19 +188,24 @@
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
actions_types = list(/datum/action/item_action/instrument)
|
||||
|
||||
/obj/item/instrument/harmonica/equipped(mob/user, slot, initial = FALSE)
|
||||
. = ..()
|
||||
if(!(slot & slot_flags))
|
||||
return
|
||||
RegisterSignal(user, COMSIG_MOB_SAY, PROC_REF(handle_speech))
|
||||
|
||||
/obj/item/instrument/harmonica/dropped(mob/user, silent = FALSE)
|
||||
. = ..()
|
||||
UnregisterSignal(user, COMSIG_MOB_SAY)
|
||||
|
||||
/obj/item/instrument/harmonica/proc/handle_speech(datum/source, list/speech_args)
|
||||
SIGNAL_HANDLER
|
||||
if(song.playing && ismob(loc))
|
||||
to_chat(loc, span_warning("You stop playing the harmonica to talk..."))
|
||||
song.playing = FALSE
|
||||
|
||||
/obj/item/instrument/harmonica/equipped(mob/M, slot)
|
||||
. = ..()
|
||||
RegisterSignal(M, COMSIG_MOB_SAY, PROC_REF(handle_speech))
|
||||
|
||||
/obj/item/instrument/harmonica/dropped(mob/M)
|
||||
. = ..()
|
||||
UnregisterSignal(M, COMSIG_MOB_SAY)
|
||||
if(!song.playing)
|
||||
return
|
||||
if(!ismob(loc))
|
||||
CRASH("[src] was still registered to listen in on [source] but was not found to be on their mob.")
|
||||
to_chat(loc, span_warning("You stop playing the harmonica to talk..."))
|
||||
song.playing = FALSE
|
||||
|
||||
/datum/action/item_action/instrument
|
||||
name = "Use Instrument"
|
||||
|
||||
Reference in New Issue
Block a user