Skip to content
Snippets Groups Projects
Commit 2bad8433 authored by lowercasedonkey's avatar lowercasedonkey
Browse files

start

parent 432520be
No related branches found
No related tags found
1 merge request!6377Convert costsBudget to DOM
...@@ -19,6 +19,7 @@ App.UI = {}; ...@@ -19,6 +19,7 @@ App.UI = {};
App.UI.DOM = {}; App.UI.DOM = {};
App.UI.View = {}; App.UI.View = {};
App.UI.SlaveInteract = {}; App.UI.SlaveInteract = {};
App.UI.Budget = {};
App.Update = {}; App.Update = {};
App.Utils = {}; App.Utils = {};
App.Interact = {}; App.Interact = {};
......
App.UI.Budget.Cost = function () {
let items = [];
let el = document.createElement('p');
let table = document.createElement("TABLE");
table.className = "finances";
table.style.textAlign = "right";
table.style.borderCollapse = "separate";
table.style.borderSpacing = "5px";
table.style.borderStyle = "hidden";
table.style.emptyCells = "hide";
table.style.width = "75%";
table.style.borderStyle = "solid";
table.style.borderWidth = "1px";
table.style.borderColor = "white";
let header = table.createTHead();
let row = header.insertRow(0);
let cell = row.insertCell(0);
cell.textContent = "Penthouse";
cell = row.insertCell(1);
cell.textContent = "Income";
cell = row.insertCell(2);
cell.textContent = "Expense";
cell = row.insertCell(3);
cell.textContent = "Totals";
el.appendChild(table);
return jQuery('#costTable').empty().append(el);
const generateRow = function (category, title) {
const income = "lastWeeksCashIncome";
const expenses = "lastWeeksCashExpenses";
const profits = "lastWeeksCashProfits";
if (V[income][category] || V[expenses][category] || V.showAllEntries.costsBudget) {
V[profits][category] = V[income][category] + V[expenses][category];
return `<tr>\
<td>${title}</td>\
<td>${cashFormatColor(V[income][category])}</td>\
<td>${cashFormatColor(-Math.abs(V[expenses][category]))}</td>\
<td>${cashFormatColor(V[profits][category])}</td>\
</tr>`;
}
};
};
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
<<set $showAllEntries = {costsBudget: 0, repBudget: 0}>> <<set $showAllEntries = {costsBudget: 0, repBudget: 0}>>
<</if>> <</if>>
<span id="costTable"></span>
<script>App.UI.Budget.Cost()</script>
<div class="scene-intro"> <div class="scene-intro">
Here you can view many of the financial details of your arcology, <<= properTitle()>>. The detailed list of slaves and their costs (food, hormones) that you may remember can now be found in the "Slave maintenance" link. Other links will allow you to directly control areas of your arcology to adjust spending to suit your tastes. Here you can view many of the financial details of your arcology, <<= properTitle()>>. The detailed list of slaves and their costs (food, hormones) that you may remember can now be found in the "Slave maintenance" link. Other links will allow you to directly control areas of your arcology to adjust spending to suit your tastes.
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment