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