Porting tg painting code. (#12305)

* Porting tg painting code.

* yes.
This commit is contained in:
Ghom
2020-05-21 03:45:36 +02:00
committed by GitHub
parent 6696560656
commit 3ac61c0704
21 changed files with 831 additions and 313 deletions
+19 -8
View File
@@ -91,6 +91,11 @@
refill()
/obj/item/toy/crayon/examine(mob/user)
. = ..()
if(can_change_colour)
. += "<span class='notice'>Ctrl-click [src] while it's on your person to quickly recolour it.</span>"
/obj/item/toy/crayon/proc/refill()
if(charges == -1)
charges_left = 100
@@ -160,6 +165,12 @@
update_icon()
return TRUE
/obj/item/toy/crayon/CtrlClick(mob/user)
if(can_change_colour && !isturf(loc) && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
select_colour(user)
else
return ..()
/obj/item/toy/crayon/proc/staticDrawables()
. = list()
@@ -237,14 +248,7 @@
else
paint_mode = PAINT_NORMAL
if("select_colour")
if(can_change_colour)
var/chosen_colour = input(usr,"","Choose Color",paint_color) as color|null
if (!isnull(chosen_colour))
paint_color = chosen_colour
. = TRUE
else
. = FALSE
. = can_change_colour && select_colour(usr)
if("enter_text")
var/txt = stripped_input(usr,"Choose what to write.",
"Scribbles",default = text_buffer)
@@ -254,6 +258,13 @@
drawtype = "a"
update_icon()
/obj/item/toy/crayon/proc/select_colour(mob/user)
var/chosen_colour = input(user, "", "Choose Color", paint_color) as color|null
if (!isnull(chosen_colour) && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
paint_color = chosen_colour
return TRUE
return FALSE
/obj/item/toy/crayon/proc/crayon_text_strip(text)
var/static/regex/crayon_r = new /regex(@"[^\w!?,.=%#&+\/\-]")
return replacetext(lowertext(text), crayon_r, "")
@@ -267,6 +267,7 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \
new/datum/stack_recipe("apiary", /obj/structure/beebox, 40, time = 50),\
null, \
new/datum/stack_recipe("picture frame", /obj/item/wallframe/picture, 1, time = 10),\
new/datum/stack_recipe("painting frame", /obj/item/wallframe/painting, 1, time = 10),\
new/datum/stack_recipe("mortar", /obj/item/reagent_containers/glass/mortar, 3), \
new/datum/stack_recipe("honey frame", /obj/item/honey_frame, 5, time = 10),\
))
@@ -387,6 +388,9 @@ GLOBAL_LIST_INIT(cloth_recipes, list ( \
null, \
new/datum/stack_recipe("blindfold", /obj/item/clothing/glasses/sunglasses/blindfold, 2), \
null, \
new/datum/stack_recipe("19x19 canvas", /obj/item/canvas/nineteenXnineteen, 3), \
new/datum/stack_recipe("23x19 canvas", /obj/item/canvas/twentythreeXnineteen, 4), \
new/datum/stack_recipe("23x23 canvas", /obj/item/canvas/twentythreeXtwentythree, 5), \
))
/obj/item/stack/sheet/cloth
+14
View File
@@ -478,6 +478,20 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
throw_range = 2
attack_verb = list("busted")
/obj/item/statuebust/attack_self(mob/living/user)
add_fingerprint(user)
user.examinate(src)
/obj/item/statuebust/examine(mob/living/user)
. = ..()
if(.)
return
if (!isliving(user))
return
user.visible_message("[user] stops to admire [src].", \
"<span class='notice'>You take in [src], admiring its fine craftsmanship.</span>")
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "artgood", /datum/mood_event/artgood)
/obj/item/tailclub
name = "tail club"
desc = "For the beating to death of lizards with their own tails."