From a7409fbff231cab136be7bd5f02a7d3f91713e9a Mon Sep 17 00:00:00 2001 From: Mothblocks <35135081+Mothblocks@users.noreply.github.com> Date: Fri, 3 Dec 2021 06:16:38 -0800 Subject: [PATCH] Add investigate logs for crafting (#63178) --- code/__DEFINES/logging.dm | 17 ++++++++-------- code/datums/components/crafting/crafting.dm | 9 +++++---- code/modules/admin/admin_investigate.dm | 22 ++++++++++++++++++++- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/code/__DEFINES/logging.dm b/code/__DEFINES/logging.dm index ae323c0f54c..f9df86cde9c 100644 --- a/code/__DEFINES/logging.dm +++ b/code/__DEFINES/logging.dm @@ -1,22 +1,23 @@ //Investigate logging defines +#define INVESTIGATE_ACCESSCHANGES "id_card_changes" #define INVESTIGATE_ATMOS "atmos" #define INVESTIGATE_BOTANY "botany" #define INVESTIGATE_CARGO "cargo" +#define INVESTIGATE_CRAFTING "crafting" +#define INVESTIGATE_EXONET "exonet" #define INVESTIGATE_EXPERIMENTOR "experimentor" #define INVESTIGATE_GRAVITY "gravity" +#define INVESTIGATE_HALLUCINATIONS "hallucinations" +#define INVESTIGATE_HYPERTORUS "hypertorus" +#define INVESTIGATE_PORTAL "portals" +#define INVESTIGATE_PRESENTS "presents" +#define INVESTIGATE_RADIATION "radiation" #define INVESTIGATE_RECORDS "records" +#define INVESTIGATE_RESEARCH "research" #define INVESTIGATE_SINGULO "singulo" #define INVESTIGATE_SUPERMATTER "supermatter" #define INVESTIGATE_TELESCI "telesci" #define INVESTIGATE_WIRES "wires" -#define INVESTIGATE_PORTAL "portals" -#define INVESTIGATE_RESEARCH "research" -#define INVESTIGATE_HALLUCINATIONS "hallucinations" -#define INVESTIGATE_RADIATION "radiation" -#define INVESTIGATE_EXONET "exonet" -#define INVESTIGATE_PRESENTS "presents" -#define INVESTIGATE_HYPERTORUS "hypertorus" -#define INVESTIGATE_ACCESSCHANGES "id_card_changes" // Logging types for log_message() #define LOG_ATTACK (1 << 0) diff --git a/code/datums/components/crafting/crafting.dm b/code/datums/components/crafting/crafting.dm index 76523bd8cac..a175a3e75a1 100644 --- a/code/datums/components/crafting/crafting.dm +++ b/code/datums/components/crafting/crafting.dm @@ -436,17 +436,18 @@ switch(action) if("make") var/mob/user = usr - var/datum/crafting_recipe/TR = locate(params["recipe"]) in GLOB.crafting_recipes + var/datum/crafting_recipe/crafting_recipe = locate(params["recipe"]) in GLOB.crafting_recipes busy = TRUE ui_interact(user) - var/atom/movable/result = construct_item(user, TR) + var/atom/movable/result = construct_item(user, crafting_recipe) if(!istext(result)) //We made an item and didn't get a fail message if(ismob(user) && isitem(result)) //In case the user is actually possessing a non mob like a machine user.put_in_hands(result) else result.forceMove(user.drop_location()) - to_chat(user, span_notice("[TR.name] constructed.")) - TR.on_craft_completion(user, result) + to_chat(user, span_notice("[crafting_recipe.name] constructed.")) + user.investigate_log("[key_name(user)] crafted [crafting_recipe]", INVESTIGATE_CRAFTING) + crafting_recipe.on_craft_completion(user, result) else to_chat(user, span_warning("Construction failed[result]")) busy = FALSE diff --git a/code/modules/admin/admin_investigate.dm b/code/modules/admin/admin_investigate.dm index 101bcde8851..03fbf449159 100644 --- a/code/modules/admin/admin_investigate.dm +++ b/code/modules/admin/admin_investigate.dm @@ -10,7 +10,27 @@ if(!holder) return - var/list/investigates = list(INVESTIGATE_RESEARCH, INVESTIGATE_EXONET, INVESTIGATE_PORTAL, INVESTIGATE_SINGULO, INVESTIGATE_WIRES, INVESTIGATE_TELESCI, INVESTIGATE_GRAVITY, INVESTIGATE_RECORDS, INVESTIGATE_CARGO, INVESTIGATE_SUPERMATTER, INVESTIGATE_ATMOS, INVESTIGATE_EXPERIMENTOR, INVESTIGATE_BOTANY, INVESTIGATE_HALLUCINATIONS, INVESTIGATE_RADIATION, INVESTIGATE_PRESENTS, INVESTIGATE_HYPERTORUS, INVESTIGATE_ACCESSCHANGES) + var/list/investigates = list( + INVESTIGATE_ACCESSCHANGES, + INVESTIGATE_ATMOS, + INVESTIGATE_BOTANY, + INVESTIGATE_CARGO, + INVESTIGATE_CRAFTING, + INVESTIGATE_EXONET, + INVESTIGATE_EXPERIMENTOR, + INVESTIGATE_GRAVITY, + INVESTIGATE_HALLUCINATIONS, + INVESTIGATE_HYPERTORUS, + INVESTIGATE_PORTAL, + INVESTIGATE_PRESENTS, + INVESTIGATE_RADIATION, + INVESTIGATE_RECORDS, + INVESTIGATE_RESEARCH, + INVESTIGATE_SINGULO, + INVESTIGATE_SUPERMATTER, + INVESTIGATE_TELESCI, + INVESTIGATE_WIRES, + ) var/list/logs_present = list("notes, memos, watchlist") var/list/logs_missing = list("---")