mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 12:37:26 +01:00
made the photo window size consistent with the scribble text on different photo sizes. (#31272)
* makes the photo window size consistent with the scribble text and prevent's the scribble from clipping out rendering it not visible and add's a max length of 64 for the scribble to prevent extremely long text from being written. * Update code/modules/paperwork/photography.dm Co-authored-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com> Signed-off-by: Vengie0 <zaydrabah11@gmail.com> --------- Signed-off-by: Vengie0 <zaydrabah11@gmail.com> Co-authored-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>
This commit is contained in:
co-authored by
PollardTheDragon
parent
5c04c359e6
commit
588ad717d3
@@ -32,6 +32,7 @@
|
||||
var/scribble //Scribble on the back.
|
||||
var/icon/tiny
|
||||
var/photo_size = 3
|
||||
var/max_length = 64
|
||||
scatter_distance = 8
|
||||
|
||||
/obj/item/photo/attack_self__legacy__attackchain(mob/user as mob)
|
||||
@@ -42,7 +43,7 @@
|
||||
var/txt = tgui_input_text(user, "What would you like to write on the back?", "Photo Writing")
|
||||
if(!txt)
|
||||
return
|
||||
txt = copytext(txt, 1, 128)
|
||||
txt = copytext(txt, 1, max_length)
|
||||
if(loc == user && user.stat == CONSCIOUS)
|
||||
scribble = txt
|
||||
else if(P.get_heat())
|
||||
@@ -110,7 +111,7 @@
|
||||
+ "<body style='overflow:hidden;margin:0;text-align:center'>" \
|
||||
+ "<img src='tmp_photo.png' width='[64*photo_size]' style='-ms-interpolation-mode:nearest-neighbor' />" \
|
||||
+ "[scribble ? "<br>Written on the back:<br><i>[scribble]</i>" : ""]"\
|
||||
+ "</body></html>", "window=Photo[UID()];size=[64*photo_size]x[scribble ? 400 : 64*photo_size]")
|
||||
+ "</body></html>", "window=Photo[UID()];size=[64 * photo_size]x[max(64 * photo_size, 64 * photo_size + 120)]")
|
||||
onclose(usr, "Photo[UID()]")
|
||||
|
||||
/obj/item/photo/proc/rename(mob/user)
|
||||
|
||||
Reference in New Issue
Block a user