From 9fdb93d1603bf509dcb1c77ab581234e1b8c8bb6 Mon Sep 17 00:00:00 2001 From: BurgerLUA Date: Mon, 27 Aug 2018 12:38:27 -0700 Subject: [PATCH] Adds the ability to rename food (#5174) --- .../reagent_containers/food/snacks.dm | 22 +++++++++++ ...b - please dont name sausages to penis.yml | 38 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 html/changelogs/burgerbb - please dont name sausages to penis.yml diff --git a/code/modules/reagents/reagent_containers/food/snacks.dm b/code/modules/reagents/reagent_containers/food/snacks.dm index 920f8221388..50252637c25 100644 --- a/code/modules/reagents/reagent_containers/food/snacks.dm +++ b/code/modules/reagents/reagent_containers/food/snacks.dm @@ -160,6 +160,8 @@ /obj/item/weapon/reagent_containers/food/snacks/examine(mob/user) if(!..(user, 1)) return + if(name != initial(name)) + user << "You know the item as [initial(name)], however a little piece of propped up paper indicates it's \a [name]." if (coating) user << "It's coated in [coating.name]!" if (bitecount==0) @@ -172,6 +174,26 @@ user << "\The [src] was bitten multiple times!" /obj/item/weapon/reagent_containers/food/snacks/attackby(obj/item/weapon/W as obj, mob/user as mob) + + if(istype(W,/obj/item/weapon/pen)) + + var/selection = alert(user,"Which attribute do you wish to edit?","Food Editor","Name","Description","Cancel") + if(selection == "Name") + var/input_clean_name = sanitize(input(user,"What is the name of this food?", "Set Food Name") as text|null) + if(input_clean_name) + user.visible_message("\The [user] labels \the [name] as \"[input_clean_name]\".") + name = input_clean_name + else + name = initial(name) + else if(selection == "Description") + var/input_clean_desc = sanitize(input(user,"What is the description of this food?", "Set Food Description") as text|null) + if(input_clean_desc) + user.visible_message("\The [user] adds a note to \the [name].") + desc = input_clean_desc + else + desc = initial(desc) + return + if(istype(W,/obj/item/weapon/storage)) ..() // -> item/attackby() return diff --git a/html/changelogs/burgerbb - please dont name sausages to penis.yml b/html/changelogs/burgerbb - please dont name sausages to penis.yml new file mode 100644 index 00000000000..75eb6f8cd59 --- /dev/null +++ b/html/changelogs/burgerbb - please dont name sausages to penis.yml @@ -0,0 +1,38 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +################################# + +# Your name. +author: BurgerBB + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Added the ability to rename food and edit its description with a pen. Please don't make me regret this." +