Functional* code
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
|
||||
////////////////////////////////
|
||||
/proc/message_admins(msg)
|
||||
msg = "<span class=\"admin\"><span class=\"prefix\">ADMIN LOG:</span> <span class=\"message linkify\">[msg]</span></span>"
|
||||
msg = "<span class=\"admin filter_adminlog\"><span class=\"prefix\">ADMIN LOG:</span> <span class=\"message linkify\">[msg]</span></span>"
|
||||
to_chat(GLOB.admins, msg)
|
||||
|
||||
/proc/relay_msg_admins(msg)
|
||||
msg = "<span class=\"admin\"><span class=\"prefix\">RELAY:</span> <span class=\"message linkify\">[msg]</span></span>"
|
||||
msg = "<span class=\"admin filter_adminlog\"><span class=\"prefix\">RELAY:</span> <span class=\"message linkify\">[msg]</span></span>"
|
||||
to_chat(GLOB.admins, msg)
|
||||
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ GLOBAL_PROTECT(admin_verbs_admin)
|
||||
)
|
||||
GLOBAL_LIST_INIT(admin_verbs_ban, list(/client/proc/unban_panel, /client/proc/DB_ban_panel, /client/proc/stickybanpanel))
|
||||
GLOBAL_PROTECT(admin_verbs_ban)
|
||||
GLOBAL_LIST_INIT(admin_verbs_sounds, list(/client/proc/play_local_sound, /client/proc/play_sound, /client/proc/manual_play_web_sound, /client/proc/set_round_end_sound))
|
||||
GLOBAL_LIST_INIT(admin_verbs_sounds, list(/client/proc/play_local_sound, /client/proc/play_sound, /client/proc/set_round_end_sound))
|
||||
GLOBAL_PROTECT(admin_verbs_sounds)
|
||||
GLOBAL_LIST_INIT(admin_verbs_fun, list(
|
||||
/client/proc/cmd_admin_dress,
|
||||
|
||||
@@ -34,9 +34,7 @@
|
||||
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(M.client.prefs.toggles & SOUND_MIDI)
|
||||
var/user_vol = M.client.chatOutput.adminMusicVolume
|
||||
if(user_vol)
|
||||
admin_sound.volume = vol * (user_vol / 100)
|
||||
admin_sound.volume = vol * M.client.admin_music_volume
|
||||
SEND_SOUND(M, admin_sound)
|
||||
admin_sound.volume = vol
|
||||
|
||||
@@ -69,7 +67,7 @@
|
||||
if(istext(web_sound_input))
|
||||
var/web_sound_url = ""
|
||||
var/stop_web_sounds = FALSE
|
||||
var/pitch
|
||||
var/list/music_extra_data = list()
|
||||
if(length(web_sound_input))
|
||||
|
||||
web_sound_input = trim(web_sound_input)
|
||||
@@ -97,11 +95,10 @@
|
||||
var/webpage_url = title
|
||||
if (data["webpage_url"])
|
||||
webpage_url = "<a href=\"[data["webpage_url"]]\">[title]</a>"
|
||||
|
||||
var/freq = input(usr, "What frequency would you like the sound to play at?",, 1) as null|num
|
||||
if(!freq)
|
||||
freq = 1
|
||||
pitch = freq
|
||||
music_extra_data["start"] = data["start_time"]
|
||||
music_extra_data["end"] = data["end_time"]
|
||||
music_extra_data["link"] = data["webpage_url"]
|
||||
music_extra_data["title"] = data["title"]
|
||||
|
||||
var/res = alert(usr, "Show the title of and link to this song to the players?\n[title]",, "No", "Yes", "Cancel")
|
||||
switch(res)
|
||||
@@ -130,57 +127,14 @@
|
||||
for(var/m in GLOB.player_list)
|
||||
var/mob/M = m
|
||||
var/client/C = M.client
|
||||
if((C.prefs.toggles & SOUND_MIDI) && C.chatOutput && !C.chatOutput.broken && C.chatOutput.loaded)
|
||||
if(C.prefs.toggles & SOUND_MIDI)
|
||||
if(!stop_web_sounds)
|
||||
C.chatOutput.sendMusic(web_sound_url, pitch)
|
||||
C.tgui_panel?.play_music(web_sound_url, music_extra_data)
|
||||
else
|
||||
C.chatOutput.stopMusic()
|
||||
C.tgui_panel?.stop_music()
|
||||
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Play Internet Sound")
|
||||
|
||||
/client/proc/manual_play_web_sound()
|
||||
set category = "Fun"
|
||||
set name = "Manual Play Internet Sound"
|
||||
if(!check_rights(R_SOUNDS))
|
||||
return
|
||||
|
||||
var/web_sound_input = input("Enter content stream URL (fetch this from local youtube-dl!)", "Play Internet Sound via direct URL") as text|null
|
||||
if(istext(web_sound_input))
|
||||
if(!length(web_sound_input))
|
||||
log_admin("[key_name(src)] stopped web sound")
|
||||
message_admins("[key_name(src)] stopped web sound")
|
||||
var/mob/M
|
||||
for(var/i in GLOB.player_list)
|
||||
M = i
|
||||
M?.client?.chatOutput?.stopMusic()
|
||||
return
|
||||
else
|
||||
if(web_sound_input && !findtext(web_sound_input, GLOB.is_http_protocol))
|
||||
to_chat(src, "<span class='boldwarning'>BLOCKED: Content URL not using http(s) protocol</span>")
|
||||
return
|
||||
var/freq = input(usr, "What frequency would you like the sound to play at?",, 1) as null|num
|
||||
if(isnull(freq))
|
||||
return
|
||||
if(!freq)
|
||||
freq = 1
|
||||
SSblackbox.record_feedback("nested tally", "played_url", 1, list("[ckey]", "[web_sound_input]"))
|
||||
var/logstr = "[key_name(src)] played web sound at freq [freq]: [web_sound_input]"
|
||||
log_admin(logstr)
|
||||
message_admins(logstr)
|
||||
var/mob/M
|
||||
var/client/C
|
||||
var/datum/chatOutput/O
|
||||
for(var/i in GLOB.player_list)
|
||||
M = i
|
||||
C = M.client
|
||||
if(!(C?.prefs?.toggles & SOUND_MIDI))
|
||||
continue
|
||||
O = C.chatOutput
|
||||
if(!O || O.broken || !O.loaded)
|
||||
continue
|
||||
O.sendMusic(web_sound_input, freq)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Manual Play Internet Sound")
|
||||
|
||||
/client/proc/set_round_end_sound(S as sound)
|
||||
set category = "Fun"
|
||||
set name = "Set Round End Sound"
|
||||
@@ -193,42 +147,6 @@
|
||||
message_admins("[key_name_admin(src)] set the round end sound to [S]")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Set Round End Sound") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/play_web_sound_manual()
|
||||
set category = "Fun"
|
||||
set name = "Manual Play Internet Sound"
|
||||
if(!check_rights(R_SOUNDS))
|
||||
return
|
||||
|
||||
var/web_sound_input = input("Enter youtube-dl fetched content URL (supported sites only, leave blank to stop playing)", "Send youtube-dl media link") as text|null
|
||||
if(!istext(web_sound_input))
|
||||
return
|
||||
web_sound_input = trim(web_sound_input)
|
||||
if(!length(web_sound_input))
|
||||
log_admin("[key_name(src)] stopped web sound")
|
||||
message_admins("[key_name(src)] stopped web sound")
|
||||
for(var/m in GLOB.player_list)
|
||||
var/mob/M = m
|
||||
var/client/C = M.client
|
||||
if((C.prefs.toggles & SOUND_MIDI) && C.chatOutput && !C.chatOutput.broken && C.chatOutput.loaded)
|
||||
C.chatOutput.stopMusic()
|
||||
return
|
||||
var/freq = input(usr, "What frequency would you like the sound to play at?",, 1) as null|num
|
||||
if(!freq)
|
||||
return
|
||||
if(web_sound_input && !findtext(web_sound_input, GLOB.is_http_protocol))
|
||||
to_chat(src, "<span class='boldwarning'>BLOCKED: Content URL not using http(s) protocol</span>")
|
||||
to_chat(src, "<span class='warning'>The media provider returned a content URL that isn't using the HTTP or HTTPS protocol</span>")
|
||||
return
|
||||
|
||||
SSblackbox.record_feedback("nested tally", "played_url_manual", 1, list("[ckey]", "[web_sound_input]"))
|
||||
log_admin("[key_name(src)] manually played web sound: [web_sound_input]")
|
||||
message_admins("[key_name(src)] manually played web sound: <a href='web_sound_input'>HREF</a>")
|
||||
for(var/m in GLOB.player_list)
|
||||
var/mob/M = m
|
||||
var/client/C = M.client
|
||||
if((C.prefs.toggles & SOUND_MIDI) && C.chatOutput && !C.chatOutput.broken && C.chatOutput.loaded)
|
||||
C.chatOutput.sendMusic(web_sound_input, freq)
|
||||
|
||||
/client/proc/stop_sounds()
|
||||
set category = "Debug"
|
||||
set name = "Stop All Playing Sounds"
|
||||
@@ -238,9 +156,7 @@
|
||||
log_admin("[key_name(src)] stopped all currently playing sounds.")
|
||||
message_admins("[key_name_admin(src)] stopped all currently playing sounds.")
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(M.client)
|
||||
SEND_SOUND(M, sound(null))
|
||||
var/client/C = M.client
|
||||
if(C && C.chatOutput && !C.chatOutput.broken && C.chatOutput.loaded)
|
||||
C.chatOutput.stopMusic()
|
||||
SEND_SOUND(M, sound(null))
|
||||
var/client/C = M.client
|
||||
C?.tgui_panel?.stop_music()
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Stop All Playing Sounds") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -266,6 +266,25 @@
|
||||
"basemafia" ='icons/UI_Icons/Achievements/basemafia.png'
|
||||
)
|
||||
*/
|
||||
|
||||
/datum/asset/spritesheet/simple/minesweeper
|
||||
name = "minesweeper"
|
||||
assets = list(
|
||||
"1" = 'icons/UI_Icons/minesweeper_tiles/one.png',
|
||||
"2" = 'icons/UI_Icons/minesweeper_tiles/two.png',
|
||||
"3" = 'icons/UI_Icons/minesweeper_tiles/three.png',
|
||||
"4" = 'icons/UI_Icons/minesweeper_tiles/four.png',
|
||||
"5" = 'icons/UI_Icons/minesweeper_tiles/five.png',
|
||||
"6" = 'icons/UI_Icons/minesweeper_tiles/six.png',
|
||||
"7" = 'icons/UI_Icons/minesweeper_tiles/seven.png',
|
||||
"8" = 'icons/UI_Icons/minesweeper_tiles/eight.png',
|
||||
"empty" = 'icons/UI_Icons/minesweeper_tiles/empty.png',
|
||||
"flag" = 'icons/UI_Icons/minesweeper_tiles/flag.png',
|
||||
"hidden" = 'icons/UI_Icons/minesweeper_tiles/hidden.png',
|
||||
"mine" = 'icons/UI_Icons/minesweeper_tiles/mine.png',
|
||||
"minehit" = 'icons/UI_Icons/minesweeper_tiles/minehit.png'
|
||||
)
|
||||
|
||||
/datum/asset/spritesheet/simple/pills
|
||||
name ="pills"
|
||||
assets = list(
|
||||
|
||||
@@ -75,11 +75,12 @@
|
||||
|
||||
var/inprefs = FALSE
|
||||
var/list/topiclimiter
|
||||
|
||||
///Used for limiting the rate of clicks sends by the client to avoid abuse
|
||||
var/list/clicklimiter
|
||||
|
||||
var/datum/chatOutput/chatOutput
|
||||
|
||||
var/list/credits //lazy list of all credit object bound to this client
|
||||
///lazy list of all credit object bound to this client
|
||||
var/list/credits
|
||||
|
||||
var/datum/player_details/player_details //these persist between logins/logouts during the same round.
|
||||
|
||||
|
||||
@@ -267,7 +267,6 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
else
|
||||
prefs = new /datum/preferences(src)
|
||||
GLOB.preferences_datums[ckey] = prefs
|
||||
addtimer(CALLBACK(src, .proc/ensure_keys_set), 0) //prevents possible race conditions
|
||||
|
||||
prefs.last_ip = address //these are gonna be used for banning
|
||||
prefs.last_id = computer_id //these are gonna be used for banning
|
||||
@@ -335,9 +334,9 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
// if(SSinput.initialized)
|
||||
// set_macros()
|
||||
// update_movement_keys()
|
||||
if(SSinput.initialized)
|
||||
set_macros()
|
||||
update_movement_keys()
|
||||
|
||||
// Initialize tgui panel
|
||||
tgui_panel.initialize()
|
||||
|
||||
@@ -145,8 +145,7 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, togglemidis)()
|
||||
to_chat(usr, "You will no longer hear sounds uploaded by admins")
|
||||
usr.stop_sound_channel(CHANNEL_ADMIN)
|
||||
var/client/C = usr.client
|
||||
if(C && C.chatOutput && !C.chatOutput.broken && C.chatOutput.loaded)
|
||||
C.chatOutput.stopMusic()
|
||||
C?.tgui_panel?.stop_music()
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Hearing Midis", "[usr.client.prefs.toggles & SOUND_MIDI ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
/datum/verbs/menu/Settings/Sound/togglemidis/Get_checked(client/C)
|
||||
return C.prefs.toggles & SOUND_MIDI
|
||||
@@ -234,8 +233,7 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggleprayersounds)()
|
||||
set desc = "Stop Current Sounds"
|
||||
SEND_SOUND(usr, sound(null))
|
||||
var/client/C = usr.client
|
||||
if(C && C.chatOutput && !C.chatOutput.broken && C.chatOutput.loaded)
|
||||
C.chatOutput.stopMusic()
|
||||
C?.tgui_panel?.stop_music()
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Stop Self Sounds")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
|
||||
@@ -158,88 +158,6 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")
|
||||
else
|
||||
to_chat(src, "<span class='notice'>There are no admin notices at the moment.</span>")
|
||||
|
||||
/client/verb/fix_chat()
|
||||
set name = "Fix chat"
|
||||
set category = "OOC"
|
||||
if (!chatOutput || !istype(chatOutput))
|
||||
var/action = alert(src, "Invalid Chat Output data found!\nRecreate data?", "Wot?", "Recreate Chat Output data", "Cancel")
|
||||
if (action != "Recreate Chat Output data")
|
||||
return
|
||||
chatOutput = new /datum/chatOutput(src)
|
||||
chatOutput.start()
|
||||
action = alert(src, "Goon chat reloading, wait a bit and tell me if it's fixed", "", "Fixed", "Nope")
|
||||
if (action == "Fixed")
|
||||
log_game("GOONCHAT: [key_name(src)] Had to fix their goonchat by re-creating the chatOutput datum")
|
||||
else
|
||||
chatOutput.load()
|
||||
action = alert(src, "How about now? (give it a moment (it may also try to load twice))", "", "Yes", "No")
|
||||
if (action == "Yes")
|
||||
log_game("GOONCHAT: [key_name(src)] Had to fix their goonchat by re-creating the chatOutput datum and forcing a load()")
|
||||
else
|
||||
action = alert(src, "Welp, I'm all out of ideas. Try closing byond and reconnecting.\nWe could also disable fancy chat and re-enable oldchat", "", "Thanks anyways", "Switch to old chat")
|
||||
if (action == "Switch to old chat")
|
||||
winset(src, "output", "is-visible=true;is-disabled=false")
|
||||
winset(src, "browseroutput", "is-visible=false")
|
||||
log_game("GOONCHAT: [key_name(src)] Failed to fix their goonchat window after recreating the chatOutput and forcing a load()")
|
||||
|
||||
else if (chatOutput.loaded)
|
||||
var/action = alert(src, "ChatOutput seems to be loaded\nDo you want me to force a reload, wiping the chat log or just refresh the chat window because it broke/went away?", "Hmmm", "Force Reload", "Refresh", "Cancel")
|
||||
switch (action)
|
||||
if ("Force Reload")
|
||||
chatOutput.loaded = FALSE
|
||||
chatOutput.start() //this is likely to fail since it asks , but we should try it anyways so we know.
|
||||
action = alert(src, "Goon chat reloading, wait a bit and tell me if it's fixed", "", "Fixed", "Nope")
|
||||
if (action == "Fixed")
|
||||
log_game("GOONCHAT: [key_name(src)] Had to fix their goonchat by forcing a start()")
|
||||
else
|
||||
chatOutput.load()
|
||||
action = alert(src, "How about now? (give it a moment (it may also try to load twice))", "", "Yes", "No")
|
||||
if (action == "Yes")
|
||||
log_game("GOONCHAT: [key_name(src)] Had to fix their goonchat by forcing a load()")
|
||||
else
|
||||
action = alert(src, "Welp, I'm all out of ideas. Try closing byond and reconnecting.\nWe could also disable fancy chat and re-enable oldchat", "", "Thanks anyways", "Switch to old chat")
|
||||
if (action == "Switch to old chat")
|
||||
winset(src, "output", "is-visible=true;is-disabled=false")
|
||||
winset(src, "browseroutput", "is-visible=false")
|
||||
log_game("GOONCHAT: [key_name(src)] Failed to fix their goonchat window forcing a start() and forcing a load()")
|
||||
|
||||
if ("Refresh")
|
||||
chatOutput.showChat()
|
||||
action = alert(src, "Goon chat refreshing, wait a bit and tell me if it's fixed", "", "Fixed", "Nope, force a reload")
|
||||
if (action == "Fixed")
|
||||
log_game("GOONCHAT: [key_name(src)] Had to fix their goonchat by forcing a show()")
|
||||
else
|
||||
chatOutput.loaded = FALSE
|
||||
chatOutput.load()
|
||||
action = alert(src, "How about now? (give it a moment)", "", "Yes", "No")
|
||||
if (action == "Yes")
|
||||
log_game("GOONCHAT: [key_name(src)] Had to fix their goonchat by forcing a load()")
|
||||
else
|
||||
action = alert(src, "Welp, I'm all out of ideas. Try closing byond and reconnecting.\nWe could also disable fancy chat and re-enable oldchat", "", "Thanks anyways", "Switch to old chat")
|
||||
if (action == "Switch to old chat")
|
||||
winset(src, "output", "is-visible=true;is-disabled=false")
|
||||
winset(src, "browseroutput", "is-visible=false")
|
||||
log_game("GOONCHAT: [key_name(src)] Failed to fix their goonchat window forcing a show() and forcing a load()")
|
||||
return
|
||||
|
||||
else
|
||||
chatOutput.start()
|
||||
var/action = alert(src, "Manually loading Chat, wait a bit and tell me if it's fixed", "", "Fixed", "Nope")
|
||||
if (action == "Fixed")
|
||||
log_game("GOONCHAT: [key_name(src)] Had to fix their goonchat by manually calling start()")
|
||||
else
|
||||
chatOutput.load()
|
||||
alert(src, "How about now? (give it a moment (it may also try to load twice))", "", "Yes", "No")
|
||||
if (action == "Yes")
|
||||
log_game("GOONCHAT: [key_name(src)] Had to fix their goonchat by manually calling start() and forcing a load()")
|
||||
else
|
||||
action = alert(src, "Welp, I'm all out of ideas. Try closing byond and reconnecting.\nWe could also disable fancy chat and re-enable oldchat", "", "Thanks anyways", "Switch to old chat")
|
||||
if (action == "Switch to old chat")
|
||||
winset(src, "output", list2params(list("on-show" = "", "is-disabled" = "false", "is-visible" = "true")))
|
||||
winset(src, "browseroutput", "is-disabled=true;is-visible=false")
|
||||
log_game("GOONCHAT: [key_name(src)] Failed to fix their goonchat window after manually calling start() and forcing a load()")
|
||||
|
||||
|
||||
|
||||
/client/verb/motd()
|
||||
set name = "MOTD"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
if(search)
|
||||
emoji = lowertext(copytext(text, pos + length(text[pos]), search))
|
||||
var/isthisapath = (emoji[1] == "/") && text2path(emoji)
|
||||
var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/goonchat)
|
||||
var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/chat)
|
||||
var/tag = sheet.icon_tag("emoji-[emoji]")
|
||||
if(tag)
|
||||
parsed += "<i style='width:16px !important;height:16px !important;'>[tag]</i>" //evil way of enforcing 16x16
|
||||
|
||||
@@ -335,7 +335,7 @@
|
||||
if(2)
|
||||
visible_message("<b>[src]</b> waves their arms around, <span class='spooky'>\"If only you had a better upbringing, your ears are now full of my singing!\"</span>")
|
||||
var/client/C2 = C.client
|
||||
C2.chatOutput.sendMusic("https://puu.sh/ExBbv.mp4", 1)//I hope this works!
|
||||
C.tgui_panel?.play_music("https://puu.sh/ExBbv.mp4")
|
||||
if(3)
|
||||
visible_message("<b>[src]</b> waves their arms around, <span class='spooky'>\"You're cute little bumpkin, On your head is a pumpkin!\"</span>")
|
||||
if(C.head)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
return TRUE
|
||||
|
||||
/datum/language/proc/get_icon()
|
||||
var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/goonchat)
|
||||
var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/chat)
|
||||
return sheet.icon_tag("language-[icon_state]")
|
||||
|
||||
/datum/language/proc/get_random_name(gender, name_count=2, syllable_count=4, syllable_divisor=2)
|
||||
|
||||
@@ -66,7 +66,6 @@
|
||||
dat += "<A href='?src=[REF(src)];back=1'>\[Go Back\]</A><BR>"
|
||||
var/datum/browser/popup = new(user, "publiclibrary", name, 600, 400)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/computer/libraryconsole/Topic(href, href_list)
|
||||
@@ -314,7 +313,6 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
|
||||
|
||||
var/datum/browser/popup = new(user, "library", name, 600, 400)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/computer/libraryconsole/bookmanagement/proc/findscanner(viewrange)
|
||||
@@ -537,7 +535,6 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
|
||||
dat += "<BR>"
|
||||
var/datum/browser/popup = new(user, "scanner", name, 600, 400)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/libraryscanner/Topic(href, href_list)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// The map icons
|
||||
var/icon/map_icon
|
||||
var/icon/meta_icon
|
||||
|
||||
|
||||
var/list/color_area_names = list()
|
||||
|
||||
var/minx
|
||||
@@ -33,7 +33,7 @@
|
||||
meta_icon = new('html/blank.png')
|
||||
map_icon.Scale(x2 - x1 + 1, y2 - y1 + 1) // arrays start at 1
|
||||
meta_icon.Scale(x2 - x1 + 1, y2 - y1 + 1)
|
||||
|
||||
|
||||
var/list/area_to_color = list()
|
||||
for(var/turf/T in block(locate(x1, y1, z_level), locate(x2, y2, z_level)))
|
||||
var/area/A = T.loc
|
||||
@@ -44,7 +44,7 @@
|
||||
crop_x2 = max(crop_x2, T.x)
|
||||
crop_y1 = min(crop_y1, T.y)
|
||||
crop_y2 = max(crop_y2, T.y)
|
||||
|
||||
|
||||
var/meta_color = area_to_color[A]
|
||||
if(!meta_color)
|
||||
meta_color = rgb(rand(0, 255), rand(0, 255), rand(0, 255)) // technically conflicts could happen but it's like very unlikely and it's not that big of a deal if one happens
|
||||
@@ -73,13 +73,15 @@
|
||||
overlay_icon = new(map_icon)
|
||||
overlay_icon.Scale(16, 16)
|
||||
//we're done baking, now we ship it.
|
||||
register_asset("minimap-[id].png", map_icon)
|
||||
register_asset("minimap-[id]-meta.png", meta_icon)
|
||||
if (!SSassets.cache["minimap-[id].png"])
|
||||
SSassets.transport.register_asset("minimap-[id].png", map_icon)
|
||||
if (!SSassets.cache["minimap-[id]-meta.png"])
|
||||
SSassets.transport.register_asset("minimap-[id]-meta.png", meta_icon)
|
||||
|
||||
/datum/minimap/proc/send(mob/user)
|
||||
if(!id)
|
||||
CRASH("ERROR: send called, but the minimap id is null/missing. ID: [id]")
|
||||
send_asset_list(user, list("minimap-[id].png" = map_icon, "minimap-[id]-meta.png" = meta_icon))
|
||||
SSassets.transport.send_assets(user, list("minimap-[id].png" = map_icon, "minimap-[id]-meta.png" = meta_icon))
|
||||
|
||||
/datum/minimap_group
|
||||
var/list/minimaps = list()
|
||||
@@ -100,15 +102,17 @@
|
||||
|
||||
var/list/datas = list()
|
||||
var/list/info = list()
|
||||
|
||||
|
||||
for(var/i in 1 to length(minimaps))// OLD: for(var/i in 1 to length(minimaps))
|
||||
var/datum/minimap/M = minimaps[i]
|
||||
var/map_name = "minimap-[M.id].png"
|
||||
var/meta_name = "minimap-[M.id]-meta.png"
|
||||
M.send(user)
|
||||
info += {"
|
||||
<div class="block">
|
||||
<div> <!-- The div is in here to fit it both in the block div -->
|
||||
<img id='map-[i]' src='minimap-[M.id].png' />
|
||||
<img id='map-[i]-meta' src='minimap-[M.id]-meta.png' style='display: none' />
|
||||
<img id='map-[i]' src='[SSassets.transport.get_asset_url(map_name)]' />
|
||||
<img id='map-[i]-meta' src='[SSassets.transport.get_asset_url(meta_name)]' style='display: none' />
|
||||
</div>
|
||||
<div class="statusDisplay" id='label-[i]'></div>
|
||||
</div>
|
||||
@@ -183,6 +187,4 @@
|
||||
var/datum/browser/popup = new(user, "minimap_[id]", name, 500, 700)
|
||||
popup.add_head_content(headerJS) //set the head
|
||||
popup.set_content(info)
|
||||
var/datum/minimap/MICO = minimaps[1]
|
||||
popup.set_title_image(MICO.overlay_icon)
|
||||
popup.open(FALSE)
|
||||
|
||||
@@ -70,7 +70,6 @@ interface with the mining shuttle at the landing site if a mobile beacon is also
|
||||
|
||||
var/datum/browser/popup = new(user, "computer", "base management", 550, 300) //width, height
|
||||
popup.set_content("<center>[dat]</center>")
|
||||
popup.set_title_image(usr.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
|
||||
|
||||
|
||||
@@ -336,7 +336,6 @@ GLOBAL_LIST_EMPTY(allCasters)
|
||||
dat+="<A href='?src=[REF(src)];setScreen=[0]'>Return</A>"
|
||||
var/datum/browser/popup = new(human_or_robot_user, "newscaster_main", "Newscaster Unit #[unit_no]", 400, 600)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(human_or_robot_user.browse_rsc_icon(icon, icon_state))
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/newscaster/Topic(href, href_list)
|
||||
|
||||
@@ -139,7 +139,6 @@
|
||||
. = ..()
|
||||
var/datum/browser/popup = new(user, "teg", "Thermo-Electric Generator", 460, 300)
|
||||
popup.set_content(get_menu())
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/power/generator/Topic(href, href_list)
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
|
||||
popup = new(user, "computer", M ? M.name : "shuttle", 350, 450)
|
||||
popup.set_content("<center>[dat]</center>")
|
||||
popup.set_title_image(usr.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/computer/custom_shuttle/Topic(href, href_list)
|
||||
|
||||
Reference in New Issue
Block a user