Fix for challenge mode

This commit is contained in:
Daniel van Noord
2020-12-05 23:13:53 +01:00
parent 36e64d3d90
commit 7e101edf82
2 changed files with 21 additions and 17 deletions

View File

@@ -3260,17 +3260,15 @@ CM.Disp.CreateStatsHeader = function(text, config) {
* @returns {object} div The option object
*/
CM.Disp.CreateStatsListing = function(type, name, text, placeholder) {
var div = document.createElement('div');
div.className = 'listing';
var listingName = document.createElement('span');
listingName.textContent = name + ' '
div.appendChild(listingName);
if (type == "withTooltip") {
var div = document.createElement('div');
div.className = 'listingWithTooltip';
var listingName = document.createElement('span');
listingName.textContent = name + ' '
div.appendChild(listingName);
var frag = document.createDocumentFragment();
var tooltip = document.createElement('span');
tooltip.onmouseout = function() { Game.tooltip.hide(); };
tooltip.onmouseover = function() {Game.tooltip.draw(this, escape(CM.Disp[placeholder].innerHTML));};
@@ -3285,14 +3283,12 @@ CM.Disp.CreateStatsListing = function(type, name, text, placeholder) {
tooltip.style.fontSize = '9px';
tooltip.style.verticalAlign = 'bottom';
tooltip.textContent = '?';
frag.appendChild(tooltip);
frag.appendChild(document.createTextNode(' : '));
div.appendChild(frag);
div.appendChild(text);
return div;
div.appendChild(tooltip);
div.appendChild(document.createTextNode(' '));
}
div.appendChild(document.createTextNode(': '));
div.appendChild(text);
return div;
}
@@ -4204,7 +4200,11 @@ CM.Sim.InitialBuildingData = function(buildingName) {
* so this function just returns an empty object.
*/
CM.Sim.InitUpgrade = function(upgradeName) {
return {};
var me = Game.Upgrades[upgradeName];
var you = {};
you.pool = me.pool;
you.name = me.name;
return you;
}
/* Similar to the previous function, but for achievements.

View File

@@ -171,7 +171,11 @@ CM.Sim.InitialBuildingData = function(buildingName) {
* so this function just returns an empty object.
*/
CM.Sim.InitUpgrade = function(upgradeName) {
return {};
var me = Game.Upgrades[upgradeName];
var you = {};
you.pool = me.pool;
you.name = me.name;
return you;
}
/* Similar to the previous function, but for achievements.