From 74ea449566af7d9f7de7b3dd5dd9e2d0b0f82261 Mon Sep 17 00:00:00 2001 From: AnturK Date: Wed, 3 Jun 2020 21:35:03 +0200 Subject: [PATCH] Fixes Get-Current-Logs (#51376) --- code/__DEFINES/admin.dm | 4 ++++ code/__HELPERS/files.dm | 9 +++++++-- code/modules/admin/verbs/getlogs.dm | 6 +++--- 3 files changed, 14 insertions(+), 5 deletions(-) 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