Finished ResleeveUI implementation (untested)

This commit is contained in:
danielyxie
2019-01-17 07:40:43 -08:00
parent 19f65de555
commit 10231b6c66
11 changed files with 320 additions and 73 deletions
+9
View File
@@ -0,0 +1,9 @@
Implements the "Duplicate Sleeves" feature, which allows the player to purchase
new duplicate sleeves. These are synthetic bodies that contain the player's
cloned consciousness. The player can use these sleeves to perform
different tasks synchronously.
This feature is introduced and unlocked in BitNode-10.
Note that while they are based on the same concept, this feature is different
than the "Re-sleeving" mechanic (which is referred to as "Resleeve" in the source code).
+1 -1
View File
@@ -8,8 +8,8 @@
*/
import { SleeveTaskType } from "./SleeveTaskTypesEnum";
import { IPlayer } from "../IPlayer";
import { Person,
IPlayer,
ITaskTracker,
createTaskTracker } from "../Person";
+7 -12
View File
@@ -4,7 +4,7 @@
import { Sleeve } from "./Sleeve";
import { SleeveTaskType } from "./SleeveTaskTypesEnum";
import { IPlayer } from "../Person";
import { IPlayer } from "../IPlayer";
import { Locations } from "../../Locations";
@@ -47,9 +47,9 @@ interface ISleeveUIElems {
// Object that keeps track of all DOM elements for the entire Sleeve UI
interface IPageUIElems {
container: Element | null;
info: Element | null,
sleeveList: Element | null,
container: HTMLElement | null;
info: HTMLElement | null,
sleeveList: HTMLElement | null,
sleeves: ISleeveUIElems[] | null,
}
@@ -60,14 +60,9 @@ const UIElems: IPageUIElems = {
sleeves: null,
}
// Interface for Player object
interface ISleeveUiPlayer extends IPlayer {
sleeves: Sleeve[];
}
// Creates the UI for the entire Sleeves page
let playerRef: ISleeveUiPlayer | null;
export function createSleevesPage(p: ISleeveUiPlayer) {
let playerRef: IPlayer | null;
export function createSleevesPage(p: IPlayer) {
if (!routing.isOn(Page.Sleeves)) { return; }
try {
@@ -147,7 +142,7 @@ function createSleeveUi(sleeve: Sleeve, allSleeves: Sleeve[]): ISleeveUIElems {
});
elems.statsPanel = createElement("div", { class: "sleeve-panel" });
elems.stats = createElement("p", { class: "sleeve-stats-text tooltip" });
elems.stats = createElement("p", { class: "sleeve-stats-text" });
elems.moreStatsButton = createElement("button", {
class: "std-button",
innerText: "More Stats",