Skip to content

Commit

Permalink
wip web sound refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy committed Oct 18, 2024
1 parent 2393d02 commit 8880d43
Show file tree
Hide file tree
Showing 21 changed files with 356 additions and 394 deletions.
4 changes: 4 additions & 0 deletions code/controllers/configuration/entries/monkestation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,7 @@
. = ..()
if(.)
config_entry_value *= 600 // documented as minutes

/// The base URL for a ss13-yt-wrap server (https://github.com/Absolucy/ss13-yt-wrap) to use.
/datum/config_entry/string/yt_wrap_url
protection = CONFIG_ENTRY_LOCKED
2 changes: 2 additions & 0 deletions code/modules/admin/verbs/playsound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
SEND_SOUND(M, S)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Play Direct Mob Sound") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!

/* monkestation removal: reimplemented in [monkestation\code\modules\internet_audio\playsound.dm]
///Takes an input from either proc/play_web_sound or the request manager and runs it through youtube-dl and prompts the user before playing it to the server.
/proc/web_sound(mob/user, input)
if(!check_rights(R_SOUND))
Expand Down Expand Up @@ -191,6 +192,7 @@
web_sound(usr, shell_scrubbed_input)
else
web_sound(usr, null)
monkestation end */

/client/proc/set_round_end_sound(S as sound)
set category = "Admin.Fun"
Expand Down
6 changes: 3 additions & 3 deletions code/modules/mob/dead/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@
SSpersistence.load_modular_persistence(humanc.get_organ_slot(ORGAN_SLOT_BRAIN))

//monkestation edit start
if(GLOB.dj_booth)
var/obj/machinery/cassette/dj_station/dj = GLOB.dj_booth
dj.add_new_player(humanc)
if(GLOB.old_dj_booth)
var/obj/machinery/cassette/old_dj_station/dj = GLOB.old_dj_booth
//dj.add_new_player(humanc)
//monkestation edit end

if(GLOB.curse_of_madness_triggered)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/unit_tests/unit_test.dm
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ GLOBAL_VAR_INIT(focused_tests, focused_tests())
///we generate mobs in these and create destroy does this in null space
ignore += typesof(/obj/item/loot_table_maker)
///we need to use json_decode to run randoms properly
ignore += typesof(/obj/item/device/cassette_tape)
ignore += typesof(/obj/item/cassette_tape)
ignore += typesof(/datum/cassette/cassette_tape)
///we also dont want weathers or weather events as they will hold refs to alot of stuff as they shouldn't be deleted
ignore += typesof(/datum/weather_event)
Expand Down
2 changes: 1 addition & 1 deletion monkestation/code/modules/admin/verbs/spawn_mixtape.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
switch(action)
if("spawn")
if (params["id"])
new/obj/item/device/cassette_tape(usr.loc, params["id"])
new/obj/item/cassette_tape(usr.loc, params["id"])
SSblackbox.record_feedback("tally", "admin_verb", 1, "Spawn Mixtape")
log_admin("[key_name(usr)] created mixtape [params["id"]] at [usr.loc].")
4 changes: 2 additions & 2 deletions monkestation/code/modules/cargo/crates/goodies.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
name = "Cassette Mini-Pack"
desc = "Alright, we'll admit it, 10 cassettes are too much for the majority of our users. Contains 3 Approved Cassettes."
cost = PAYCHECK_CREW * 5
contains = list(/obj/item/device/cassette_tape/random = 3)
contains = list(/obj/item/cassette_tape/random = 3)

/datum/supply_pack/goody/blankcassette
name = "Blank Cassette Mini-Pack"
desc = "NO! We wont admit defeat! You will march yourself down to the Service section and purchase the 10 Blank Cassette pack instead of this Weak 3 Blank Cassette Pack!"
cost = PAYCHECK_CREW * 3
contains = list(/obj/item/device/cassette_tape/blank = 3)
contains = list(/obj/item/cassette_tape/blank = 3)
4 changes: 2 additions & 2 deletions monkestation/code/modules/cargo/crates/service.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@

/datum/supply_pack/service/cassettes/fill(obj/structure/closet/crate/our_crate)
for(var/id in unique_random_tapes(10))
new /obj/item/device/cassette_tape(our_crate, id)
new /obj/item/cassette_tape(our_crate, id)

/datum/supply_pack/service/blankcassettes
name = "Blank Cassettes Crate"
desc = "in the VERY unlikely event you have run out of blank cassettes, you can get 10 blank ones here. Contains 10 blank cassettes for use in Walkmans."
cost = CARGO_CRATE_VALUE * 2
contains = list(/obj/item/device/cassette_tape/blank = 10)
contains = list(/obj/item/cassette_tape/blank = 10)
crate_name = "cassette crate"

/datum/supply_pack/service/walkmen
Expand Down
14 changes: 7 additions & 7 deletions monkestation/code/modules/cassettes/cassette.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

/obj/item/device/cassette_tape
/obj/item/cassette_tape
name = "Debug Cassette Tape"
desc = "You shouldn't be seeing this!"
icon = 'monkestation/code/modules/cassettes/icons/walkman.dmi'
Expand Down Expand Up @@ -28,7 +28,7 @@
var/random = FALSE
var/cassette_desc_string = "Generic Desc"

/obj/item/device/cassette_tape/Initialize(mapload, spawned_id)
/obj/item/cassette_tape/Initialize(mapload, spawned_id)
. = ..()
if(!length(GLOB.approved_ids))
GLOB.approved_ids = initialize_approved_ids()
Expand Down Expand Up @@ -57,13 +57,13 @@

update_appearance()

/obj/item/device/cassette_tape/attack_self(mob/user)
/obj/item/cassette_tape/attack_self(mob/user)
..()
icon_state = flipped ? side1_icon : side2_icon
flipped = !flipped
to_chat(user, span_notice("You flip [src]."))

/obj/item/device/cassette_tape/update_desc(updates)
/obj/item/cassette_tape/update_desc(updates)
. = ..()
desc = cassette_desc_string
desc += "\n"
Expand All @@ -72,7 +72,7 @@
if(author_name)
desc += span_notice("Mixed by [author_name]\n")

/obj/item/device/cassette_tape/attackby(obj/item/item, mob/living/user)
/obj/item/cassette_tape/attackby(obj/item/item, mob/living/user)
if(!istype(item, /obj/item/pen))
return ..()
var/choice = tgui_input_list(usr, "What would you like to change?", items = list("Cassette Name", "Cassette Description", "Cancel"))
Expand Down Expand Up @@ -122,8 +122,8 @@
var/list/songs = list("side1" = list(),
"side2" = list())

/obj/item/device/cassette_tape/blank
/obj/item/cassette_tape/blank
id = "blank"

/obj/item/device/cassette_tape/friday
/obj/item/cassette_tape/friday
id = "friday"
6 changes: 3 additions & 3 deletions monkestation/code/modules/cassettes/cassette_approval.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GLOBAL_LIST_INIT(cassette_reviews, list())

#define ADMIN_OPEN_REVIEW(id) "(<A href='?_src_=holder;[HrefToken(forceGlobal = TRUE)];open_music_review=[id]'>Open Review</a>)"
/proc/submit_cassette_for_review(obj/item/device/cassette_tape/submitted, mob/user)
/proc/submit_cassette_for_review(obj/item/cassette_tape/submitted, mob/user)
if(!user.client)
return
var/datum/cassette_review/new_review = new
Expand All @@ -25,7 +25,7 @@ GLOBAL_LIST_INIT(cassette_reviews, list())
has requested a review on their cassette."))]")
to_chat(user, span_notice("Your Cassette has been sent to the Space Board of Music for review, you will be notified when an outcome has been made."))

/obj/item/device/cassette_tape/proc/generate_cassette_json()
/obj/item/cassette_tape/proc/generate_cassette_json()
if(approved_tape)
return
if(!length(GLOB.approved_ids))
Expand Down Expand Up @@ -70,7 +70,7 @@ GLOBAL_LIST_INIT(cassette_reviews, list())
"song_url" = list()
)
)
var/obj/item/device/cassette_tape/submitted_tape
var/obj/item/cassette_tape/submitted_tape

var/action_taken = FALSE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
/datum/cassette_data/proc/generate_cassette(turf/location)
if(!location)
return
var/obj/item/device/cassette_tape/new_tape = new(location)
var/obj/item/cassette_tape/new_tape = new(location)
new_tape.name = cassette_name
new_tape.cassette_desc_string = cassette_desc
new_tape.icon_state = cassette_design_front
Expand Down
10 changes: 5 additions & 5 deletions monkestation/code/modules/cassettes/machines/cassette_rack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

/datum/storage/cassette_rack/New()
. = ..()
set_holdable(/obj/item/device/cassette_tape)
set_holdable(/obj/item/cassette_tape)

// Allow opening on a normal left click
/datum/storage/cassette_rack/on_attack(datum/source, mob/user)
Expand All @@ -50,9 +50,9 @@
REGISTER_REQUIRED_MAP_ITEM(1, INFINITY)
RegisterSignal(SSdcs, COMSIG_GLOB_CREWMEMBER_JOINED, PROC_REF(spawn_curator_tapes))
for(var/i in 1 to spawn_blanks)
new /obj/item/device/cassette_tape/blank(src)
new /obj/item/cassette_tape/blank(src)
for(var/id in unique_random_tapes(spawn_random))
new /obj/item/device/cassette_tape(src, id)
new /obj/item/cassette_tape(src, id)
update_appearance()

/obj/structure/cassette_rack/prefilled/Destroy()
Expand All @@ -72,7 +72,7 @@
if(!length(user_tapes))
return FALSE
var/list/existing_tapes = list()
for(var/obj/item/device/cassette_tape/tape in src)
for(var/obj/item/cassette_tape/tape in src)
if(tape.id)
existing_tapes[tape.id] = TRUE
for(var/iter in 1 to max_amt)
Expand All @@ -81,7 +81,7 @@
var/datum/cassette_data/tape = pick_n_take(user_tapes)
if(existing_tapes[tape.cassette_id])
continue
new /obj/item/device/cassette_tape(src, tape.cassette_id)
new /obj/item/cassette_tape(src, tape.cassette_id)
if(expand_max_size && !QDELETED(atom_storage))
atom_storage.max_slots += max_amt
atom_storage.max_total_storage += max_amt * WEIGHT_CLASS_SMALL
Expand Down
Loading

0 comments on commit 8880d43

Please sign in to comment.