mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 06:57:42 +01:00
Uplink's exploitable info now has pictures + NT Relation (#28662)
* uplink buff * rebuild * deconflict
This commit is contained in:
@@ -185,6 +185,7 @@ GLOBAL_VAR_INIT(record_id_num, 1001)
|
||||
G.fields["notes"] = H.gen_record
|
||||
else
|
||||
G.fields["notes"] = "No notes found."
|
||||
G.fields["nt_relation"] = H?.client?.prefs?.active_character?.nanotrasen_relation || "Unknown relation."
|
||||
general += G
|
||||
|
||||
//Medical Record
|
||||
|
||||
@@ -203,6 +203,7 @@
|
||||
G.fields["m_stat"] = "Stable"
|
||||
G.fields["species"] = "Human"
|
||||
G.fields["notes"] = "No notes."
|
||||
G.fields["nt_relation"] = "Unknown relation."
|
||||
GLOB.data_core.general += G
|
||||
record_general = G
|
||||
record_security = null
|
||||
|
||||
@@ -29,6 +29,8 @@ GLOBAL_LIST_EMPTY(world_uplinks)
|
||||
/// Whether or not the uplink has generated its stock and discounts
|
||||
var/items_generated = FALSE
|
||||
|
||||
var/datum/data/record/selected_record
|
||||
|
||||
/obj/item/uplink/ui_host()
|
||||
return loc
|
||||
|
||||
@@ -225,6 +227,18 @@ GLOBAL_LIST_EMPTY(world_uplinks)
|
||||
data["cart"] = generate_tgui_cart()
|
||||
data["cart_price"] = calculate_cart_tc()
|
||||
data["lucky_numbers"] = lucky_numbers
|
||||
if(selected_record && GLOB.data_core.general.Find(selected_record))
|
||||
data["selected_record"] = list(
|
||||
"name" = html_encode(selected_record.fields["name"]),
|
||||
"sex" = html_encode(selected_record.fields["sex"]),
|
||||
"age" = html_encode(selected_record.fields["age"]),
|
||||
"species" = html_encode(selected_record.fields["species"]),
|
||||
"rank" = html_encode(selected_record.fields["rank"]),
|
||||
"nt_relation" = html_encode(selected_record.fields["nt_relation"]),
|
||||
"fingerprint" = html_encode(selected_record.fields["fingerprint"]),
|
||||
"has_photos" = (selected_record.fields["photo-south"] || selected_record.fields["photo-west"]) ? TRUE : FALSE,
|
||||
"photos" = list(selected_record.fields["photo-south"], selected_record.fields["photo-west"])
|
||||
)
|
||||
|
||||
return data
|
||||
|
||||
@@ -241,13 +255,11 @@ GLOBAL_LIST_EMPTY(world_uplinks)
|
||||
// Exploitable info
|
||||
var/list/exploitable = list()
|
||||
for(var/datum/data/record/L in GLOB.data_core.general)
|
||||
if(isnull(selected_record))
|
||||
selected_record = L
|
||||
exploitable += list(list(
|
||||
"name" = html_encode(L.fields["name"]),
|
||||
"sex" = html_encode(L.fields["sex"]),
|
||||
"age" = html_encode(L.fields["age"]),
|
||||
"species" = html_encode(L.fields["species"]),
|
||||
"rank" = html_encode(L.fields["rank"]),
|
||||
"fingerprint" = html_encode(L.fields["fingerprint"])
|
||||
"uid_gen" = L.UID(),
|
||||
))
|
||||
|
||||
data["exploitable"] = exploitable
|
||||
@@ -380,6 +392,12 @@ GLOBAL_LIST_EMPTY(world_uplinks)
|
||||
// lets see paul allen's random uplink item
|
||||
shuffle_lucky_numbers()
|
||||
|
||||
if("view_record") // View Record
|
||||
var/datum/data/record/G = locateUID(params["uid_gen"])
|
||||
if(!istype(G))
|
||||
return
|
||||
selected_record = G
|
||||
|
||||
/obj/item/uplink/hidden/proc/shuffle_lucky_numbers()
|
||||
lucky_numbers = list()
|
||||
for(var/i in 1 to 4)
|
||||
|
||||
@@ -353,9 +353,8 @@ const CartButtons = (props, context) => {
|
||||
|
||||
const ExploitableInfoPage = (_properties, context) => {
|
||||
const { act, data } = useBackend(context);
|
||||
const { exploitable } = data;
|
||||
const { exploitable, selected_record } = data;
|
||||
// Default to first
|
||||
const [selectedRecord, setSelectedRecord] = useLocalState(context, 'selectedRecord', exploitable[0]);
|
||||
|
||||
const [searchText, setSearchText] = useLocalState(context, 'searchText', '');
|
||||
|
||||
@@ -373,7 +372,6 @@ const ExploitableInfoPage = (_properties, context) => {
|
||||
};
|
||||
|
||||
const crew = SelectMembers(exploitable, searchText);
|
||||
|
||||
return (
|
||||
<Stack fill>
|
||||
<Stack.Item width="30%">
|
||||
@@ -381,7 +379,11 @@ const ExploitableInfoPage = (_properties, context) => {
|
||||
<Input fluid mb={1} placeholder="Search Crew" onInput={(e, value) => setSearchText(value)} />
|
||||
<Tabs vertical>
|
||||
{crew.map((r) => (
|
||||
<Tabs.Tab key={r} selected={r === selectedRecord} onClick={() => setSelectedRecord(r)}>
|
||||
<Tabs.Tab
|
||||
key={r}
|
||||
selected={r.name === selected_record.name}
|
||||
onClick={() => act('view_record', { uid_gen: r.uid_gen })}
|
||||
>
|
||||
{r.name}
|
||||
</Tabs.Tab>
|
||||
))}
|
||||
@@ -389,14 +391,36 @@ const ExploitableInfoPage = (_properties, context) => {
|
||||
</Section>
|
||||
</Stack.Item>
|
||||
<Stack.Item grow>
|
||||
<Section fill scrollable title={selectedRecord.name}>
|
||||
<LabeledList>
|
||||
<LabeledList.Item label="Age">{selectedRecord.age}</LabeledList.Item>
|
||||
<LabeledList.Item label="Fingerprint">{selectedRecord.fingerprint}</LabeledList.Item>
|
||||
<LabeledList.Item label="Rank">{selectedRecord.rank}</LabeledList.Item>
|
||||
<LabeledList.Item label="Sex">{selectedRecord.sex}</LabeledList.Item>
|
||||
<LabeledList.Item label="Species">{selectedRecord.species}</LabeledList.Item>
|
||||
</LabeledList>
|
||||
<Section fill scrollable title={selected_record.name}>
|
||||
<Stack>
|
||||
<Stack.Item>
|
||||
<LabeledList>
|
||||
<LabeledList.Item label="Age">{selected_record.age}</LabeledList.Item>
|
||||
<LabeledList.Item label="Fingerprint">{selected_record.fingerprint}</LabeledList.Item>
|
||||
<LabeledList.Item label="Rank">{selected_record.rank}</LabeledList.Item>
|
||||
<LabeledList.Item label="Sex">{selected_record.sex}</LabeledList.Item>
|
||||
<LabeledList.Item label="Species">{selected_record.species}</LabeledList.Item>
|
||||
<LabeledList.Item label="NT Relation">{selected_record.nt_relation}</LabeledList.Item>
|
||||
</LabeledList>
|
||||
</Stack.Item>
|
||||
{!!selected_record.has_photos &&
|
||||
selected_record.photos.map((p, i) => (
|
||||
<Stack.Item key={i} inline textAlign="center" color="label" ml={0}>
|
||||
<img
|
||||
src={p}
|
||||
style={{
|
||||
width: '96px',
|
||||
'margin-top': '1rem',
|
||||
'margin-bottom': '0.5rem',
|
||||
'-ms-interpolation-mode': 'nearest-neighbor', // TODO: Remove with 516
|
||||
'image-rendering': 'pixelated',
|
||||
}}
|
||||
/>
|
||||
<br />
|
||||
Photo #{i + 1}
|
||||
</Stack.Item>
|
||||
))}
|
||||
</Stack>
|
||||
</Section>
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
|
||||
+77
-77
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user