April sync (#360)
* Maps and things no code/icons * helpers defines globalvars * Onclick world.dm orphaned_procs * subsystems Round vote and shuttle autocall done here too * datums * Game folder * Admin - chatter modules * clothing - mining * modular computers - zambies * client * mob level 1 * mob stage 2 + simple_animal * silicons n brains * mob stage 3 + Alien/Monkey * human mobs * icons updated * some sounds * emitter y u no commit * update tgstation.dme * compile fixes * travis fixes Also removes Fast digest mode, because reasons. * tweaks for travis Mentors are broke again Also fixes Sizeray guns * oxygen loss fix for vore code. * removes unused code * some code updates * bulk fixes * further fixes * outside things * whoops. * Maint bar ported * GLOBs.
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
if(!prob(correctness))
|
||||
usedName += "x"
|
||||
var/datum/devilinfo/devil = devilInfo(usedName, 0)
|
||||
user << browse("Information on [devilName]<br><br><br>[lawlorify[LORE][devil.ban]]<br>[lawlorify[LORE][devil.bane]]<br>[lawlorify[LORE][devil.obligation]]<br>[lawlorify[LORE][devil.banish]]", "window=book[window_size != null ? ";size=[window_size]" : ""]")
|
||||
user << browse("Information on [devilName]<br><br><br>[GLOB.lawlorify[LORE][devil.ban]]<br>[GLOB.lawlorify[LORE][devil.bane]]<br>[GLOB.lawlorify[LORE][devil.obligation]]<br>[GLOB.lawlorify[LORE][devil.banish]]", "window=book[window_size != null ? ";size=[window_size]" : ""]")
|
||||
inUse = 0
|
||||
sleep(10)
|
||||
if(!prob(willpower))
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
dat += "<A href='?src=\ref[src];setauthor=1'>Filter by Author: [author]</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];search=1'>\[Start Search\]</A><BR>"
|
||||
if(1)
|
||||
if (!dbcon.Connect())
|
||||
if (!GLOB.dbcon.Connect())
|
||||
dat += "<font color=red><b>ERROR</b>: Unable to contact External Archive. Please contact your system administrator for assistance.</font><BR>"
|
||||
else if(!SQLquery)
|
||||
dat += "<font color=red><b>ERROR</b>: Malformed search request. Please contact your system administrator for assistance.</font><BR>"
|
||||
@@ -51,7 +51,7 @@
|
||||
dat += "<table>"
|
||||
dat += "<tr><td>AUTHOR</td><td>TITLE</td><td>CATEGORY</td><td>SS<sup>13</sup>BN</td></tr>"
|
||||
|
||||
var/DBQuery/query_library_list_books = dbcon.NewQuery(SQLquery)
|
||||
var/DBQuery/query_library_list_books = GLOB.dbcon.NewQuery(SQLquery)
|
||||
if(!query_library_list_books.Execute())
|
||||
dat += "<font color=red><b>ERROR</b>: Unable to retrieve book listings. Please contact your system administrator for assistance.</font><BR>"
|
||||
while(query_library_list_books.NextRow())
|
||||
@@ -128,16 +128,16 @@
|
||||
var/author
|
||||
var/category
|
||||
|
||||
var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
GLOBAL_LIST(cachedbooks) // List of our cached book datums
|
||||
|
||||
|
||||
/proc/load_library_db_to_cache()
|
||||
if(cachedbooks)
|
||||
if(GLOB.cachedbooks)
|
||||
return
|
||||
if(!dbcon.Connect())
|
||||
if(!GLOB.dbcon.Connect())
|
||||
return
|
||||
cachedbooks = list()
|
||||
var/DBQuery/query_library_cache = dbcon.NewQuery("SELECT id, author, title, category FROM [format_table_name("library")] WHERE isnull(deleted)")
|
||||
GLOB.cachedbooks = list()
|
||||
var/DBQuery/query_library_cache = GLOB.dbcon.NewQuery("SELECT id, author, title, category FROM [format_table_name("library")] WHERE isnull(deleted)")
|
||||
if(!query_library_cache.Execute())
|
||||
return
|
||||
while(query_library_cache.NextRow())
|
||||
@@ -146,7 +146,7 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
newbook.author = query_library_cache.item[2]
|
||||
newbook.title = query_library_cache.item[3]
|
||||
newbook.category = query_library_cache.item[4]
|
||||
cachedbooks += newbook
|
||||
GLOB.cachedbooks += newbook
|
||||
|
||||
|
||||
|
||||
@@ -181,12 +181,12 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
if(libcomp_menu)
|
||||
return
|
||||
load_library_db_to_cache()
|
||||
if(!cachedbooks)
|
||||
if(!GLOB.cachedbooks)
|
||||
return
|
||||
libcomp_menu = list("")
|
||||
|
||||
for(var/i in 1 to cachedbooks.len)
|
||||
var/datum/cachedbook/C = cachedbooks[i]
|
||||
for(var/i in 1 to GLOB.cachedbooks.len)
|
||||
var/datum/cachedbook/C = GLOB.cachedbooks[i]
|
||||
var/page = round(i/250)+1
|
||||
if (libcomp_menu.len < page)
|
||||
libcomp_menu.len = page
|
||||
@@ -257,7 +257,7 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
dat += "<h3>External Archive</h3>"
|
||||
build_library_menu()
|
||||
|
||||
if(!cachedbooks)
|
||||
if(!GLOB.cachedbooks)
|
||||
dat += "<font color=red><b>ERROR</b>: Unable to contact External Archive. Please contact your system administrator for assistance.</font>"
|
||||
else
|
||||
dat += "<A href='?src=\ref[src];orderbyid=1'>(Order book by SS<sup>13</sup>BN)</A><BR><BR>"
|
||||
@@ -411,7 +411,7 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
if(scanner.cache)
|
||||
var/choice = input("Are you certain you wish to upload this title to the Archive?") in list("Confirm", "Abort")
|
||||
if(choice == "Confirm")
|
||||
if (!dbcon.Connect())
|
||||
if (!GLOB.dbcon.Connect())
|
||||
alert("Connection to Archive has been severed. Aborting.")
|
||||
else
|
||||
|
||||
@@ -419,7 +419,7 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
var/sqlauthor = sanitizeSQL(scanner.cache.author)
|
||||
var/sqlcontent = sanitizeSQL(scanner.cache.dat)
|
||||
var/sqlcategory = sanitizeSQL(upload_category)
|
||||
var/DBQuery/query_library_upload = dbcon.NewQuery("INSERT INTO [format_table_name("library")] (author, title, content, category, ckey, datetime) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]', '[usr.ckey]', Now())")
|
||||
var/DBQuery/query_library_upload = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("library")] (author, title, content, category, ckey, datetime) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]', '[usr.ckey]', Now())")
|
||||
if(!query_library_upload.Execute())
|
||||
alert("Database error encountered uploading to Archive")
|
||||
return
|
||||
@@ -427,16 +427,16 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
log_game("[usr.name]/[usr.key] has uploaded the book titled [scanner.cache.name], [length(scanner.cache.dat)] signs")
|
||||
alert("Upload Complete. Uploaded title will be unavailable for printing for a short period")
|
||||
if(href_list["newspost"])
|
||||
if(!news_network)
|
||||
if(!GLOB.news_network)
|
||||
alert("No news network found on station. Aborting.")
|
||||
var/channelexists = 0
|
||||
for(var/datum/newscaster/feed_channel/FC in news_network.network_channels)
|
||||
for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels)
|
||||
if(FC.channel_name == "Nanotrasen Book Club")
|
||||
channelexists = 1
|
||||
break
|
||||
if(!channelexists)
|
||||
news_network.CreateFeedChannel("Nanotrasen Book Club", "Library", null)
|
||||
news_network.SubmitArticle(scanner.cache.dat, "[scanner.cache.name]", "Nanotrasen Book Club", null)
|
||||
GLOB.news_network.CreateFeedChannel("Nanotrasen Book Club", "Library", null)
|
||||
GLOB.news_network.SubmitArticle(scanner.cache.dat, "[scanner.cache.name]", "Nanotrasen Book Club", null)
|
||||
alert("Upload complete. Your uploaded title is now available on station newscasters.")
|
||||
if(href_list["orderbyid"])
|
||||
if(cooldown > world.time)
|
||||
@@ -449,13 +449,13 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
|
||||
if(href_list["targetid"])
|
||||
var/sqlid = sanitizeSQL(href_list["targetid"])
|
||||
if (!dbcon.Connect())
|
||||
if (!GLOB.dbcon.Connect())
|
||||
alert("Connection to Archive has been severed. Aborting.")
|
||||
if(cooldown > world.time)
|
||||
say("Printer unavailable. Please allow a short time before attempting to print.")
|
||||
else
|
||||
cooldown = world.time + PRINTER_COOLDOWN
|
||||
var/DBQuery/query_library_print = dbcon.NewQuery("SELECT * FROM [format_table_name("library")] WHERE id=[sqlid] AND isnull(deleted)")
|
||||
var/DBQuery/query_library_print = GLOB.dbcon.NewQuery("SELECT * FROM [format_table_name("library")] WHERE id=[sqlid] AND isnull(deleted)")
|
||||
if(!query_library_print.Execute())
|
||||
say("PRINTER ERROR! Failed to print document (0x0000000F)")
|
||||
return
|
||||
@@ -474,11 +474,11 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
if(href_list["printbible"])
|
||||
if(cooldown < world.time)
|
||||
var/obj/item/weapon/storage/book/bible/B = new /obj/item/weapon/storage/book/bible(src.loc)
|
||||
if(SSreligion.Bible_icon_state && SSreligion.Bible_item_state)
|
||||
B.icon_state = SSreligion.Bible_icon_state
|
||||
B.item_state = SSreligion.Bible_item_state
|
||||
B.name = SSreligion.Bible_name
|
||||
B.deity_name = SSreligion.Bible_deity_name
|
||||
if(SSreligion.bible_icon_state && SSreligion.bible_item_state)
|
||||
B.icon_state = SSreligion.bible_icon_state
|
||||
B.item_state = SSreligion.bible_item_state
|
||||
B.name = SSreligion.bible_name
|
||||
B.deity_name = SSreligion.deity
|
||||
cooldown = world.time + PRINTER_COOLDOWN
|
||||
else
|
||||
say("Printer currently unavailable, please wait a moment.")
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/obj/item/weapon/book/manual/random/New()
|
||||
/obj/item/weapon/book/manual/random/Initialize()
|
||||
..()
|
||||
var/static/banned_books = list(/obj/item/weapon/book/manual/random,/obj/item/weapon/book/manual/nuclear,/obj/item/weapon/book/manual/wiki)
|
||||
var/newtype = pick(subtypesof(/obj/item/weapon/book/manual) - banned_books)
|
||||
new newtype(loc)
|
||||
@@ -8,7 +9,8 @@
|
||||
var/amount = 1
|
||||
var/category = null
|
||||
|
||||
/obj/item/weapon/book/random/New()
|
||||
/obj/item/weapon/book/random/Initialize()
|
||||
..()
|
||||
create_random_books(amount, src.loc, TRUE, category)
|
||||
qdel(src)
|
||||
|
||||
@@ -34,7 +36,7 @@
|
||||
. = list()
|
||||
if(!isnum(amount) || amount<1)
|
||||
return
|
||||
if (!dbcon.Connect())
|
||||
if (!GLOB.dbcon.Connect())
|
||||
if(fail_loud || prob(5))
|
||||
var/obj/item/weapon/paper/P = new(location)
|
||||
P.info = "There once was a book from Nantucket<br>But the database failed us, so f*$! it.<br>I tried to be good to you<br>Now this is an I.O.U<br>If you're feeling entitled, well, stuff it!<br><br><font color='gray'>~</font>"
|
||||
@@ -43,7 +45,7 @@
|
||||
if(prob(25))
|
||||
category = null
|
||||
var/c = category? " AND category='[sanitizeSQL(category)]'" :""
|
||||
var/DBQuery/query_get_random_books = dbcon.NewQuery("SELECT * FROM [format_table_name("library")] WHERE isnull(deleted)[c] GROUP BY title ORDER BY rand() LIMIT [amount];") // isdeleted copyright (c) not me
|
||||
var/DBQuery/query_get_random_books = GLOB.dbcon.NewQuery("SELECT * FROM [format_table_name("library")] WHERE isnull(deleted)[c] GROUP BY title ORDER BY rand() LIMIT [amount];") // isdeleted copyright (c) not me
|
||||
if(query_get_random_books.Execute())
|
||||
while(query_get_random_books.NextRow())
|
||||
var/obj/item/weapon/book/B = new(location)
|
||||
|
||||
@@ -192,10 +192,14 @@
|
||||
var/turf/T = get_turf(src)
|
||||
data["x"] = T.x
|
||||
data["y"] = T.y
|
||||
data["z"] = T.z
|
||||
data["like_keys"] = like_keys
|
||||
data["dislike_keys"] = dislike_keys
|
||||
|
||||
/obj/structure/chisel_message/proc/unpack(list/data)
|
||||
if(!islist(data))
|
||||
return
|
||||
|
||||
hidden_message = data["hidden_message"]
|
||||
creator_name = data["creator_name"]
|
||||
creator_key = data["creator_key"]
|
||||
@@ -209,8 +213,10 @@
|
||||
|
||||
var/x = data["x"]
|
||||
var/y = data["y"]
|
||||
var/turf/newloc = locate(x, y, ZLEVEL_STATION)
|
||||
forceMove(newloc)
|
||||
var/z = data["z"]
|
||||
var/turf/newloc = locate(x, y, z)
|
||||
if(isturf(newloc))
|
||||
forceMove(newloc)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/chisel_message/examine(mob/user)
|
||||
@@ -223,7 +229,7 @@
|
||||
SSpersistence.chisel_messages -= src
|
||||
. = ..()
|
||||
|
||||
/obj/structure/chisel_message/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = always_state)
|
||||
/obj/structure/chisel_message/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.always_state)
|
||||
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
|
||||
Reference in New Issue
Block a user