[MIRROR] Fixes limbgrower and mining order console UI [MDB IGNORE] (#22589)

* Fixes limbgrower and mining order console UI (#76755)

## About The Pull Request

Fixes the alien limbgrower UI from repeating itself
Fixes mining order console UI preventing you from ordering more than 20
items and ordering negative numbers of items by using the buttons for
remove_one and add_one

Closes #74875
Closes #76767
## Why It's Good For The Game

Makes it easier to use and look at
Fixes being able to order more items or get them for free from the
mining order conso;e
## Changelog

🆑
fix: Fixed the alien limbgrower UI
fix: Fixed being able to order negative or more than 20 items in mining
order console
/🆑

* Fixes limbgrower and mining order console UI

---------

Co-authored-by: SirNooben <132080629+SirNooben@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-07-19 15:26:59 -04:00
committed by GitHub
co-authored by SirNooben
parent 5663f645a9
commit 546b45f82f
2 changed files with 12 additions and 5 deletions
@@ -134,12 +134,19 @@ GLOBAL_LIST_EMPTY(order_console_products)
switch(action)
if("add_one")
var/datum/orderable_item/wanted_item = locate(params["target"]) in GLOB.order_console_products
grocery_list[wanted_item] += 1
if(grocery_list[wanted_item] >= 20)
return
else
grocery_list[wanted_item] += 1
if("remove_one")
var/datum/orderable_item/wanted_item = locate(params["target"]) in GLOB.order_console_products
if(!grocery_list[wanted_item])
return
grocery_list[wanted_item] -= 1
if(grocery_list[wanted_item] < 1)
grocery_list[wanted_item] = 0
return
else
grocery_list[wanted_item] -= 1
if(!grocery_list[wanted_item])
grocery_list -= wanted_item
if("cart_set")
+3 -3
View File
@@ -80,9 +80,9 @@
var/list/available_nodes = stored_research.researched_designs.Copy()
if(imported_designs.len)
available_nodes += imported_designs
available_nodes |= imported_designs
if(obj_flags & EMAGGED)
available_nodes += stored_research.hacked_designs
available_nodes |= stored_research.hacked_designs
for(var/design_id in available_nodes)
var/datum/design/limb_design = SSresearch.techweb_design_by_id(design_id)
@@ -291,4 +291,4 @@
for(var/id in SSresearch.techweb_designs)
var/datum/design/found_design = SSresearch.techweb_design_by_id(id)
if((found_design.build_type & LIMBGROWER) && !(RND_CATEGORY_HACKED in found_design.category))
imported_designs += found_design.id
imported_designs |= found_design.id