diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index e8d0b881ccb..4076a8e891e 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -1232,22 +1232,6 @@ log_admin("[key_name(usr)] has removed the organ [rem_organ] from [key_name(M)]") qdel(rem_organ) - else if(href_list["fix_nano"]) - if(!check_rights(R_DEBUG)) return - - var/mob/H = locateUID(href_list["fix_nano"]) - - if(!istype(H) || !H.client) - to_chat(usr, "This can only be done on mobs with clients") - return - - H.client.reload_nanoui_resources() - - to_chat(usr, "Resource files sent") - to_chat(H, "Your NanoUI Resource files have been refreshed") - - log_admin("[key_name(usr)] resent the NanoUI resource files to [key_name(H)]") - else if(href_list["regenerateicons"]) if(!check_rights(0)) return diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 329efb8e067..f2e0171317e 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -816,21 +816,6 @@ GLOBAL_PROTECT(AdminProcCaller) else alert("Invalid mob") -/client/proc/reload_nanoui_resources() - set category = "Debug" - set name = "Reload NanoUI Resources" - set desc = "Force the client to redownload NanoUI Resources" - - // Close open NanoUIs. - SSnanoui.close_user_uis(usr) - - // Re-load the assets. - var/datum/asset/assets = get_asset_datum(/datum/asset/nanoui) - assets.register() - - // Clear the user's cache so they get resent. - usr.client.cache = list() - /client/proc/view_runtimes() set category = "Debug" set name = "View Runtimes" diff --git a/code/modules/admin/verbs/toggledebugverbs.dm b/code/modules/admin/verbs/toggledebugverbs.dm index 216f5c3e4b0..328b5176e9a 100644 --- a/code/modules/admin/verbs/toggledebugverbs.dm +++ b/code/modules/admin/verbs/toggledebugverbs.dm @@ -18,7 +18,6 @@ GLOBAL_LIST_INIT(admin_verbs_show_debug_verbs, list( /client/proc/print_jobban_old_filter, /client/proc/forceEvent, /client/proc/nanomapgen_DumpImage, - /client/proc/reload_nanoui_resources, /client/proc/admin_redo_space_transitions, /client/proc/make_turf_space_map, /client/proc/vv_by_ref diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm index 3cd6458afdf..5cd4bf25f8a 100644 --- a/code/modules/client/client defines.dm +++ b/code/modules/client/client defines.dm @@ -92,3 +92,6 @@ var/next_keysend_reset = 0 var/next_keysend_trip_reset = 0 var/keysend_tripped = FALSE + + // Last world.time that the player tried to request their resources. + var/last_ui_resource_send = 0 diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 561b0b48149..8a119bb97ce 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -906,3 +906,33 @@ return TRUE #undef SSD_WARNING_TIMER + +/client/verb/resend_ui_resources() + set name = "Reload UI Resources" + set desc = "Reload your UI assets if they are not working" + set category = "Special Verbs" + + var/choice = alert(usr, "This will reload your NanoUI and TGUI resources. If you have any open UIs this may break them. Are you sure?", "Resource Reloading", "Yes", "No") + if(choice == "Yes") + // 600 deciseconds = 1 minute + if((last_ui_resource_send) < world.time) + last_ui_resource_send = world.time + 600 + + // Close their open UIs + SSnanoui.close_user_uis(usr) + SStgui.close_user_uis(usr) + + // Resend the resources + var/datum/asset/nano_assets = get_asset_datum(/datum/asset/nanoui) + nano_assets.register() + + var/datum/asset/tgui_assets = get_asset_datum(/datum/asset/simple/tgui) + tgui_assets.register() + + // Clear the user's cache so they get resent. + // This is not fully clearing their BYOND cache, just their assets sent from the server this round + cache = list() + + to_chat(usr, "UI resource files resent successfully") + else + to_chat(usr, "You requested your UI resource files too quickly. Please try again in [(last_ui_resource_send - world.time)/10] seconds.") diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index d6a86d3e3cd..d060c70e8d8 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1297,8 +1297,6 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ .["Add Organ"] = "?_src_=vars;addorgan=[UID()]" .["Remove Organ"] = "?_src_=vars;remorgan=[UID()]" - .["Fix NanoUI"] = "?_src_=vars;fix_nano=[UID()]" - .["Add Verb"] = "?_src_=vars;addverb=[UID()]" .["Remove Verb"] = "?_src_=vars;remverb=[UID()]"