Merge pull request #4681 from Citadel-Station-13/upstream-merge-34034
[MIRROR] Makes crayons draw at the location you click
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
icon = 'icons/effects/crayondecal.dmi'
|
||||
icon_state = "rune1"
|
||||
gender = NEUTER
|
||||
mergeable_decal = FALSE
|
||||
var/do_icon_rotate = TRUE
|
||||
var/rotation = 0
|
||||
var/paint_colour = "#FFFFFF"
|
||||
|
||||
@@ -240,7 +240,7 @@
|
||||
out += a
|
||||
return jointext(out,"")
|
||||
|
||||
/obj/item/toy/crayon/afterattack(atom/target, mob/user, proximity)
|
||||
/obj/item/toy/crayon/afterattack(atom/target, mob/user, proximity, params)
|
||||
if(!proximity || !check_allowed_items(target))
|
||||
return
|
||||
|
||||
@@ -288,6 +288,14 @@
|
||||
else
|
||||
graf_rot = 0
|
||||
|
||||
var/list/click_params = params2list(params)
|
||||
var/clickx
|
||||
var/clicky
|
||||
|
||||
if(click_params && click_params["icon-x"] && click_params["icon-y"])
|
||||
clickx = CLAMP(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
clicky = CLAMP(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
|
||||
if(!instant)
|
||||
to_chat(user, "<span class='notice'>You start drawing a [temp] on the [target.name]...</span>")
|
||||
|
||||
@@ -316,6 +324,8 @@
|
||||
if(PAINT_NORMAL)
|
||||
var/obj/effect/decal/cleanable/crayon/C = new(target, paint_color, drawing, temp, graf_rot)
|
||||
C.add_hiddenprint(user)
|
||||
C.pixel_x = clickx
|
||||
C.pixel_y = clicky
|
||||
affected_turfs += target
|
||||
if(PAINT_LARGE_HORIZONTAL)
|
||||
var/turf/left = locate(target.x-1,target.y,target.z)
|
||||
|
||||
Reference in New Issue
Block a user