Research & Development Console Restructure (#25653)

* RnD console

* Undefine local defines

* [ci skip]

* Build and update /tg/ui

* Reformat /tg/ui

* Apply suggestions from code review

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
Signed-off-by: Arthri <41360489+Arthri@users.noreply.github.com>

* Snake casing

[ci skip]

* If statement over ternary

* Document menu variables

* Replace user with ui.user

* Add documentation to copied variables

[ci skip]

* Rename icon to ui_icon

* Factor out wait message box

* Reorganize settings menu

* Refactor technology row

* [ci skip]

* Build and update /tg/ui

* Fix errors

* [ci skip]

* Build and update /tg/ui

---------

Signed-off-by: Arthri <41360489+Arthri@users.noreply.github.com>
Co-authored-by: Arthri <41360489+a@users.noreply.github.com>
Co-authored-by: /tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
Arthri
2024-07-30 14:27:53 +00:00
committed by GitHub
co-authored by Ryan Arthri /tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com> Burzah
parent efb735af1e
commit a96e634a8e
28 changed files with 793 additions and 830 deletions
+25 -14
View File
@@ -538,16 +538,29 @@
/datum/economy/simple_seller/tech_levels/begin_sell(obj/docking_port/mobile/supply/S)
temp_tech_levels = SSeconomy.tech_levels.Copy()
/datum/economy/simple_seller/tech_levels/proc/get_price(tech_rarity, tech_level, sold_level = null)
// Calculates tech disk's supply points sell cost
if(!sold_level)
sold_level = 1
if(sold_level >= tech_level)
return 0
var/cost = 0
for(var/i in (sold_level + 1) to tech_level)
cost += i * 5 * tech_rarity
return cost
/datum/economy/simple_seller/tech_levels/check_sell(obj/docking_port/mobile/supply/S, atom/movable/AM)
if(istype(AM, /obj/item/disk/tech_disk))
var/obj/item/disk/tech_disk/disk = AM
if(!disk.stored)
if(!disk.tech_id)
return COMSIG_CARGO_SELL_WRONG
var/datum/tech/tech = disk.stored
var/cost = tech.getCost(temp_tech_levels[tech.id])
var/cost = get_price(disk.tech_rarity, disk.tech_level, temp_tech_levels[disk.tech_id])
if(cost)
temp_tech_levels[tech.id] = tech.level
temp_tech_levels[disk.tech_id] = disk.tech_level
return COMSIG_CARGO_SELL_NORMAL
return COMSIG_CARGO_SELL_WRONG
@@ -556,28 +569,27 @@
return
var/obj/item/disk/tech_disk/disk = AM
if(!disk.stored)
if(!disk.tech_id)
return
var/datum/tech/tech = disk.stored
var/cost = tech.getCost(SSeconomy.tech_levels[tech.id])
var/cost = get_price(disk.tech_rarity, disk.tech_level, SSeconomy.tech_levels[disk.tech_id])
if(!cost)
return
SSeconomy.tech_levels[tech.id] = tech.level
SSeconomy.tech_levels[disk.tech_id] = disk.tech_level
SSblackbox.record_feedback("tally", "cargo tech disks sold", 1, "amount")
SSblackbox.record_feedback("tally", "cargo tech disks sold", cost, "credits")
var/datum/economy/line_item/cargo_item = new
cargo_item.account = SSeconomy.cargo_account
cargo_item.credits = cost / 2
cargo_item.reason = "[tech.name] - new data."
cargo_item.reason = "[disk.tech_name] - new data."
manifest.line_items += cargo_item
var/datum/economy/line_item/science_item = new
science_item.account = GLOB.station_money_database.get_account_by_department(DEPARTMENT_SCIENCE)
science_item.credits = cost / 2
science_item.reason = "[tech.name] - new data."
science_item.reason = "[disk.tech_name] - new data."
manifest.line_items += science_item
/datum/economy/simple_seller/tech_levels/sell_wrong(obj/docking_port/mobile/supply/S, atom/movable/AM, datum/economy/cargo_shuttle_manifest/manifest)
@@ -589,16 +601,15 @@
item.credits = 0
var/obj/item/disk/tech_disk/disk = AM
if(!disk.stored)
if(!disk.tech_id)
item.reason = "Blank tech disk."
manifest.line_items += item
SSblackbox.record_feedback("tally", "cargo tech disks sold", 1, "blank")
return
var/datum/tech/tech = disk.stored
var/cost = tech.getCost(SSeconomy.tech_levels[tech.id])
var/cost = get_price(disk.tech_rarity, disk.tech_level, SSeconomy.tech_levels[disk.tech_id])
if(!cost)
item.reason = "[tech.name] - no new data."
item.reason = "[disk.tech_name] - no new data."
manifest.line_items += item
SSblackbox.record_feedback("tally", "cargo tech disks sold", 1, "repeat")