mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 05:30:05 +01:00
[MIRROR] AIs can now select portraits as their display (#1739)
* AIs can now select portraits as their display * a * Update tgui.bundle.js Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com> Co-authored-by: Azarak <azarak10@gmail.com>
This commit is contained in:
co-authored by
tralezab
Azarak
parent
a59333db3c
commit
90373657be
@@ -47,7 +47,7 @@
|
||||
var/list/grid
|
||||
var/canvas_color = "#ffffff" //empty canvas color
|
||||
var/used = FALSE
|
||||
var/painting_name //Painting name, this is set after framing.
|
||||
var/painting_name = "Untitled Artwork" //Painting name, this is set after framing.
|
||||
var/finalized = FALSE //Blocks edits
|
||||
var/author_ckey
|
||||
var/icon_generated = FALSE
|
||||
@@ -185,7 +185,7 @@
|
||||
|
||||
/obj/item/canvas/proc/try_rename(mob/user)
|
||||
var/new_name = stripped_input(user,"What do you want to name the painting?")
|
||||
if(!painting_name && new_name && user.canUseTopic(src,BE_CLOSE))
|
||||
if(painting_name != initial(painting_name) && new_name && user.canUseTopic(src,BE_CLOSE))
|
||||
painting_name = new_name
|
||||
SStgui.update_uis(src)
|
||||
|
||||
@@ -216,6 +216,17 @@
|
||||
framed_offset_x = 5
|
||||
framed_offset_y = 6
|
||||
|
||||
/obj/item/canvas/twentyfour_twentyfour
|
||||
name = "ai universal standard canvas"
|
||||
desc = "Besides being very large, the AI can accept these as a display from their internal database after you've hung it up."
|
||||
icon_state = "24x24"
|
||||
width = 24
|
||||
height = 24
|
||||
pixel_x = 2
|
||||
pixel_y = 1
|
||||
framed_offset_x = 4
|
||||
framed_offset_y = 5
|
||||
|
||||
/obj/item/wallframe/painting
|
||||
name = "painting frame"
|
||||
desc = "The perfect showcase for your favorite deathtrap memories."
|
||||
@@ -252,7 +263,7 @@
|
||||
/obj/structure/sign/painting/attackby(obj/item/I, mob/user, params)
|
||||
if(!C && istype(I, /obj/item/canvas))
|
||||
frame_canvas(user,I)
|
||||
else if(C && !C.painting_name && istype(I,/obj/item/pen))
|
||||
else if(C && C.painting_name == initial(C.painting_name) && istype(I,/obj/item/pen))
|
||||
try_rename(user)
|
||||
else
|
||||
return ..()
|
||||
@@ -280,7 +291,7 @@
|
||||
update_icon()
|
||||
|
||||
/obj/structure/sign/painting/proc/try_rename(mob/user)
|
||||
if(!C.painting_name)
|
||||
if(C.painting_name == initial(C.painting_name))
|
||||
C.try_rename(user)
|
||||
|
||||
/obj/structure/sign/painting/update_icon_state()
|
||||
@@ -312,6 +323,8 @@
|
||||
var/title = chosen["title"]
|
||||
var/author = chosen["ckey"]
|
||||
var/png = "data/paintings/[persistence_id]/[chosen["md5"]].png"
|
||||
if(!title)
|
||||
message_admins("<span class='notice'>Painting with NO TITLE loaded on a [persistence_id] frame in [get_area(src)]. Please delete it, it is saved in the database with no name and will create bad assets.</span>")
|
||||
if(!fexists(png))
|
||||
stack_trace("Persistent painting [chosen["md5"]].png was not found in [persistence_id] directory.")
|
||||
return
|
||||
@@ -339,6 +352,8 @@
|
||||
if(sanitize_filename(persistence_id) != persistence_id)
|
||||
stack_trace("Invalid persistence_id - [persistence_id]")
|
||||
return
|
||||
if(!C.painting_name)
|
||||
return
|
||||
var/data = C.get_data_string()
|
||||
var/md5 = md5(lowertext(data))
|
||||
var/list/current = SSpersistence.paintings[persistence_id]
|
||||
|
||||
Reference in New Issue
Block a user