Fixed page tabs so all menu pages are working now

This commit is contained in:
Daniel Xie 2017-01-27 21:10:16 -06:00
parent f1ada52074
commit bf893926b7
6 changed files with 126 additions and 32 deletions

@ -90,7 +90,45 @@
text-decoration: none; text-decoration: none;
} }
/* World */
#world-container {
position: fixed;
padding-top: 10px;
padding-left: 10px;
height: 100%;
margin-left: 10%;
width: 99%;
}
/* Create program */
#create-program-container {
position: fixed;
padding-top: 10px;
padding-left: 10px;
height: 100%;
margin-left: 10%;
width: 99%;
}
/* Factions */ /* Factions */
#factions-container {
position: fixed;
padding-top: 10px;
padding-left: 10px;
height: 100%;
margin-left: 10%;
width: 99%;
}
#faction-container {
position: fixed;
padding-top: 10px;
padding-left: 10px;
height: 100%;
margin-left: 10%;
width: 90%;
}
#faction-hack-button-div, #faction-hack-text-div { #faction-hack-button-div, #faction-hack-text-div {
display:inline-block; display:inline-block;
} }
@ -102,3 +140,24 @@
#faction-securitywork-button-div, #faction-securitywork-text-div { #faction-securitywork-button-div, #faction-securitywork-text-div {
display:inline-block; display:inline-block;
} }
/* Augmentations */
#augmentations-container {
position: fixed;
padding-top: 10px;
padding-left: 10px;
height: 100%;
margin-left: 10%;
width: 99%;
}
/* Tutorial */
#tutorial-container {
position: fixed;
padding-top: 10px;
padding-left: 10px;
height: 100%;
margin-left: 10%;
width: 99%;
}

@ -112,8 +112,7 @@
<p id="script-editor-status"> </p> <p id="script-editor-status"> </p>
</div> </div>
<br><br> <br><br>
<textarea id="script-editor-text" style="border: none" autofocus> <textarea id="script-editor-text" style="border: none" autofocus> </textarea>
</textarea>
</div> </div>
<!-- Active scripts info page --> <!-- Active scripts info page -->
@ -287,7 +286,7 @@
<li id="volhaven-milleniumfitnessgym-li"> <li id="volhaven-milleniumfitnessgym-li">
<a href="#" id="volhaven-milleniumfitnessgym">Millenium Fitness Gym</a> <a href="#" id="volhaven-milleniumfitnessgym">Millenium Fitness Gym</a>
<li> <li>
<ul> </ul>
</div> </div>
<!-- Create a program(executable) --> <!-- Create a program(executable) -->
@ -342,6 +341,7 @@
<!-- Tutorial content --> <!-- Tutorial content -->
<div id="tutorial-container"> <div id="tutorial-container">
</div> </div>-
</body> </body>
</html> </html>

@ -16,12 +16,12 @@ function Company() {
Company.prototype.init = function(name, salaryMult, expMult) { Company.prototype.init = function(name, salaryMult, expMult) {
this.companyName = name; this.companyName = name;
this.salaryMult = salaryMult; this.salaryMultiplier = salaryMult;
this.expMult = expMult; this.expMultiplier = expMult;
} }
Company.prototype.addPosition = function(pos) { Company.prototype.addPosition = function(pos) {
this.companyPositions.push(pos.name); //Company object holds only name of positions this.companyPositions.push(pos.positionName); //Company object holds only name of positions
} }
Company.prototype.addPositions = function(positions) { Company.prototype.addPositions = function(positions) {
@ -133,15 +133,15 @@ CompanyPositions = {
//Non-tech/management jobs //Non-tech/management jobs
Waiter: new CompanyPosition("Waiter", 1, 1, 1, 1, 1, 1, 0, .5), Waiter: new CompanyPosition("Waiter", 1, 1, 1, 1, 1, 1, 0, .5),
Employee: new CompanyPosition("Employee", 1, 1, 1, 1, 1, 1, 0, .5); Employee: new CompanyPosition("Employee", 1, 1, 1, 1, 1, 1, 0, .5),
SecurityGuard: new CompanyPosition("Security Guard", 1, 50, 50, 50, 50, 0, 3), SecurityGuard: new CompanyPosition("Security Guard", 1, 50, 50, 50, 50, 0, 3),
PoliceOfficer: new CompanyPosition("Police Officer", 10, 100, 100, 100, 100, 9000, 4), PoliceOfficer: new CompanyPosition("Police Officer", 10, 100, 100, 100, 100, 9000, 4),
SecurityOfficer: new CompanyPosition("Security Officer", 25, 150, 150, 150, 150, 9000, 6), SecurityOfficer: new CompanyPosition("Security Officer", 25, 150, 150, 150, 150, 9000, 6),
SecuritySupervisor: new CompanyPosition("Security Supervisor", 25, 250, 250, 250, 250, 36000, 12), SecuritySupervisor: new CompanyPosition("Security Supervisor", 25, 250, 250, 250, 250, 36000, 12),
HeadOfSecurity: new CompanyPosition("Head of Security", 50, 500, 500, 500, 500, 72000, 20), HeadOfSecurity: new CompanyPosition("Head of Security", 50, 500, 500, 500, 500, 72000, 20),
FieldAgent: new CompanyPosition("Field Agent", 100, 100, 100, 100, 100, 9000, 4), FieldAgent: new CompanyPosition("Field Agent", 100, 100, 100, 100, 100, 9000, 4),
SecretAgent: new CompanyPosition("Secret Agent", 200, 250, 250, 250, 250, 36000, 10); SecretAgent: new CompanyPosition("Secret Agent", 200, 250, 250, 250, 250, 36000, 10),
SpecialOperative: new CompanyPosition("Special Operative", 250, 500, 500, 500, 500, 108000, 20); SpecialOperative: new CompanyPosition("Special Operative", 250, 500, 500, 500, 500, 108000, 20),
init: function() { init: function() {
//Argument order: hack, str, def, dex, agi, cha //Argument order: hack, str, def, dex, agi, cha
@ -530,7 +530,7 @@ initCompanies = function() {
CompanyPositions.LeadDev, CompanyPositions.ITIntern, CompanyPositions.ITAnalyst, CompanyPositions.LeadDev, CompanyPositions.ITIntern, CompanyPositions.ITAnalyst,
CompanyPositions.ITManager, CompanyPositions.SysAdmin, CompanyPositions.SecurityEngineer, CompanyPositions.ITManager, CompanyPositions.SysAdmin, CompanyPositions.SecurityEngineer,
CompanyPositions.NetworkEngineer, CompanyPositions.NetworkAdministrator, CompanyPositions.HeadOfSoftware, CompanyPositions.NetworkEngineer, CompanyPositions.NetworkAdministrator, CompanyPositions.HeadOfSoftware,
CompanyPositions.HeadOfEngineering, CompanyPositions.SecurityGuard, CompanyPositions, SecurityOfficer, CompanyPositions.HeadOfEngineering, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer,
CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity, CompanyPositions.FieldAgent, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity, CompanyPositions.FieldAgent,
CompanyPositions.SecretAgent, CompanyPositions.SpecialOperative]); CompanyPositions.SecretAgent, CompanyPositions.SpecialOperative]);
AddToCompanies(CIA); AddToCompanies(CIA);
@ -542,7 +542,7 @@ initCompanies = function() {
CompanyPositions.LeadDev, CompanyPositions.ITIntern, CompanyPositions.ITAnalyst, CompanyPositions.LeadDev, CompanyPositions.ITIntern, CompanyPositions.ITAnalyst,
CompanyPositions.ITManager, CompanyPositions.SysAdmin, CompanyPositions.SecurityEngineer, CompanyPositions.ITManager, CompanyPositions.SysAdmin, CompanyPositions.SecurityEngineer,
CompanyPositions.NetworkEngineer, CompanyPositions.NetworkAdministrator, CompanyPositions.HeadOfSoftware, CompanyPositions.NetworkEngineer, CompanyPositions.NetworkAdministrator, CompanyPositions.HeadOfSoftware,
CompanyPositions.HeadOfEngineering, CompanyPositions.SecurityGuard, CompanyPositions, SecurityOfficer, CompanyPositions.HeadOfEngineering, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer,
CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity, CompanyPositions.FieldAgent, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity, CompanyPositions.FieldAgent,
CompanyPositions.SecretAgent, CompanyPositions.SpecialOperative]); CompanyPositions.SecretAgent, CompanyPositions.SpecialOperative]);
AddToCompanies(NSA); AddToCompanies(NSA);
@ -554,7 +554,7 @@ initCompanies = function() {
CompanyPositions.LeadDev, CompanyPositions.ITIntern, CompanyPositions.ITAnalyst, CompanyPositions.LeadDev, CompanyPositions.ITIntern, CompanyPositions.ITAnalyst,
CompanyPositions.ITManager, CompanyPositions.SysAdmin, CompanyPositions.SecurityEngineer, CompanyPositions.ITManager, CompanyPositions.SysAdmin, CompanyPositions.SecurityEngineer,
CompanyPositions.NetworkEngineer, CompanyPositions.NetworkAdministrator, CompanyPositions.HeadOfSoftware, CompanyPositions.NetworkEngineer, CompanyPositions.NetworkAdministrator, CompanyPositions.HeadOfSoftware,
CompanyPositions.HeadOfEngineering, CompanyPositions.SecurityGuard, CompanyPositions, SecurityOfficer, CompanyPositions.HeadOfEngineering, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer,
CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity, CompanyPositions.FieldAgent, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity, CompanyPositions.FieldAgent,
CompanyPositions.SecretAgent, CompanyPositions.SpecialOperative]); CompanyPositions.SecretAgent, CompanyPositions.SpecialOperative]);
AddToCompanies(WatchdogSecurity); AddToCompanies(WatchdogSecurity);
@ -632,7 +632,7 @@ initCompanies = function() {
CompanyPositions.LeadDev, CompanyPositions.ITIntern, CompanyPositions.ITAnalyst, CompanyPositions.LeadDev, CompanyPositions.ITIntern, CompanyPositions.ITAnalyst,
CompanyPositions.ITManager, CompanyPositions.SysAdmin, CompanyPositions.SecurityEngineer, CompanyPositions.ITManager, CompanyPositions.SysAdmin, CompanyPositions.SecurityEngineer,
CompanyPositions.NetworkEngineer, CompanyPositions.NetworkAdministrator, CompanyPositions.HeadOfSoftware, CompanyPositions.NetworkEngineer, CompanyPositions.NetworkAdministrator, CompanyPositions.HeadOfSoftware,
CompanyPositions.HeadOfEngineering, CompanyPositions.SecurityGuard, CompanyPositions, SecurityOfficer, CompanyPositions.HeadOfEngineering, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer,
CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity, CompanyPositions.FieldAgent, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity, CompanyPositions.FieldAgent,
CompanyPositions.SecretAgent, CompanyPositions.SpecialOperative]); CompanyPositions.SecretAgent, CompanyPositions.SpecialOperative]);
AddToCompanies(CarmichaelSecurity); AddToCompanies(CarmichaelSecurity);
@ -640,7 +640,7 @@ initCompanies = function() {
//"Low level" companies //"Low level" companies
var FoodNStuff = new Company(); var FoodNStuff = new Company();
FoodNStuff.init("FoodNStuff", 1, 1); FoodNStuff.init("FoodNStuff", 1, 1);
FoodNStuff.addPositions([CompanyPositions.Employee]);) FoodNStuff.addPositions([CompanyPositions.Employee]);
AddToCompanies(FoodNStuff); AddToCompanies(FoodNStuff);
var JoesGuns = new Company(); var JoesGuns = new Company();

@ -1,7 +1,7 @@
//Netburner Faction class //Netburner Faction class
function Faction(name) { function Faction(name) {
this.name = name; this.name = name;
this.augmentations = []; this.augmentations = []; //Name of faction only
this.information = ""; //Introductory/informational text about the faction this.information = ""; //Introductory/informational text about the faction
//Player-related properties for faction //Player-related properties for faction
@ -15,7 +15,7 @@ Faction.prototype.setAugmentations = function(augs) {
} }
} }
Faction.prototype.setInformation(info) { Faction.prototype.setInformation = function(info) {
this.information = info; this.information = info;
} }
@ -116,7 +116,7 @@ joinFaction = function(faction) {
aElem.addEventListener("click", function() { aElem.addEventListener("click", function() {
displayFactionContent(faction.name); displayFactionContent(faction.name);
return false; return false;
} });
item.appendChild(aElem); item.appendChild(aElem);
var factionsList = document.getElementById("factions-list"); var factionsList = document.getElementById("factions-list");

@ -34,6 +34,7 @@ var Engine = {
worldContent: null, worldContent: null,
createProgramContent: null, createProgramContent: null,
factionsContent: null, factionsContent: null,
factionContent: null,
augmentationsContent: null, augmentationsContent: null,
tutorialContent: null, tutorialContent: null,
@ -53,6 +54,7 @@ var Engine = {
World: "World", World: "World",
CreateProgram: "CreateProgram", CreateProgram: "CreateProgram",
Factions: "Factions", Factions: "Factions",
Faction: "Faction",
Augmentations: "Augmentations", Augmentations: "Augmentations",
Tutorial: "Tutorial", Tutorial: "Tutorial",
}, },
@ -171,35 +173,42 @@ var Engine = {
Engine.displayWorldInfo(); Engine.displayWorldInfo();
Engine.currentPage = Engine.Page.World; Engine.currentPage = Engine.Page.World;
} },
loadCreateProgramContent: function() { loadCreateProgramContent: function() {
Engine.hideAllContent(); Engine.hideAllContent();
Engine.Display.createProgramContent.style.visibility = "visible"; Engine.Display.createProgramContent.style.visibility = "visible";
Engine.currentPage = Engine.Page.CreateProgram; Engine.currentPage = Engine.Page.CreateProgram;
} },
loadFactionsContent: function() { loadFactionsContent: function() {
Engine.hideAllContent(); Engine.hideAllContent();
Engine.Display.factionsContent.style.visibility = "visible"; Engine.Display.factionsContent.style.visibility = "visible";
Engine.currentPage = Engine.Page.Factions; Engine.currentPage = Engine.Page.Factions;
} },
loadFactionContent: function() {
Engine.hideAllContent();
Engine.Display.factionContent.style.visibility = "visible";
Engine.currentPage = Engine.Page.Faction;
},
loadAugmentationsContent: function() { loadAugmentationsContent: function() {
Engine.hideAllContent(); Engine.hideAllContent();
Engine.Display.augmentationsContent.style.visibility = "visible"; Engine.Display.augmentationsContent.style.visibility = "visible";
Engine.currentPage = Engine.Page.Augmentations; Engine.currentPage = Engine.Page.Augmentations;
} },
loadTutorialContent: function() { loadTutorialContent: function() {
Engine.hideAllContent(); Engine.hideAllContent();
Engine.Display.tutorialContent.style.visibility = "visible"; Engine.Display.tutorialContent.style.visibility = "visible";
Engine.currentPage = Engine.Page.Tutorial; Engine.currentPage = Engine.Page.Tutorial;
} },
//Helper function that hides all content //Helper function that hides all content
hideAllContent: function() { hideAllContent: function() {
@ -207,11 +216,26 @@ var Engine = {
Engine.Display.characterContent.style.visibility = "hidden"; Engine.Display.characterContent.style.visibility = "hidden";
Engine.Display.scriptEditorContent.style.visibility = "hidden"; Engine.Display.scriptEditorContent.style.visibility = "hidden";
Engine.Display.activeScriptsContent.style.visibility = "hidden"; Engine.Display.activeScriptsContent.style.visibility = "hidden";
Engine.Display.worldContent.style.visiblity = "hidden"; Engine.Display.worldContent.style.visibility = "hidden";
Engine.Display.createProgramContent.style.visibility = "hidden"; Engine.Display.createProgramContent.style.visibility = "hidden";
Engine.Display.factionsContent.style.visibility = "hidden"; Engine.Display.factionsContent.style.visibility = "hidden";
Engine.Display.factionContent.style.visibility = "hidden";
Engine.Display.augmentationsContent.style.visibility = "hidden"; Engine.Display.augmentationsContent.style.visibility = "hidden";
Engine.Display.tutorialContent.style.visibility = "hidden"; Engine.Display.tutorialContent.style.visibility = "hidden";
//Location lists
Engine.aevumLocationsList.style.display = "none";
Engine.aevumLocationsList.style.visibility = "hidden";
Engine.chongqingLocationsList.style.display = "none";
Engine.chongqingLocationsList.style.visibility = "hidden";
Engine.sector12LocationsList.style.display = "none";
Engine.sector12LocationsList.style.visibility = "hidden";
Engine.newTokyoLocationsList.style.display = "none";
Engine.newTokyoLocationsList.style.visibility = "hidden";
Engine.ishimaLocationsList.style.display = "none";
Engine.ishimaLocationsList.style.visibility = "hidden";
Engine.volhavenLocationsList.style.display = "none";
Engine.volhavenLocationsList.style.visibility = "hidden";
}, },
/* Display character info */ /* Display character info */
@ -246,27 +270,33 @@ var Engine = {
switch(Player.city) { switch(Player.city) {
case CONSTANTS.Aevum: case CONSTANTS.Aevum:
Engine.aevumLocationsList.style.display = "inline"; Engine.aevumLocationsList.style.display = "inline";
Engine.aevumLocationsList.style.visibility = "visible";
break; break;
case CONSTANTS.ChongQing: case CONSTANTS.ChongQing:
Engine.chongqingLocationsList.style.display = "inline"; Engine.chongqingLocationsList.style.display = "inline";
Engine.chongqingLocationsList.style.visibility = "visible";
break; break;
case CONSTANTS.Sector12: case CONSTANTS.Sector12:
Engine.sector12LocationsList.style.display = "inline"; Engine.sector12LocationsList.style.display = "inline";
Engine.sector12LocationsList.style.visibility = "visible";
break; break;
case CONSTANTS.NewTokyo: case CONSTANTS.NewTokyo:
Engine.newTokyoLocationsList.style.display = "inline"; Engine.newTokyoLocationsList.style.display = "inline";
Engine.newTokyoLocationsList.style.visibility = "visible";
break; break;
case CONSTANTS.Ishima: case CONSTANTS.Ishima:
Engine.ishimaLocationsList.style.display = "inline"; Engine.ishimaLocationsList.style.display = "inline";
Engine.ishimaLocationsList.style.visibility = "visible";
break; break;
case CONSTANTS.Volhaven: case CONSTANTS.Volhaven:
Engine.volhavenLocationsList.style.display = "inline"; Engine.volhavenLocationsList.style.display = "inline";
Engine.volhavenLocationsList.style.visibility = "visible";
break; break;
default: default:
console.log("Invalid city value in Player object!"); console.log("Invalid city value in Player object!");
break; break;
} }
} },
/* Functions used to update information on the Active Scripts page */ /* Functions used to update information on the Active Scripts page */
ActiveScriptsList: null, ActiveScriptsList: null,
@ -494,9 +524,9 @@ var Engine = {
console.log("Initializing new game"); console.log("Initializing new game");
Player.init(); Player.init();
initForeignServers(); initForeignServers();
CompanyPositions.init();
initCompanies(); initCompanies();
initFactions(); initFactions();
CompanyPositions.init();
} }
//Main menu buttons and content //Main menu buttons and content
@ -552,7 +582,7 @@ var Engine = {
Engine.Clickables.tutorialMainMenuButton.addEventListener("click", function() { Engine.Clickables.tutorialMainMenuButton.addEventListener("click", function() {
Engine.loadTutorialContent(); Engine.loadTutorialContent();
return false; return false;
} });
//Active scripts list //Active scripts list
Engine.ActiveScriptsList = document.getElementById("active-scripts-list"); Engine.ActiveScriptsList = document.getElementById("active-scripts-list");
@ -590,11 +620,15 @@ var Engine = {
Engine.Display.factionsContent = document.getElementById("factions-container"); Engine.Display.factionsContent = document.getElementById("factions-container");
Engine.Display.factionsContent.style.visibility = "hidden"; Engine.Display.factionsContent.style.visibility = "hidden";
Engine.Display.factionContent = document.getElementById("faction-container");
Engine.Display.factionContent.style.visibility = "hidden";
Engine.Display.augmentationsContent = document.getElementById("augmentations-container"); Engine.Display.augmentationsContent = document.getElementById("augmentations-container");
Engine.Display.augmentationsContent.style.visiblity = "hidden"; Engine.Display.augmentationsContent.style.visibility = "hidden";
Engine.Display.tutorialContent = document.getElementById("tutorial-container"); Engine.Display.tutorialContent = document.getElementById("tutorial-container");
Engine.Display.tutorialContent.style.visiblity = "hidden"; Engine.Display.tutorialContent.style.visibility = "hidden";
//Character info //Character info
Engine.Display.characterInfo = document.getElementById("character-info"); Engine.Display.characterInfo = document.getElementById("character-info");
@ -606,6 +640,7 @@ var Engine = {
Engine.newTokyoLocationsList = document.getElementById("newtokyo-locations-list"); Engine.newTokyoLocationsList = document.getElementById("newtokyo-locations-list");
Engine.ishimaLocationsList = document.getElementById("ishima-locations-list"); Engine.ishimaLocationsList = document.getElementById("ishima-locations-list");
Engine.volhavenLocationsList = document.getElementById("volhaven-locations-list"); Engine.volhavenLocationsList = document.getElementById("volhaven-locations-list");
//Script editor //Script editor
Engine.Display.scriptEditorText = document.getElementById("script-editor-text"); Engine.Display.scriptEditorText = document.getElementById("script-editor-text");