diff --git a/code/datums/helper_datums/getrev.dm b/code/datums/helper_datums/getrev.dm new file mode 100644 index 0000000000..e290fddf40 --- /dev/null +++ b/code/datums/helper_datums/getrev.dm @@ -0,0 +1,88 @@ +/* + * This datum gets revision info from local svn 'entries' file + * Path to the directory containing it should be in 'config/svndir.txt' file + * + */ + +var/global/datum/getrev/revdata = new("config/svndir.txt") + +//Oh yeah, I'm an OOP fag, lalala +/datum/getrev + var/revision + var/commiter + var/svndirpath + var/revhref + + proc/abort() + spawn() + del src + + New(filename) + ..() + if(!fexists(filename)) + return abort() + + var/text = file2text(file(filename)) + if(!text) + diary << "Unable to get [filename] contents, aborting" + return abort() + + var/list/CL = dd_text2list(text, "\n") + for (var/t in CL) + if (!t) + continue + t = trim(t) + if (length(t) == 0) + continue + else if (copytext(t, 1, 2) == "#") + continue + var/pos = findtext(t, " ") + var/name = null + var/value = null + if (pos) + name = lowertext(copytext(t, 1, pos)) + value = copytext(t, pos + 1) + else + name = lowertext(t) + if(!name) + continue + switch(name) + if("svndir") + svndirpath = value + if("revhref") + revhref = value + + if(svndirpath && fexists(svndirpath) && fexists("[svndirpath]/entries") && isfile(file("[svndirpath]/entries"))) + var/list/filelist = dd_file2list("[svndirpath]/entries",null) + revision = filelist[4] + commiter = filelist[12] + diary << "Revision info loaded succesfully" + return + return abort() + + proc/getRevisionText() + var/output + if(revhref) + output = {"[revision]"} + else + output = revision + return output + + proc/showInfo() + return {" + + + +

Server Revision: [getRevisionText()]
+ Author: [commiter]

+ + "} + +client/verb/showrevinfo() + set category = "OOC" + set name = "Show Server Revision" + var/output = "Sorry, the revision info is unavailable." + if(revdata) + output = revdata.showInfo() + usr << browse(output,"window=revdata"); + return diff --git a/code/datums/helper_datums/topic_input.dm b/code/datums/helper_datums/topic_input.dm index f0759608ae..17dd3f1266 100644 --- a/code/datums/helper_datums/topic_input.dm +++ b/code/datums/helper_datums/topic_input.dm @@ -53,4 +53,8 @@ var/t = get(i) if(t) t = text2path(t) - return ispath(t) ? t : null \ No newline at end of file + return ispath(t) ? t : null + + proc/getList(i) + var/t = getAndLocate(i) + return islist(t) ? t : null \ No newline at end of file diff --git a/code/modules/research/designs.dm b/code/modules/research/designs.dm index 98a42a2b4c..6091a1dbec 100644 --- a/code/modules/research/designs.dm +++ b/code/modules/research/designs.dm @@ -1018,7 +1018,7 @@ datum build_type = PROTOLATHE materials = list("$metal" = 5000, "$glass" = 1000, "$uranium" = 500) reliability_base = 76 - build_path = "/obj/item/weapon/gun/energy/nuclear" + build_path = "/obj/item/weapon/gun/energy/gun/nuclear" locked = 1 stunrevolver diff --git a/config/svndir.txt b/config/svndir.txt new file mode 100644 index 0000000000..5c907c92f1 --- /dev/null +++ b/config/svndir.txt @@ -0,0 +1,5 @@ +#Path to the .svn directory. Used to get server revision info. +SVNDIR .svn + +#Link to revision details. +REVHREF http://code.google.com/p/tgstation13/source/detail?r= \ No newline at end of file diff --git a/icons/80x15.png b/html/80x15.png similarity index 100% rename from icons/80x15.png rename to html/80x15.png diff --git a/icons/88x31.png b/html/88x31.png similarity index 100% rename from icons/88x31.png rename to html/88x31.png diff --git a/icons/admin_pm.html b/html/admin_pm.html similarity index 100% rename from icons/admin_pm.html rename to html/admin_pm.html diff --git a/icons/changelog.html b/html/changelog.html similarity index 100% rename from icons/changelog.html rename to html/changelog.html diff --git a/icons/create_object.html b/html/create_object.html similarity index 100% rename from icons/create_object.html rename to html/create_object.html diff --git a/icons/dice.png b/html/dice.png similarity index 100% rename from icons/dice.png rename to html/dice.png diff --git a/icons/dice20.png b/html/dice20.png similarity index 100% rename from icons/dice20.png rename to html/dice20.png diff --git a/icons/help.html b/html/help.html similarity index 100% rename from icons/help.html rename to html/help.html diff --git a/icons/map.png b/html/map.png similarity index 100% rename from icons/map.png rename to html/map.png diff --git a/icons/paigrid.png b/html/paigrid.png similarity index 100% rename from icons/paigrid.png rename to html/paigrid.png diff --git a/icons/postcardsmall.jpg b/html/postcardsmall.jpg similarity index 100% rename from icons/postcardsmall.jpg rename to html/postcardsmall.jpg diff --git a/icons/somerights20.png b/html/somerights20.png similarity index 100% rename from icons/somerights20.png rename to html/somerights20.png diff --git a/icons/ss13_32.png b/html/ss13_32.png similarity index 100% rename from icons/ss13_32.png rename to html/ss13_32.png diff --git a/icons/ss13_64.png b/html/ss13_64.png similarity index 100% rename from icons/ss13_64.png rename to html/ss13_64.png diff --git a/tgstation.dme b/tgstation.dme index cfeebff147..0d420d70c2 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -139,6 +139,7 @@ #define FILE_DIR "code/WorkInProgress/recycling" #define FILE_DIR "code/WorkInProgress/virus2" #define FILE_DIR "code/WorkInProgress/virus2/Disease2" +#define FILE_DIR "html" #define FILE_DIR "icons" #define FILE_DIR "icons/effects" #define FILE_DIR "icons/misc" @@ -236,6 +237,7 @@ #include "code\datums\diseases\wizarditis.dm" #include "code\datums\diseases\xeno_transformation.dm" #include "code\datums\helper_datums\construction_datum.dm" +#include "code\datums\helper_datums\getrev.dm" #include "code\datums\helper_datums\global_iterator.dm" #include "code\datums\helper_datums\tension.dm" #include "code\datums\helper_datums\topic_input.dm"