mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 02:24:11 +01:00
Plant DNA Manipulator update (#25370)
* WIP * changes * more changes * chnges * update * changes * I suck at TGUI if you see this please help * UI a bit better still figuring it out * More things * Eject Select, Select empty and autoselect empty implemented. can insert replaace stat/all stats from disk list * Ready to make a PR Disks can be loaded into the machine from boxed, an empty disk is automatically selected once an extraction is performed if one is available. All insert and replace buttons moved to the disk lists. Window size and scaling changed to fit LSD properly without wrapping. * minor ui tweak, fixes core stat disk being auto selected unintentionally. Loading via box now makes a sound. * rebuild TGUI * rebuild tgui * implemented RO button/indicator in UI, Added null checks for can_add * slightly shrink some buttons rebuild TGUI * Rebuild TGUI * use istype for type checks * removes the disk compartmentalizer from maps * removes Disk Compartmentalizer * actually removes the disk compartmentalizer * rebuild tgui and remove all remaining disk compartmentalizer sprites * fixes a message being output to world instead of the user * auto doc and readability improvements. * some fixes adjusts display name to display the new doubled percentages. Stored seed no longer counts as a disk for the purpose of reaching the disk capacity. * Rebuild TGUI
This commit is contained in:
committed by
GitHub
parent
a423a008e8
commit
6db06b1eb8
@@ -379,9 +379,6 @@
|
||||
/area/lavaland/surface/outdoors)
|
||||
"Nt" = (
|
||||
/obj/structure/table/wood,
|
||||
/obj/machinery/smartfridge/disks{
|
||||
pixel_y = 2
|
||||
},
|
||||
/turf/simulated/floor/plasteel/freezer,
|
||||
/area/ruin/powered/seedvault)
|
||||
"OL" = (
|
||||
|
||||
@@ -2889,7 +2889,6 @@
|
||||
/area/ruin/unpowered/syndicate_space_base/atmos)
|
||||
"pF" = (
|
||||
/obj/structure/table,
|
||||
/obj/machinery/smartfridge/disks,
|
||||
/obj/structure/window/reinforced,
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/supply{
|
||||
dir = 4
|
||||
|
||||
@@ -19036,7 +19036,6 @@
|
||||
dir = 1
|
||||
},
|
||||
/obj/structure/table,
|
||||
/obj/machinery/smartfridge/disks,
|
||||
/turf/simulated/floor/plasteel{
|
||||
icon_state = "dark"
|
||||
},
|
||||
|
||||
@@ -72669,9 +72669,6 @@
|
||||
/area/station/science/robotics)
|
||||
"qhu" = (
|
||||
/obj/structure/table,
|
||||
/obj/machinery/smartfridge/disks{
|
||||
pixel_y = 5
|
||||
},
|
||||
/turf/simulated/floor/plasteel{
|
||||
icon_state = "darkgreenfull"
|
||||
},
|
||||
|
||||
@@ -72290,7 +72290,6 @@
|
||||
pixel_y = 28
|
||||
},
|
||||
/obj/effect/turf_decal/delivery/hollow,
|
||||
/obj/machinery/smartfridge/disks,
|
||||
/turf/simulated/floor/plasteel,
|
||||
/area/station/service/hydroponics)
|
||||
"ivD" = (
|
||||
|
||||
@@ -58969,7 +58969,6 @@
|
||||
/area/station/ai_monitored/storage/eva)
|
||||
"jHO" = (
|
||||
/obj/structure/table/glass,
|
||||
/obj/machinery/smartfridge/disks,
|
||||
/obj/machinery/camera{
|
||||
c_tag = "Hydroponics";
|
||||
dir = 6
|
||||
|
||||
@@ -562,7 +562,6 @@ to destroy them and players will be able to make replacements.
|
||||
"Smart Chemical Storage" = /obj/machinery/smartfridge/secure/chemistry,
|
||||
"Smart Virus Storage" = /obj/machinery/smartfridge/secure/chemistry/virology,
|
||||
"Drink Showcase" = /obj/machinery/smartfridge/drinks,
|
||||
"Disk Compartmentalizer" = /obj/machinery/smartfridge/disks,
|
||||
"Identification Card Compartmentalizer" = /obj/machinery/smartfridge/id,
|
||||
"Circuit Board Storage" = /obj/machinery/smartfridge/secure/circuits,
|
||||
"AI Laws Storage" = /obj/machinery/smartfridge/secure/circuits/aiupload)
|
||||
|
||||
@@ -682,39 +682,6 @@
|
||||
/obj/machinery/smartfridge/secure/chemistry/preloaded/syndicate/Initialize(mapload)
|
||||
. = ..()
|
||||
req_access = list(ACCESS_SYNDICATE)
|
||||
|
||||
/**
|
||||
* # Disk Compartmentalizer
|
||||
*
|
||||
* Disk variant of the [Smart Fridge][/obj/machinery/smartfridge].
|
||||
*/
|
||||
/obj/machinery/smartfridge/disks
|
||||
name = "disk compartmentalizer"
|
||||
desc = "A machine capable of storing a variety of disks. Denoted by most as the DSU (disk storage unit)."
|
||||
icon_state = "disktoaster"
|
||||
icon_lightmask = "disktoaster"
|
||||
pass_flags = PASSTABLE
|
||||
visible_contents = TRUE
|
||||
board_type = /obj/machinery/smartfridge/disks
|
||||
|
||||
/obj/machinery/smartfridge/disks/Initialize(mapload)
|
||||
. = ..()
|
||||
accepted_items_typecache = typecacheof(list(
|
||||
/obj/item/disk,
|
||||
))
|
||||
|
||||
/obj/machinery/smartfridge/disks/update_fridge_contents()
|
||||
switch(length(contents))
|
||||
if(0)
|
||||
fill_level = null
|
||||
if(1)
|
||||
fill_level = 1
|
||||
if(2)
|
||||
fill_level = 2
|
||||
if(3)
|
||||
fill_level = 3
|
||||
if(4 to INFINITY)
|
||||
fill_level = 4
|
||||
/obj/machinery/smartfridge/id
|
||||
name = "identification card compartmentalizer"
|
||||
desc = "A machine capable of storing identification cards and PDAs. It's great for lost and terminated cards."
|
||||
|
||||
@@ -6,22 +6,36 @@
|
||||
icon_state = "dnamod"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
|
||||
/// the seed stored in the machine
|
||||
var/obj/item/seeds/seed
|
||||
/// the disk in use
|
||||
var/obj/item/disk/plantgene/disk
|
||||
|
||||
/// list of the seed's trait genes
|
||||
var/list/core_genes = list()
|
||||
/// list of the seed's trait genes
|
||||
var/list/reagent_genes = list()
|
||||
/// list of the seed's trait genes
|
||||
var/list/trait_genes = list()
|
||||
|
||||
/// disk capacity
|
||||
var/disk_capacity = 100
|
||||
/// gene targeted for operation
|
||||
var/datum/plant_gene/target
|
||||
/// maximum potency that can be put on a disk
|
||||
var/max_potency = 50 // See RefreshParts() for how these work
|
||||
/// maximum yield that can be put on a disk
|
||||
var/max_yield = 2
|
||||
/// minimum production that can be put on a disk
|
||||
var/min_production = 12
|
||||
/// maximum endurance that can be put on a disk
|
||||
var/max_endurance = 10 // IMPT: ALSO AFFECTS LIFESPAN
|
||||
/// minimum weed growth chance that can be put on a disk
|
||||
var/min_weed_chance = 67
|
||||
/// minimum weed growth rate that can be put on a disk
|
||||
var/min_weed_rate = 10
|
||||
/// amount of seeds needed to make a core stat disk
|
||||
var/seeds_for_bulk_core = 5
|
||||
/// index of disk in use in the content list
|
||||
var/disk_index = 0
|
||||
|
||||
/obj/machinery/plantgenes/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -130,7 +144,7 @@
|
||||
else if(istype(I, /obj/item/unsorted_seeds))
|
||||
to_chat(user, "<span class='warning'>You need to sort [I] first!</span>")
|
||||
return ..()
|
||||
else if(istype(I, /obj/item/disk/plantgene))
|
||||
else if(istype(I, /obj/item/disk/plantgene) || istype(I, /obj/item/storage/box))
|
||||
add_disk(I, user)
|
||||
else
|
||||
return ..()
|
||||
@@ -146,13 +160,31 @@
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/plantgenes/proc/add_disk(obj/item/disk/plantgene/new_disk, mob/user)
|
||||
if(disk)
|
||||
to_chat(user, "<span class='warning'>A data disk is already loaded into the machine!</span>")
|
||||
if(length(contents) - (seed ? 1 : 0) >= disk_capacity)
|
||||
to_chat(user, "<span class='warning'>[src] cannot hold any more disks!</span>")
|
||||
return
|
||||
if(istype(new_disk, /obj/item/storage/box))
|
||||
var/has_disks = FALSE
|
||||
for(var/obj/item/disk/plantgene/D in new_disk.contents)
|
||||
if(length(contents)- (seed ? 1 : 0) >= disk_capacity)
|
||||
to_chat(user, "<span class='notice'>You fill [src] with disks.</span>")
|
||||
break
|
||||
has_disks = TRUE
|
||||
D.forceMove(src)
|
||||
if(!disk)
|
||||
disk = D
|
||||
if(has_disks)
|
||||
playsound(loc, 'sound/items/handling/cardboardbox_drop.ogg', 50)
|
||||
to_chat(user, "<span class='notice'>You load [src] from [new_disk].</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[new_disk] contains no disks.</span>")
|
||||
SStgui.update_uis(src)
|
||||
return
|
||||
if(!user.drop_item())
|
||||
return
|
||||
disk = new_disk
|
||||
disk.forceMove(src)
|
||||
if(!disk)
|
||||
disk = new_disk
|
||||
new_disk.forceMove(src)
|
||||
to_chat(user, "<span class='notice'>You add [new_disk] to the machine.</span>")
|
||||
ui_interact(user)
|
||||
|
||||
@@ -244,6 +276,40 @@
|
||||
|
||||
data["modal"] = ui_modal_data(src)
|
||||
|
||||
var/list/stats = list()
|
||||
var/list/traits = list()
|
||||
var/list/reagents = list()
|
||||
var/empty_disks = 0
|
||||
|
||||
data["stat_disks"] = list()
|
||||
data["trait_disks"] = list()
|
||||
data["reagent_disks"] = list()
|
||||
|
||||
for(var/i in 1 to length(contents))
|
||||
if(istype(contents[i], /obj/item/disk/plantgene))
|
||||
var/obj/item/disk/plantgene/D = contents[i]
|
||||
if(!D.gene && !D.is_bulk_core)
|
||||
empty_disks++
|
||||
else if(D.is_bulk_core)
|
||||
stats.Add(list(list("display_name" = D.ui_name, "index" = i, "stat" = "All", "ready" = D.seeds_needed <= D.seeds_scanned, "read_only" = D.read_only)))
|
||||
else if(istype(D.gene, /datum/plant_gene/core))
|
||||
var/datum/plant_gene/core/C = D.gene
|
||||
stats.Add(list(list("display_name" = C.name +" "+ num2text(C.value), "index" = i, "stat" = C.name, "read_only" = D.read_only)))
|
||||
else if(istype(D.gene, /datum/plant_gene/trait))
|
||||
var/insertable = D.gene?.can_add(seed)
|
||||
traits.Add(list(list("display_name" = D.gene.name, "index" = i, "can_insert" = insertable, "read_only" = D.read_only)))
|
||||
else if(istype(D.gene, /datum/plant_gene/reagent))
|
||||
var/datum/plant_gene/reagent/R = D.gene
|
||||
var/insertable = R?.can_add(seed)
|
||||
reagents.Add(list(list("display_name" = "[R.name] [num2text(R.rate*200)]%", "index" = i, "can_insert" = insertable, "read_only" = D.read_only)))
|
||||
if(length(stats))
|
||||
data["stat_disks"] = stats
|
||||
if(length(traits))
|
||||
data["trait_disks"] = traits
|
||||
if(length(reagents))
|
||||
data["reagent_disks"] = reagents
|
||||
data["empty_disks"] = empty_disks
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/plantgenes/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
@@ -258,7 +324,12 @@
|
||||
|
||||
var/mob/user = ui.user
|
||||
|
||||
target = seed?.get_gene(params["id"])
|
||||
if(params["id"])
|
||||
target = seed?.get_gene(params["id"])
|
||||
else if(params["stat"] && params["stat"] != "All")
|
||||
for(var/datum/plant_gene/core/c_gene in core_genes)
|
||||
if(c_gene.name == params["stat"])
|
||||
target = c_gene
|
||||
|
||||
switch(action)
|
||||
if("eject_seed")
|
||||
@@ -274,9 +345,10 @@
|
||||
add_seed(I, user)
|
||||
|
||||
if("eject_disk")
|
||||
if(disk)
|
||||
disk.forceMove(loc)
|
||||
user.put_in_hands(disk)
|
||||
var/obj/item/disk/plantgene/D = contents[text2num(params["index"])]
|
||||
if(D)
|
||||
D.forceMove(loc)
|
||||
user.put_in_hands(D)
|
||||
disk = null
|
||||
update_genes()
|
||||
else
|
||||
@@ -312,23 +384,46 @@
|
||||
ui_modal_boolean(src, action, dat, yes_text = "Extract", no_text = "Cancel", delegate = PROC_REF(gene_extract))
|
||||
|
||||
if("bulk_replace_core")
|
||||
disk_index = text2num(params["index"])
|
||||
ui_modal_boolean(src, action, "Are you sure you want to replace ALL core genes of the [seed]?" , yes_text = "Replace", no_text = "Cancel", delegate = PROC_REF(bulk_replace_core))
|
||||
|
||||
if("replace")
|
||||
ui_modal_boolean(src, action, "Are you sure you want to replace [target.get_name()] gene with [disk.gene.get_name()]?", yes_text = "Replace", no_text = "Cancel", delegate = PROC_REF(gene_replace))
|
||||
disk_index = text2num(params["index"])
|
||||
var/obj/item/disk/plantgene/D = contents[text2num(params["index"])]
|
||||
ui_modal_boolean(src, action, "Are you sure you want to replace [target.get_name()] gene with [D.gene.get_name()]?", yes_text = "Replace", no_text = "Cancel", delegate = PROC_REF(gene_replace))
|
||||
|
||||
if("remove")
|
||||
ui_modal_boolean(src, action, "Are you sure you want to remove [target.get_name()] gene from the [seed]" , yes_text = "Remove", no_text = "Cancel", delegate = PROC_REF(gene_remove))
|
||||
|
||||
if("insert")
|
||||
if(!istype(disk.gene, /datum/plant_gene/core) && !disk.is_bulk_core && disk.gene.can_add(seed))
|
||||
seed.genes += disk.gene.Copy()
|
||||
if(istype(disk.gene, /datum/plant_gene/reagent))
|
||||
var/obj/item/disk/plantgene/D = contents[text2num(params["index"])]
|
||||
if(D.gene && (istype(D.gene, /datum/plant_gene/trait) || istype(D.gene, /datum/plant_gene/reagent)) && D.gene.can_add(seed))
|
||||
seed.genes += D.gene.Copy()
|
||||
if(istype(D.gene, /datum/plant_gene/reagent))
|
||||
seed.reagents_from_genes()
|
||||
update_genes()
|
||||
repaint_seed()
|
||||
// this doesnt need a modal, its easy enough to just remove the inserted gene
|
||||
|
||||
if("select")
|
||||
disk = contents[text2num(params["index"])]
|
||||
|
||||
if("select_empty_disk")
|
||||
for(var/obj/item/disk/plantgene/D in contents)
|
||||
if(!D.gene && !D.is_bulk_core)
|
||||
disk = D
|
||||
return
|
||||
|
||||
if("eject_empty_disk")
|
||||
for(var/obj/item/disk/plantgene/D in contents)
|
||||
if(!D.gene && !D.is_bulk_core)
|
||||
D.forceMove(loc)
|
||||
user.put_in_hands(D)
|
||||
update_genes()
|
||||
return
|
||||
to_chat(user, "<span class='warning'> No Empty Disks to Eject!</span>")
|
||||
if("set_read_only")
|
||||
var/obj/item/disk/plantgene/D = contents[text2num(params["index"])]
|
||||
D.read_only = !D.read_only
|
||||
|
||||
/obj/machinery/plantgenes/proc/gene_remove()
|
||||
if(istype(target, /datum/plant_gene/core))
|
||||
@@ -358,16 +453,22 @@
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
update_genes()
|
||||
target = null
|
||||
//replace with empty disk if possible
|
||||
for(var/obj/item/disk/plantgene/D in contents)
|
||||
if(!D.gene && !D.is_bulk_core)
|
||||
disk = D
|
||||
return
|
||||
|
||||
/obj/machinery/plantgenes/proc/gene_replace()
|
||||
if(!disk?.gene || disk.is_bulk_core)
|
||||
var/obj/item/disk/plantgene/D = contents[disk_index]
|
||||
if(!D?.gene || D.is_bulk_core)
|
||||
return
|
||||
if(!istype(target, /datum/plant_gene/core))
|
||||
return
|
||||
if(!istype(disk.gene, target.type))
|
||||
if(!istype(D.gene, target.type))
|
||||
return // you can't replace a endurance gene with a weed chance gene, etc
|
||||
seed.genes -= target
|
||||
var/datum/plant_gene/core/C = disk.gene.Copy()
|
||||
var/datum/plant_gene/core/C = D.gene.Copy()
|
||||
seed.genes += C
|
||||
C.apply_stat(seed)
|
||||
repaint_seed()
|
||||
@@ -395,15 +496,22 @@
|
||||
update_genes()
|
||||
target = null
|
||||
|
||||
if(disk.seeds_scanned >= disk.seeds_needed)
|
||||
for(var/obj/item/disk/plantgene/D in contents)
|
||||
if(!D.gene && (!D.is_bulk_core))
|
||||
disk = D
|
||||
return
|
||||
|
||||
/obj/machinery/plantgenes/proc/bulk_replace_core()
|
||||
if(!disk?.is_bulk_core)
|
||||
var/obj/item/disk/plantgene/D = contents[disk_index]
|
||||
if(!D?.is_bulk_core)
|
||||
return
|
||||
if(disk.seeds_scanned < disk.seeds_needed)
|
||||
if(D.seeds_scanned < D.seeds_needed)
|
||||
return
|
||||
for(var/datum/plant_gene/gene in seed.genes)
|
||||
if(istype(gene, /datum/plant_gene/core))
|
||||
seed.genes -= gene
|
||||
for(var/datum/plant_gene/core/gene in disk.core_genes)
|
||||
for(var/datum/plant_gene/core/gene in D.core_genes)
|
||||
var/datum/plant_gene/core/C = gene.Copy()
|
||||
seed.genes += C
|
||||
C.apply_stat(seed)
|
||||
|
||||
@@ -156,7 +156,10 @@
|
||||
|
||||
var/datum/reagent/R = GLOB.chemical_reagents_list[reag_id]
|
||||
if(R && R.id == reagent_id)
|
||||
name = R.name
|
||||
if(reagent_id == "holywater")
|
||||
name = "Holy Water"
|
||||
else
|
||||
name = R.name
|
||||
|
||||
/datum/plant_gene/reagent/New(reag_id = null, reag_rate = 0)
|
||||
..()
|
||||
@@ -174,6 +177,8 @@
|
||||
/datum/plant_gene/reagent/can_add(obj/item/seeds/S)
|
||||
if(!..())
|
||||
return FALSE
|
||||
if(!S)
|
||||
return FALSE
|
||||
for(var/datum/plant_gene/reagent/R in S.genes)
|
||||
if(R.reagent_id == reagent_id)
|
||||
return FALSE
|
||||
@@ -195,7 +200,8 @@
|
||||
/datum/plant_gene/trait/can_add(obj/item/seeds/S)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
if(!S)
|
||||
return FALSE
|
||||
for(var/datum/plant_gene/trait/R in S.genes)
|
||||
if(trait_id && R.trait_id == trait_id)
|
||||
return FALSE
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 103 KiB |
@@ -15,14 +15,21 @@ export const GeneModder = (props, context) => {
|
||||
const { has_seed } = data;
|
||||
|
||||
return (
|
||||
<Window width={500} height={650}>
|
||||
<Window.Content>
|
||||
<Stack fill vertical>
|
||||
<Storage />
|
||||
<ComplexModal maxWidth="75%" maxHeight="75%" />
|
||||
{has_seed === 0 ? <MissingSeed /> : <Genes />}
|
||||
</Stack>
|
||||
</Window.Content>
|
||||
<Window width={950} height={650}>
|
||||
<div className="GeneModder__left">
|
||||
<Window.Content>
|
||||
<Disks scrollable />
|
||||
</Window.Content>
|
||||
</div>
|
||||
<div className="GeneModder__right">
|
||||
<Window.Content>
|
||||
<Stack fill vertical scrollable>
|
||||
<Storage />
|
||||
<ComplexModal maxWidth="75%" maxHeight="75%" />
|
||||
{has_seed === 0 ? <MissingSeed /> : <Genes />}
|
||||
</Stack>
|
||||
</Window.Content>
|
||||
</div>
|
||||
</Window>
|
||||
);
|
||||
};
|
||||
@@ -32,19 +39,7 @@ const Genes = (props, context) => {
|
||||
const { disk } = data;
|
||||
|
||||
return (
|
||||
<Section
|
||||
title="Genes"
|
||||
fill
|
||||
scrollable
|
||||
buttons={
|
||||
<Button
|
||||
content="Insert Gene from Disk"
|
||||
disabled={!disk || !disk.can_insert || disk.is_core}
|
||||
icon="arrow-circle-down"
|
||||
onClick={() => act('insert')}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Section title="Genes" fill scrollable>
|
||||
<CoreGenes />
|
||||
<ReagentGenes />
|
||||
<TraitGenes />
|
||||
@@ -123,7 +118,8 @@ const Storage = (props, context) => {
|
||||
<Button
|
||||
ml={3.3}
|
||||
content={show_disk}
|
||||
onClick={() => act('eject_disk')}
|
||||
tooltip="Select Empty Disk"
|
||||
onClick={() => act('select_empty_disk')}
|
||||
/>
|
||||
</Stack.Item>
|
||||
</LabeledList.Item>
|
||||
@@ -151,14 +147,6 @@ const CoreGenes = (props, context) => {
|
||||
onClick={() => act('extract', { id: gene.id })}
|
||||
/>
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
<Button
|
||||
content="Replace"
|
||||
disabled={!gene.is_type || !disk.can_insert}
|
||||
icon="arrow-circle-down"
|
||||
onClick={() => act('replace', { id: gene.id })}
|
||||
/>
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
))}{' '}
|
||||
{
|
||||
@@ -171,14 +159,6 @@ const CoreGenes = (props, context) => {
|
||||
onClick={() => act('bulk_extract_core')}
|
||||
/>
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
<Button
|
||||
content="Replace All"
|
||||
disabled={!disk?.is_bulk_core}
|
||||
icon="arrow-circle-down"
|
||||
onClick={() => act('bulk_replace_core')}
|
||||
/>
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
}
|
||||
</Collapsible>
|
||||
@@ -247,3 +227,239 @@ const OtherGenes = (props, context) => {
|
||||
</Collapsible>
|
||||
);
|
||||
};
|
||||
|
||||
const Disks = (props, context) => {
|
||||
const { title, gene_set, do_we_show } = props;
|
||||
const { act, data } = useBackend(context);
|
||||
const { has_seed, empty_disks, stat_disks, trait_disks, reagent_disks } =
|
||||
data;
|
||||
|
||||
return (
|
||||
<Section title="Disks">
|
||||
<br />
|
||||
Empty Disks: {empty_disks}
|
||||
<br />
|
||||
<br />
|
||||
<Button
|
||||
width={12}
|
||||
icon="arrow-down"
|
||||
tooltip="Eject an Empty disk"
|
||||
content="Eject Empty Disk"
|
||||
onClick={() => act('eject_empty_disk')}
|
||||
/>
|
||||
<Stack fill vertical>
|
||||
<Section title="Stats">
|
||||
<Stack fill vertical scrollable>
|
||||
{stat_disks
|
||||
.slice()
|
||||
.sort((a, b) => a.display_name.localeCompare(b.display_name))
|
||||
.map((item) => {
|
||||
return (
|
||||
<Stack key={item} mr={2}>
|
||||
<Stack.Item width="49%">{item.display_name}</Stack.Item>
|
||||
<Stack.Item width={25}>
|
||||
{item.stat === 'All' ? (
|
||||
<Button
|
||||
content="Replace All"
|
||||
tooltip="Write disk stats to seed"
|
||||
disabled={!item?.ready || !has_seed}
|
||||
icon="arrow-circle-down"
|
||||
onClick={() =>
|
||||
act('bulk_replace_core', { index: item.index })
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<Button
|
||||
width={6}
|
||||
icon="arrow-circle-down"
|
||||
tooltip="Write disk stat to seed"
|
||||
disabled={!item || !has_seed}
|
||||
content="Replace"
|
||||
onClick={() =>
|
||||
act('replace', {
|
||||
index: item.index,
|
||||
stat: item.stat,
|
||||
})
|
||||
}
|
||||
/>
|
||||
)}
|
||||
<Button
|
||||
width={6}
|
||||
icon="arrow-right"
|
||||
content="Select"
|
||||
tooltip="Choose as target for extracted genes"
|
||||
tooltipPosition="bottom-start"
|
||||
onClick={() =>
|
||||
act('select', {
|
||||
index: item.index,
|
||||
})
|
||||
}
|
||||
/>
|
||||
<Button
|
||||
width={5}
|
||||
icon="arrow-down"
|
||||
content="Eject"
|
||||
tooltip="Eject Disk"
|
||||
tooltipPosition="bottom-start"
|
||||
onClick={() =>
|
||||
act('eject_disk', {
|
||||
index: item.index,
|
||||
})
|
||||
}
|
||||
/>
|
||||
<Button
|
||||
width={2}
|
||||
icon={item.read_only ? 'lock' : 'lock-open'}
|
||||
content=""
|
||||
tool_tip="Set/unset Read Only"
|
||||
onClick={() =>
|
||||
act('set_read_only', {
|
||||
index: item.index,
|
||||
read_only: item.read_only,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
);
|
||||
})}
|
||||
|
||||
<Button />
|
||||
</Stack>
|
||||
</Section>
|
||||
<Section title="Traits">
|
||||
<Stack fill vertical scrollable>
|
||||
{trait_disks
|
||||
.slice()
|
||||
.sort((a, b) => a.display_name.localeCompare(b.display_name))
|
||||
.map((item) => {
|
||||
return (
|
||||
<Stack key={item} mr={2}>
|
||||
<Stack.Item width="49%">{item.display_name}</Stack.Item>
|
||||
<Stack.Item width={25}>
|
||||
<Button
|
||||
width={6}
|
||||
icon="arrow-circle-down"
|
||||
disabled={!item || !item.can_insert}
|
||||
tooltip="Add disk trait to seed"
|
||||
content="Insert"
|
||||
onClick={() =>
|
||||
act('insert', {
|
||||
index: item.index,
|
||||
})
|
||||
}
|
||||
/>
|
||||
<Button
|
||||
width={6}
|
||||
icon="arrow-right"
|
||||
content="Select"
|
||||
tooltip="Choose as target for extracted genes"
|
||||
tooltipPosition="bottom-start"
|
||||
onClick={() =>
|
||||
act('select', {
|
||||
index: item.index,
|
||||
})
|
||||
}
|
||||
/>
|
||||
<Button
|
||||
width={5}
|
||||
icon="arrow-down"
|
||||
content="Eject"
|
||||
tooltip="Eject Disk"
|
||||
tooltipPosition="bottom-start"
|
||||
onClick={() =>
|
||||
act('eject_disk', {
|
||||
index: item.index,
|
||||
})
|
||||
}
|
||||
/>
|
||||
<Button
|
||||
width={2}
|
||||
icon={item.read_only ? 'lock' : 'lock-open'}
|
||||
content=""
|
||||
tool_tip="Set/unset Read Only"
|
||||
onClick={() =>
|
||||
act('set_read_only', {
|
||||
index: item.index,
|
||||
read_only: item.read_only,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
);
|
||||
})}
|
||||
|
||||
<Button />
|
||||
</Stack>
|
||||
</Section>
|
||||
<Section title="Reagents">
|
||||
<Stack fill vertical scrollable>
|
||||
{reagent_disks
|
||||
.slice()
|
||||
.sort((a, b) => a.display_name.localeCompare(b.display_name))
|
||||
.map((item) => {
|
||||
return (
|
||||
<Stack key={item} mr={2}>
|
||||
<Stack.Item width="49%">{item.display_name}</Stack.Item>
|
||||
<Stack.Item width={25}>
|
||||
<Button
|
||||
width={6}
|
||||
icon="arrow-circle-down"
|
||||
disabled={!item || !item.can_insert}
|
||||
tooltip="Add disk reagent to seed"
|
||||
content="Insert"
|
||||
onClick={() =>
|
||||
act('insert', {
|
||||
index: item.index,
|
||||
})
|
||||
}
|
||||
/>
|
||||
<Button
|
||||
width={6}
|
||||
icon="arrow-right"
|
||||
content="Select"
|
||||
tooltip="Choose as target for extracted genes"
|
||||
tooltipPosition="bottom-start"
|
||||
onClick={() =>
|
||||
act('select', {
|
||||
index: item.index,
|
||||
})
|
||||
}
|
||||
/>
|
||||
<Button
|
||||
width={5}
|
||||
icon="arrow-down"
|
||||
content="Eject"
|
||||
tooltip="Eject Disk"
|
||||
tooltipPosition="bottom-start"
|
||||
onClick={() =>
|
||||
act('eject_disk', {
|
||||
index: item.index,
|
||||
})
|
||||
}
|
||||
/>
|
||||
<Button
|
||||
width={2}
|
||||
icon={item.read_only ? 'lock' : 'lock-open'}
|
||||
content=""
|
||||
tool_tip="Set/unset Read Only"
|
||||
onClick={() =>
|
||||
act('set_read_only', {
|
||||
index: item.index,
|
||||
read_only: item.read_only,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
);
|
||||
})}
|
||||
|
||||
<Button />
|
||||
</Stack>
|
||||
</Section>
|
||||
</Stack>
|
||||
</Section>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
@use '../base.scss';
|
||||
|
||||
$background-color: rgba(0, 0, 0, 0.33) !default;
|
||||
|
||||
.GeneModder__left {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: base.em(490px);
|
||||
}
|
||||
|
||||
.GeneModder__right {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: base.em(490px);
|
||||
right: 0;
|
||||
background-color: $background-color;
|
||||
}
|
||||
@@ -51,6 +51,7 @@
|
||||
@include meta.load-css('./interfaces/CameraConsole.scss');
|
||||
@include meta.load-css('./interfaces/Contractor.scss');
|
||||
@include meta.load-css('./interfaces/ExosuitFabricator.scss');
|
||||
@include meta.load-css('./interfaces/GeneModder.scss');
|
||||
@include meta.load-css('./interfaces/KitchenMachine.scss');
|
||||
@include meta.load-css('./interfaces/LibraryComputer.scss');
|
||||
@include meta.load-css('./interfaces/ListInput.scss');
|
||||
|
||||
File diff suppressed because one or more lines are too long
+17
-17
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user