From a1441b31f251b10e37e9103e0c7c8b2cdbc4d135 Mon Sep 17 00:00:00 2001
From: Minzenkatze <70774627+Minzenkatze@users.noreply.github.com>
Date: Tue, 28 Mar 2023 17:23:36 +0200
Subject: [PATCH] UI: Improvements to Create Program tab (#449)
* Progress indicator for programs that are in progress
* Button for a program that is currently being worked (unfocused) is just a refocus button
---
src/Programs/ui/ProgramsRoot.tsx | 54 ++++++++++++++++++++++----------
1 file changed, 38 insertions(+), 16 deletions(-)
diff --git a/src/Programs/ui/ProgramsRoot.tsx b/src/Programs/ui/ProgramsRoot.tsx
index 81202d18d..2a397bca2 100644
--- a/src/Programs/ui/ProgramsRoot.tsx
+++ b/src/Programs/ui/ProgramsRoot.tsx
@@ -86,22 +86,37 @@ export function ProgramsRoot(): React.ReactElement {
(create.req() && ) || }
{program.name}
- {!Player.hasProgram(program.name) && create.req() && (
-
- )}
+ {!Player.hasProgram(program.name) &&
+ create.req() &&
+ (isCreateProgramWork(Player.currentWork) && Player.currentWork?.programName === program.name ? (
+ //Button if the program is currently being worked on
+
+ ) : (
+ //Button if the program is not currently worked on
+
+ ))}
{Player.hasProgram(program.name) || getHackingLevelRemaining(create.level) === 0 || (
Unlocks in: {getHackingLevelRemaining(create.level)} hacking levels
@@ -112,6 +127,13 @@ export function ProgramsRoot(): React.ReactElement {
Current completion: {curCompletion}%
)}
+ {/*Displays the current completion of the program currently being created*/}
+ {isCreateProgramWork(Player.currentWork) && Player.currentWork?.programName === program.name && (
+
+ Current completion:{" "}
+ {((100 * Player.currentWork.unitCompleted) / Player.currentWork.unitNeeded()).toFixed(2)}%
+
+ )}
{create.tooltip}
>