Return maximize research levels button for admins (#28076)

* add button

* oops

* prettier

* change icon

* rebuild tgui
This commit is contained in:
Mira
2025-01-26 13:54:35 +00:00
committed by GitHub
parent 21ec00fb63
commit a79dd4012e
3 changed files with 31 additions and 1 deletions
+22
View File
@@ -495,6 +495,19 @@ won't update every console in existence) but it's more of a hassle to do. Also,
return TRUE
if("maxresearch")
if(!check_rights(R_ADMIN))
return
if(!network_manager_uid)
return
var/choice = tgui_alert(ui.user, "Are you sure you want to maximize research levels?", "Confirmation", list("Yes", "No"))
if(choice == "Yes")
log_admin("[key_name(ui.user)] has maximized the research levels at network [network_manager_uid].")
message_admins("[key_name_admin(ui.user)] has maximized the research levels at network [network_manager_uid].")
maximize()
return TRUE
// You should only be able to link if its not linked, to prevent weirdness
if("linktonetworkcontroller")
if(network_manager_uid)
@@ -745,6 +758,14 @@ won't update every console in existence) but it's more of a hassle to do. Also,
network_manager_uid = null
SStgui.update_uis(src)
/obj/machinery/computer/rdconsole/proc/maximize()
var/datum/research/files = get_files()
if(!files)
return
for(var/T in files.known_tech)
files.UpdateTech(T, 8)
SStgui.update_uis(src)
/obj/machinery/computer/rdconsole/attack_hand(mob/user)
if(..())
return 1
@@ -873,6 +894,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
data["linked"] = TRUE
files.RefreshResearch()
data["admin"] = check_rights(R_ADMIN, FALSE, user)
data["menu"] = menu
data["submenu_protolathe"] = submenu_protolathe
data["submenu_imprinter"] = submenu_imprinter
@@ -23,6 +23,14 @@ const MainSettings = (props, context) => {
act('unlink');
}}
/>
{admin === 1 ? (
<Button
icon="gears"
color="red"
content="[ADMIN] Maximize research levels"
onClick={() => act('maxresearch')}
/>
) : null}
</Flex>
</Section>
);
File diff suppressed because one or more lines are too long