diff --git a/code/__DEFINES/admin.dm b/code/__DEFINES/admin.dm index ef8112adcab..fca7032074b 100644 --- a/code/__DEFINES/admin.dm +++ b/code/__DEFINES/admin.dm @@ -114,3 +114,7 @@ //How many things you can spawn at once with spawn verb/create panel #define ADMIN_SPAWN_CAP 100 + +// LOG BROWSE TYPES +#define BROWSE_ROOT_ALL_LOGS 1 +#define BROWSE_ROOT_CURRENT_LOGS 2 diff --git a/code/__HELPERS/files.dm b/code/__HELPERS/files.dm index 0c5ee333cbd..623ed18a25c 100644 --- a/code/__HELPERS/files.dm +++ b/code/__HELPERS/files.dm @@ -3,9 +3,14 @@ for(var/file in args) src << browse_rsc(file) -/client/proc/browse_files(root="data/logs/", max_iterations=10, list/valid_extensions=list("txt","log","htm", "html")) +/client/proc/browse_files(root_type=BROWSE_ROOT_ALL_LOGS, max_iterations=10, list/valid_extensions=list("txt","log","htm", "html")) // wow why was this ever a parameter - root = "data/logs/" + var/root = "data/logs/" + switch(root_type) + if(BROWSE_ROOT_ALL_LOGS) + root = "data/logs/" + if(BROWSE_ROOT_CURRENT_LOGS) + root = "[GLOB.log_directory]/" var/path = root for(var/i=0, i