Ports TG painting code (Needs VV rework by kevinz)

This commit is contained in:
Ghom
2020-05-21 03:45:36 +02:00
committed by Archie
parent c60866c101
commit 8e982a32c4
18 changed files with 1344 additions and 799 deletions
+19 -8
View File
@@ -89,6 +89,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
@@ -158,6 +163,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()
@@ -235,14 +246,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)
@@ -252,6 +256,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, "")
@@ -232,6 +232,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("honey frame", /obj/item/honey_frame, 5, time = 10),\
new/datum/stack_recipe("cross", /obj/structure/kitchenspike/cross, 10, time = 10),\
))
@@ -342,6 +343,10 @@ GLOBAL_LIST_INIT(cloth_recipes, list ( \
null, \
new/datum/stack_recipe("blindfold", /obj/item/clothing/glasses/sunglasses/blindfold, 2), \
new/datum/stack_recipe("eyepatch", /obj/item/clothing/glasses/eyepatch, 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
@@ -900,4 +905,4 @@ GLOBAL_LIST_INIT(plaswood_recipes, list ( \
return ..()
/obj/item/stack/sheet/mineral/plaswood/fifty
amount = 50
amount = 50
File diff suppressed because it is too large Load Diff