Skip to content

Commit

Permalink
fix ticket 456
Browse files Browse the repository at this point in the history
  • Loading branch information
Huxinator committed Sep 29, 2024
1 parent 014a9d5 commit 4bc3fcf
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/Public/static/js/colony.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,7 @@ function toggleTorpedoInfo(module_crew) {
}

function replaceTabImage(type, moduleId, commodityId, module_crew, amount) {
if (amount <= 0) {
return;
}

if (moduleId == 0) {
$('tab_image_mod_' + type).src = 'assets/buttons/modul_' + type + '.png';
$('module_type_' + type).innerHTML = '';
Expand All @@ -328,18 +326,18 @@ function replaceTabImage(type, moduleId, commodityId, module_crew, amount) {
$('module_type_' + type).show();
updateCrewCount(type, module_crew);
}

enableShipBuildButton();
if (amount > 0) {
enableShipBuildButton();
}
else {
checkCrewCount();
}
}
var disabledSlots = new Set();
function toggleSpecialModuleDisplay(type, module_id, module_crew, amount) {
let innerHTML = '';
let checkedCount = 0;

if (amount <= 0) {
return;
}

//count and set tab images
Element.select($('selector_' + type), '.specialModuleRadio').each(function (elem) {
if (elem.checked) {
Expand Down Expand Up @@ -380,7 +378,12 @@ function toggleSpecialModuleDisplay(type, module_id, module_crew, amount) {
$('module_type_' + type).innerHTML = innerHTML;
$('module_type_' + type).show();

enableShipBuildButton();
if (amount > 0) {
enableShipBuildButton();
}
else {
checkCrewCount();
}
}
var maxCrew;
var baseCrew;
Expand Down

0 comments on commit 4bc3fcf

Please sign in to comment.