mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-25 09:31:13 +00:00
Chemistry codex - VueUI edition (#9413)
Mostly contains fuzzy search what should make search experence nice and responsive. Data generation assumes rections do not change.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
/datum/computer_file/program/chemistry_codex
|
||||
filename = "chemcodex"
|
||||
filedesc = "Chemistry codex"
|
||||
program_icon_state = "generic"
|
||||
extended_desc = "Useful program to view chemical reactions and how to make them."
|
||||
size = 14
|
||||
required_access_run = access_medical
|
||||
required_access_download = access_medical
|
||||
available_on_ntnet = TRUE
|
||||
|
||||
/datum/computer_file/program/chemistry_codex/ui_interact(mob/user)
|
||||
var/datum/vueui/ui = SSvueui.get_open_ui(user, src)
|
||||
if (!ui)
|
||||
ui = new /datum/vueui/modularcomputer(user, src, "mcomputer-chemcodex", 450, 600, filedesc)
|
||||
ui.open()
|
||||
|
||||
/datum/computer_file/program/chemistry_codex/vueui_transfer(oldobj)
|
||||
SSvueui.transfer_uis(oldobj, src, "mcomputer-chemcodex", 450, 600, filedesc)
|
||||
return TRUE
|
||||
|
||||
// Gathers data for ui. This is not great vueui example, all data sent from server is static.
|
||||
/datum/computer_file/program/chemistry_codex/vueui_data_change(var/list/data, var/mob/user, var/datum/vueui/ui)
|
||||
. = ..()
|
||||
data = . || data || list()
|
||||
// Gather data for computer header
|
||||
var/headerdata = get_header_data(data["_PC"])
|
||||
if(headerdata)
|
||||
data["_PC"] = headerdata
|
||||
. = data
|
||||
|
||||
// Here goes listification
|
||||
if(data["reactions"] == null)
|
||||
. = data
|
||||
data["reactions"] = SSchemistry.codex_data
|
||||
Reference in New Issue
Block a user