Skip to content

Commit 5cc3bf7

Browse files
committed
Remove old postit cleanables
* Postits with pixel_x/pixel_y map varedits are preserved * Postits with mapvar words automatically apply the correct icon
1 parent 58f9f49 commit 5cc3bf7

4 files changed

Lines changed: 25 additions & 139 deletions

File tree

code/modules/writing/pens_writing_etc.dm

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
- Hand labeler
88
- Clipboard
99
- Booklet
10-
- Sticky notes
1110
- Folder
1211
*/
1312
/* --------------------------------- */
@@ -1392,57 +1391,6 @@
13921391
..()
13931392
return
13941393

1395-
/* =============== STICKY NOTES =============== */
1396-
1397-
/obj/item/postit_stack
1398-
name = "SHOULDN'T BE SEEING THIS"
1399-
desc = "OLD AND BAD"
1400-
icon = 'icons/obj/writing.dmi'
1401-
icon_state = "postit_stack"
1402-
/* force = 1
1403-
throwforce = 1
1404-
w_class = W_CLASS_TINY
1405-
amount = 10
1406-
burn_point = 220
1407-
burn_output = 200
1408-
burn_possible = TRUE
1409-
health = 2
1410-
1411-
// @TODO
1412-
// HOLY SHIT REMOVE THIS THESE OLD POST ITS ARE GONE or something idk fuck
1413-
New()
1414-
..()
1415-
new /obj/item/item_box/postit(get_turf(src))
1416-
1417-
afterattack(var/atom/A as mob|obj|turf, var/mob/user as mob, reach, params)
1418-
if (!A)
1419-
return
1420-
if (isarea(A))
1421-
return
1422-
if (src.amount < 0)
1423-
qdel(src)
1424-
return
1425-
var/turf/T = get_turf(A)
1426-
var/obj/decal/cleanable/writing/postit/P = make_cleanable(/obj/decal/cleanable/writing/postit ,T)
1427-
if (params && islist(params) && params["icon-y"] && params["icon-x"])
1428-
// oh boy i can't wait to see people make huge post-it note trains across the station somehow!
1429-
P.pixel_x = text2num(params["icon-x"]) - 16 //round(A.bound_width/2)
1430-
P.pixel_y = text2num(params["icon-y"]) - 16 //round(A.bound_height/2)
1431-
1432-
P.layer = A.layer + 1 //Do this instead so the stickers don't show over bushes and stuff.
1433-
P.appearance_flags = RESET_COLOR | PIXEL_SCALE
1434-
1435-
user.visible_message("<b>[user]</b> sticks a sticky note to [T].",\
1436-
"You stick a sticky note to [T].")
1437-
var/obj/item/pen/pen = user.find_type_in_hand(/obj/item/pen)
1438-
if (pen)
1439-
P.Attackby(pen, user)
1440-
src.amount --
1441-
if (src.amount < 0)
1442-
qdel(src)
1443-
return
1444-
*/
1445-
14461394
/* ============== PRINTERS & TYPEWRITERS ================= */
14471395

14481396
/obj/item/pen/typewriter

code/obj/decal/cleanable.dm

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -748,80 +748,6 @@ var/list/blood_decal_violent_icon_states = list("floor1", "floor2", "floor3", "f
748748
invisibility = INVIS_INFRA
749749
font_color = "#D20040"
750750

751-
/obj/decal/cleanable/writing/postit
752-
name = "sticky note"
753-
desc = "Someone's stuck a little note here."
754-
icon_state = "postit"
755-
random_icon_states = list()
756-
color = null
757-
words = ""
758-
var/max_message = 128
759-
760-
New()
761-
..()
762-
pixel_y += rand(-12,12)
763-
pixel_x += rand(-12,12)
764-
765-
attackby(obj/item/W, mob/living/user)
766-
if (istype(W, /obj/item/stamp))
767-
768-
var/obj/item/stamp/S = W
769-
switch (S.current_mode)
770-
if ("Granted")
771-
src.icon_state = "postit-approved"
772-
if ("Denied")
773-
src.icon_state = "postit-rejected"
774-
if ("Void")
775-
src.icon_state = "postit-void"
776-
if ("X")
777-
src.icon_state = "postit-x"
778-
else
779-
boutput(user, "It doesn't look like that kind of stamp fits here...")
780-
return
781-
782-
// words here, info there, result is same: SCREEAAAAAAAMMMMMMMMMMMMMMMMMMM
783-
src.words += "<br>\[[S.current_mode]\]<br>"
784-
boutput(user, SPAN_NOTICE("You stamp \the [src]."))
785-
786-
787-
else if (istype(W, /obj/item/pen))
788-
if(!user.literate)
789-
boutput(user, SPAN_ALERT("You don't know how to write."))
790-
return ..()
791-
var/obj/item/pen/pen = W
792-
pen.in_use = 1
793-
var/t = input(user, "What do you want to write?", null, null) as null|text
794-
if (!t)
795-
pen.in_use = 0
796-
return
797-
if ((length(src.words) + length(t)) > src.max_message)
798-
user.show_text("All that won't fit on [src]!", "red")
799-
pen.in_use = 0
800-
return
801-
logTheThing(LOG_STATION, user, "writes on [src] with [pen] at [log_loc(src)]: [t]")
802-
t = copytext(html_encode(t), 1, MAX_MESSAGE_LEN)
803-
if (pen.uses_handwriting && user?.mind?.handwriting)
804-
src.font = user.mind.handwriting
805-
src.webfont = 1
806-
else if (pen.font)
807-
src.font = pen.font
808-
if (pen.webfont)
809-
src.webfont = 1
810-
if (src.words)
811-
src.words += "<br>"
812-
if (src.icon_state == initial(src.icon_state))
813-
var/search_t = lowertext(t)
814-
if (copytext(search_t, -1) == "?")
815-
src.icon_state = "postit-quest"
816-
else if (copytext(search_t, -1) == "!")
817-
src.icon_state = "postit-excl"
818-
else
819-
src.icon_state = "postit-writing"
820-
src.words += "[t]"
821-
pen.in_use = 0
822-
else
823-
return ..()
824-
825751
/obj/decal/cleanable/water
826752
name = "water"
827753
desc = "Water, on the floor. Amazing!"

code/obj/item/stickers.dm

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@
2828
..()
2929
if (islist(src.random_icons) && length(src.random_icons))
3030
src.icon_state = pick(src.random_icons)
31-
pixel_y = rand(-8, 8)
32-
pixel_x = rand(-8, 8)
31+
if (pixel_y == 0)
32+
pixel_y = rand(-8, 8)
33+
if (pixel_x == 9)
34+
pixel_x = rand(-8, 8)
3335

3436
afterattack(var/atom/A as mob|obj|turf, var/mob/user as mob, reach, params)
3537
if (!A)
@@ -136,6 +138,10 @@
136138
get_desc()
137139
. = "<br>[SPAN_NOTICE("It says:")]<br><blockquote style='margin: 0 0 0 1em;'>[words]</blockquote>"
138140

141+
New()
142+
. = ..()
143+
src.set_writing_icon(src.words)
144+
139145
attack_hand(mob/user)
140146
user.lastattacked = get_weakref(user)
141147
if (src.attached)
@@ -190,14 +196,7 @@
190196
return
191197
logTheThing(LOG_STATION, user, "writes on [src] with [pen] at [log_loc(src)]: [t]")
192198
t = copytext(html_encode(t), 1, MAX_MESSAGE_LEN)
193-
if (src.icon_state == initial(src.icon_state))
194-
var/search_t = lowertext(t)
195-
if (copytext(search_t, -1) == "?")
196-
src.icon_state = "postit-quest"
197-
else if (copytext(search_t, -1) == "!")
198-
src.icon_state = "postit-excl"
199-
else
200-
src.icon_state = "postit-writing"
199+
src.set_writing_icon(t)
201200
src.words += "[src.words ? "<br>" : ""][t]"
202201
tooltip_rebuild = TRUE
203202
pen.in_use = 0
@@ -261,6 +260,18 @@
261260
if(src.attached && src.loc != src.attached)
262261
remove_from_attached(do_loc = FALSE)
263262

263+
proc/set_writing_icon(text)
264+
if (src.icon_state != initial(src.icon_state))
265+
return
266+
if (length(text) < 1)
267+
return
268+
var/search_t = lowertext(text)
269+
if (copytext(search_t, -1) == "?")
270+
src.icon_state = "postit-quest"
271+
else if (copytext(search_t, -1) == "!")
272+
src.icon_state = "postit-excl"
273+
else
274+
src.icon_state = "postit-writing"
264275

265276
/obj/item/sticker/gold_star
266277
name = "gold star sticker"

maps/z2.dmm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74747,9 +74747,10 @@
7474774747
"txa" = (
7474874748
/obj/table/auto,
7474974749
/obj/random_item_spawner/tools,
74750-
/obj/decal/cleanable/writing/postit{
74751-
desc = "TODO: Fix leaky sink in command section.";
74752-
pixel_y = 26
74750+
/obj/item/sticker/postit{
74751+
words = "TODO: Fix leaky sink in command section.";
74752+
pixel_y = 26;
74753+
icon_state = "postit-writing"
7475374754
},
7475474755
/turf/unsimulated/floor/plating,
7475574756
/area/hospital/underground)

0 commit comments

Comments
 (0)