Refactored Main Menu UI implementation. Fixed several bugs related to recent JS -> TypeScript refactors

This commit is contained in:
danielyxie
2019-01-18 09:57:21 -08:00
parent aac262b736
commit 7db169f828
16 changed files with 14842 additions and 13117 deletions
+17 -2
View File
@@ -3,6 +3,7 @@ import { applyAugmentation } from "./Augmentation/Augmentatio
import { PlayerOwnedAugmentation } from "./Augmentation/PlayerOwnedAugmentation";
import { AugmentationNames } from "./Augmentation/data/AugmentationNames";
import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers";
import { Bladeburner } from "./Bladeburner";
import { CodingContractRewardType } from "./CodingContracts";
import { Company } from "./Company/Company";
import { Companies } from "./Company/Companies";
@@ -688,9 +689,10 @@ PlayerObject.prototype.processWorkEarnings = function(numCycles=1) {
}
/* Working for Company */
PlayerObject.prototype.startWork = function() {
PlayerObject.prototype.startWork = function(companyName) {
this.resetWorkStatus();
this.isWorking = true;
this.companyName = companyName;
this.workType = CONSTANTS.WorkTypeCompany;
this.workHackExpGainRate = this.getWorkHackExpGain();
@@ -811,9 +813,10 @@ PlayerObject.prototype.finishWork = function(cancelled, sing=false) {
this.resetWorkStatus();
}
PlayerObject.prototype.startWorkPartTime = function() {
PlayerObject.prototype.startWorkPartTime = function(companyName) {
this.resetWorkStatus();
this.isWorking = true;
this.companyName = companyName;
this.workType = CONSTANTS.WorkTypeCompanyPartTime;
this.workHackExpGainRate = this.getWorkHackExpGain();
@@ -2309,6 +2312,18 @@ PlayerObject.prototype.startGang = function(factionName, hacking) {
this.gang = new Gang(factionName, hacking);
}
/*************** Corporation ****************/
PlayerObject.prototype.hasCorporation = function() {
if (this.corporation == null) { return false; }
return (this.corporation instanceof Corporation);
}
/*************** Bladeburner ****************/
PlayerObject.prototype.inBladeburner = function() {
if (this.bladeburner == null) { return false; }
return (this.bladeburner instanceof Bladeburner);
}
/************* BitNodes **************/
PlayerObject.prototype.setBitNodeNumber = function(n) {
this.bitNodeN = n;