mirror of
https://github.com/Yawn-Wider/YWPolarisVore.git
synced 2026-08-23 21:17:20 +01:00
Convert robot icons to iconforge, update iconforge to not break on them (#16793)
This commit is contained in:
@@ -45,13 +45,13 @@
|
||||
|
||||
/datum/eventkit/modify_robot/ui_assets(mob/user)
|
||||
return list(
|
||||
get_asset_datum(/datum/asset/spritesheet/robot_icons)
|
||||
get_asset_datum(/datum/asset/spritesheet_batched/robot_icons)
|
||||
)
|
||||
|
||||
/datum/eventkit/modify_robot/tgui_data(mob/user)
|
||||
. = list()
|
||||
// Target section for general data
|
||||
var/datum/asset/spritesheet/robot_icons/spritesheet = get_asset_datum(/datum/asset/spritesheet/robot_icons)
|
||||
var/datum/asset/spritesheet_batched/robot_icons/spritesheet = get_asset_datum(/datum/asset/spritesheet_batched/robot_icons)
|
||||
|
||||
if(target)
|
||||
.["target"] = list()
|
||||
@@ -589,7 +589,7 @@
|
||||
target_items += list(list("name" = item.name, "ref" = "\ref[item]", "icon" = icon2html(item, user, sourceonly=TRUE), "desc" = item.desc))
|
||||
return target_items
|
||||
|
||||
/datum/eventkit/modify_robot/proc/get_module_source(var/mob/user, var/datum/asset/spritesheet/robot_icons/spritesheet)
|
||||
/datum/eventkit/modify_robot/proc/get_module_source(var/mob/user, var/datum/asset/spritesheet_batched/robot_icons/spritesheet)
|
||||
var/list/source_list = list()
|
||||
source_list["model"] = source.module
|
||||
source_list["sprite"] = sanitize_css_class_name("[source.sprite_datum.type]")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/datum/asset/spritesheet/chat
|
||||
/datum/asset/spritesheet_batched/chat
|
||||
name = "chat"
|
||||
|
||||
/datum/asset/spritesheet/chat/create_spritesheets()
|
||||
InsertAll("", text_tag_icons) // OOC, LOOC ect icons
|
||||
/datum/asset/spritesheet_batched/chat/create_spritesheets()
|
||||
insert_all_icons("", text_tag_icons, prefix_with_dirs = FALSE) // OOC, LOOC ect icons
|
||||
|
||||
@@ -1,36 +1,52 @@
|
||||
/datum/asset/spritesheet/robot_icons
|
||||
/datum/asset/spritesheet_batched/robot_icons
|
||||
name = "robot_icons"
|
||||
|
||||
/datum/asset/spritesheet/robot_icons/create_spritesheets()
|
||||
/datum/asset/spritesheet_batched/robot_icons/create_spritesheets()
|
||||
for(var/datum/robot_sprite/S as anything in typesof(/datum/robot_sprite))
|
||||
if(!S.name || !S.sprite_icon_state) // snowflake out those customs... they suck
|
||||
continue
|
||||
var/icon/I_N = icon(S.sprite_icon, S.sprite_icon_state, NORTH)
|
||||
var/icon/I_S = icon(S.sprite_icon, S.sprite_icon_state, SOUTH)
|
||||
var/icon/I_W = icon(S.sprite_icon, S.sprite_icon_state, WEST)
|
||||
var/icon/I_E = icon(S.sprite_icon, S.sprite_icon_state, EAST)
|
||||
|
||||
var/datum/universal_icon/I_N = uni_icon(S.sprite_icon, S.sprite_icon_state, NORTH)
|
||||
var/datum/universal_icon/I_S = uni_icon(S.sprite_icon, S.sprite_icon_state, SOUTH)
|
||||
var/datum/universal_icon/I_W = uni_icon(S.sprite_icon, S.sprite_icon_state, WEST)
|
||||
var/datum/universal_icon/I_E = uni_icon(S.sprite_icon, S.sprite_icon_state, EAST)
|
||||
|
||||
if(S.has_eye_sprites)
|
||||
var/icon/I_NE = icon(S.sprite_icon, "[S.sprite_icon_state]-eyes", NORTH)
|
||||
var/datum/universal_icon/I_NE = uni_icon(S.sprite_icon, "[S.sprite_icon_state]-eyes", NORTH)
|
||||
if(I_NE)
|
||||
I_N.Blend(I_NE, ICON_OVERLAY)
|
||||
I_N.blend_icon(I_NE, ICON_OVERLAY)
|
||||
if(S.has_eye_sprites)
|
||||
var/icon/I_SE = icon(S.sprite_icon, "[S.sprite_icon_state]-eyes", SOUTH)
|
||||
var/datum/universal_icon/I_SE = uni_icon(S.sprite_icon, "[S.sprite_icon_state]-eyes", SOUTH)
|
||||
if(I_SE)
|
||||
I_S.Blend(I_SE, ICON_OVERLAY)
|
||||
I_S.blend_icon(I_SE, ICON_OVERLAY)
|
||||
if(S.has_eye_sprites)
|
||||
var/icon/I_WE = icon(S.sprite_icon, "[S.sprite_icon_state]-eyes", WEST)
|
||||
var/datum/universal_icon/I_WE = uni_icon(S.sprite_icon, "[S.sprite_icon_state]-eyes", WEST)
|
||||
if(I_WE)
|
||||
I_W.Blend(I_WE, ICON_OVERLAY)
|
||||
I_W.blend_icon(I_WE, ICON_OVERLAY)
|
||||
if(S.has_eye_sprites)
|
||||
var/icon/I_EE = icon(S.sprite_icon, "[S.sprite_icon_state]-eyes", EAST)
|
||||
var/datum/universal_icon/I_EE = uni_icon(S.sprite_icon, "[S.sprite_icon_state]-eyes", EAST)
|
||||
if(I_EE)
|
||||
I_E.Blend(I_EE, ICON_OVERLAY)
|
||||
I_E.blend_icon(I_EE, ICON_OVERLAY)
|
||||
|
||||
var/imgid = sanitize_css_class_name("[S.type]")
|
||||
I_N.Scale(120, 120)
|
||||
I_S.Scale(120, 120)
|
||||
I_W.Scale(120, 120)
|
||||
I_E.Scale(120, 120)
|
||||
Insert(imgid + "N", I_N)
|
||||
Insert(imgid + "S", I_S)
|
||||
Insert(imgid + "W", I_W)
|
||||
Insert(imgid + "E", I_E)
|
||||
if(S.icon_x > S.icon_y)
|
||||
var/buffer = (S.icon_x - S.icon_y) / 2
|
||||
I_N.crop(0, -buffer, S.icon_x, S.icon_y + buffer)
|
||||
I_S.crop(0, -buffer, S.icon_x, S.icon_y + buffer)
|
||||
I_W.crop(0, -buffer, S.icon_x, S.icon_y + buffer)
|
||||
I_E.crop(0, -buffer, S.icon_x, S.icon_y + buffer)
|
||||
else if (S.icon_x < S.icon_y)
|
||||
var/buffer = (S.icon_y - S.icon_x) / 2
|
||||
I_N.crop(-buffer, 0, S.icon_x + buffer, S.icon_y)
|
||||
I_S.crop(-buffer, 0, S.icon_x + buffer, S.icon_y)
|
||||
I_W.crop(-buffer, 0, S.icon_x + buffer, S.icon_y)
|
||||
I_E.crop(-buffer, 0, S.icon_x + buffer, S.icon_y)
|
||||
I_N.scale(120, 120)
|
||||
I_S.scale(120, 120)
|
||||
I_W.scale(120, 120)
|
||||
I_E.scale(120, 120)
|
||||
|
||||
insert_icon(imgid + "N", I_N)
|
||||
insert_icon(imgid + "S", I_S)
|
||||
insert_icon(imgid + "W", I_W)
|
||||
insert_icon(imgid + "E", I_E)
|
||||
|
||||
@@ -180,6 +180,10 @@
|
||||
// Remove the cache, since it's invalid if we get to this point.
|
||||
fdel("[ASSET_CROSS_ROUND_SMART_CACHE_DIRECTORY]/spritesheet_cache.[name].json")
|
||||
|
||||
if(!fexists(ASSET_CROSS_ROUND_SMART_CACHE_DIRECTORY))
|
||||
rustg_file_write("stub", "[ASSET_CROSS_ROUND_SMART_CACHE_DIRECTORY]/stub.txt")
|
||||
fdel("[ASSET_CROSS_ROUND_SMART_CACHE_DIRECTORY]/stub.txt")
|
||||
|
||||
var/do_cache = CONFIG_GET(flag/smart_cache_assets) || force_cache
|
||||
var/data_out
|
||||
if(yield || !isnull(job_id))
|
||||
|
||||
@@ -354,6 +354,8 @@
|
||||
sprite_datum = module_sprites[1]
|
||||
sprite_datum.do_equipment_glamour(module)
|
||||
return
|
||||
if(mind)
|
||||
sprite_name = mind.name
|
||||
if(!selecting_module)
|
||||
var/datum/tgui_module/robot_ui_module/ui = new(src)
|
||||
ui.tgui_interact(src)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
/datum/tgui_module/robot_ui_module/ui_assets(mob/user)
|
||||
return list(
|
||||
get_asset_datum(/datum/asset/spritesheet/robot_icons)
|
||||
get_asset_datum(/datum/asset/spritesheet_batched/robot_icons)
|
||||
)
|
||||
|
||||
/datum/tgui_module/robot_ui_module/tgui_static_data()
|
||||
@@ -49,6 +49,7 @@
|
||||
if(is_borg_whitelisted(R, module_name))
|
||||
modules |= module_name
|
||||
data["possible_modules"] = modules
|
||||
data["mind_name"] = R.mind.name
|
||||
if(R.emagged)
|
||||
data["theme"] = "syndicate"
|
||||
else if (R.ui_theme)
|
||||
@@ -60,7 +61,7 @@
|
||||
var/list/data = ..()
|
||||
|
||||
var/mob/living/silicon/robot/R = host
|
||||
var/datum/asset/spritesheet/robot_icons/spritesheet = get_asset_datum(/datum/asset/spritesheet/robot_icons)
|
||||
var/datum/asset/spritesheet_batched/robot_icons/spritesheet = get_asset_datum(/datum/asset/spritesheet_batched/robot_icons)
|
||||
|
||||
data["currentName"] = new_name ? new_name : R.name
|
||||
data["isDefaultName"] = !new_name
|
||||
@@ -136,6 +137,7 @@
|
||||
var/name = params["value"]
|
||||
if(name)
|
||||
new_name = sanitizeSafe(name, MAX_NAME_LEN)
|
||||
R.sprite_name = new_name
|
||||
. = TRUE
|
||||
if("confirm")
|
||||
R.apply_name(new_name)
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
var/has_custom_equipment_sprites = FALSE
|
||||
var/vis_height = 32
|
||||
var/pixel_x = 0
|
||||
var/icon_x = 32
|
||||
var/icon_y = 32
|
||||
|
||||
var/is_whitelisted = FALSE
|
||||
var/whitelist_ckey
|
||||
@@ -188,6 +190,8 @@
|
||||
has_dead_sprite_overlay = TRUE
|
||||
has_custom_equipment_sprites = TRUE
|
||||
pixel_x = -16
|
||||
icon_x = 64
|
||||
icon_y = 32
|
||||
|
||||
/datum/robot_sprite/dogborg/do_equipment_glamour(var/obj/item/robot_module/module)
|
||||
if(!has_custom_equipment_sprites)
|
||||
@@ -207,6 +211,8 @@
|
||||
has_dead_sprite_overlay = FALSE
|
||||
has_custom_equipment_sprites = FALSE
|
||||
vis_height = 64
|
||||
icon_x = 64
|
||||
icon_y = 64
|
||||
|
||||
|
||||
// Default module sprite
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
has_dead_sprite = TRUE
|
||||
has_dead_sprite_overlay = TRUE
|
||||
pixel_x = -16
|
||||
icon_x = 64
|
||||
icon_y = 32
|
||||
|
||||
whitelist_ckey = "argonne"
|
||||
whitelist_charname = "RUSS"
|
||||
@@ -80,6 +82,8 @@
|
||||
has_dead_sprite = TRUE
|
||||
has_dead_sprite_overlay = TRUE
|
||||
pixel_x = -16
|
||||
icon_x = 64
|
||||
icon_y = 32
|
||||
|
||||
whitelist_ckey = "jademanique"
|
||||
whitelist_charname = "B.A.U-Kingside"
|
||||
@@ -101,6 +105,8 @@
|
||||
has_dead_sprite = TRUE
|
||||
has_dead_sprite_overlay = TRUE
|
||||
pixel_x = -16
|
||||
icon_x = 64
|
||||
icon_y = 32
|
||||
|
||||
whitelist_ckey = "lunarfleet"
|
||||
whitelist_charname = "Clea-Nor"
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
))
|
||||
window.send_asset(get_asset_datum(/datum/asset/simple/namespaced/fontawesome))
|
||||
window.send_asset(get_asset_datum(/datum/asset/simple/namespaced/tgfont))
|
||||
window.send_asset(get_asset_datum(/datum/asset/spritesheet/chat))
|
||||
window.send_asset(get_asset_datum(/datum/asset/spritesheet_batched/chat))
|
||||
// Other setup
|
||||
request_telemetry()
|
||||
addtimer(CALLBACK(src, PROC_REF(on_initialize_timed_out)), 5 SECONDS)
|
||||
|
||||
Reference in New Issue
Block a user