Skip to content

Commit

Permalink
close #740 close #741 bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Areso committed Feb 8, 2023
1 parent 2ca4cb6 commit a41031b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
20 changes: 14 additions & 6 deletions js/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ function updateButtonCaptions(){
if (game.buildLevelH === config.maxLevelHome) {
document.getElementById("homes").setAttribute("style", "display:none");
}
if (game.buildLevelGallows === config.maxLevelGallows) {
document.getElementById("buttonBldGallows").setAttribute("style", "display:none");
}
if (game.buildLevelFountain === config.maxLevelFountain) {
document.getElementById("buttonBldFountain").setAttribute("style", "display:none");
}
if (game.buildLevelInn === config.maxLevelInn) {
document.getElementById("buttonBldInn").setAttribute("style", "display:none");
}
Expand All @@ -131,11 +125,25 @@ function updateButtonCaptions(){
if (game.buildLevelUniversity === config.maxLevelUniversity) {
document.getElementById("buttonBuildUniversity").setAttribute("style", "display:none");
}
if (game.buildLevelFountain ===0 && game.buildLevelGallows ==0){
document.getElementById("buttonBldFountain").style.display = 'block';
document.getElementById("buttonBldGallows").style.display = 'block';
}
if (game.buildLevelFountain > 0) {
document.getElementById("buttonBldGallows").setAttribute("style", "display:none");
if (game.buildLevelFountain === config.maxLevelFountain) {
document.getElementById("buttonBldFountain").setAttribute("style", "display:none");
} else {
document.getElementById("buttonBldFountain").style.display = 'block';
}
}
if (game.buildLevelGallows > 0) {
document.getElementById("buttonBldFountain").setAttribute("style", "display:none");
if (game.buildLevelGallows === config.maxLevelGallows) {
document.getElementById("buttonBldGallows").setAttribute("style", "display:none");
} else {
document.getElementById("buttonBldGallows").style.display = 'block';
}
document.getElementById("buttonDeathPenalty").style.display = 'block';
}
document.getElementById("btnHireHero").innerHTML = localeStrings[182].replace("%arg1",game.buildLevelInn).replace("%arg2",config.costHero);
Expand Down
7 changes: 0 additions & 7 deletions js/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -3334,13 +3334,6 @@
tResultArray = tArrayBeforeDeletedElement.concat(tArrayAfterDeletedElement);
return tResultArray;
}
function removeFromArrays (elementIndex) {
buildingsInTownB = deleteFromArray(buildingsInTownB, elementIndex);
buildingsInTownX = deleteFromArray(buildingsInTownX, elementIndex);
buildingsInTownY = deleteFromArray(buildingsInTownY, elementIndex);
buildingsInTownW = deleteFromArray(buildingsInTownW, elementIndex);
buildingsInTownH = deleteFromArray(buildingsInTownH, elementIndex);
}
var Singleton = (function () {
var instance;
function createInstance() {
Expand Down
6 changes: 3 additions & 3 deletions js/mech_tips_story.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ function gameChangePath() {
function gameChangePathCallback() {
if (answer === 2) {
if (game.buildLevelFountain>0) {
removeIndex = buildingsInTownB.indexOf('fountain');
removeIndex = buildingsInTown.indexOf('fountain');
}
if (game.buildLevelGallows>0) {
removeIndex = buildingsInTownB.indexOf('gallows');
removeIndex = buildingsInTown.indexOf('gallows');
}
removeFromArrays(removeIndex);
//removeFromArrays(removeIndex);
game.buildLevelFountain = 0;
game.buildLevelGallows = 0;
composite();
Expand Down
2 changes: 1 addition & 1 deletion langs/ru-RU.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ locObj.couldntRecordPledge = {"txt": "Кажется, что вы не зало
locObj.requiredArcheryRange = {"txt":"To do that, you need to build Archery Range", "loc":"happens when trying to hire turkopols if no archery range is built"};
locObj.requiredStables = {"txt": "Для этого вам нужно стрельбище", "loc":"happens when trying to hire sergeants if no stables built"};
locObj.requiredStablesUpgrade = {"txt": "Для этого нужно улучшить конюшни до %arg1 уровня", "loc":"happens when trying to hire knights and stables level too low"};
locObj.deadCounselorDemolish = {"txt":"Ваш советник умер.\nНовоиспеченный советник рекомендует вам\nпересмотреть выбор, сделанный в прошлом:\n-настало время, милорд, когда вы можете сделать выбор в пользу светлого будущего нашего города.\n-если вы согласны, %arg1 будет снесен, а на его месте мы построим %arg2", "loc":""}
locObj.deadCounselorDemolish = {"txt":"Ваш советник умер.\nНовоиспеченный советник рекомендует вам\nпересмотреть выбор, сделанный в прошлом:\n-настало время, милорд, когда вы решаете что лучше для нашего города.\n-если вы согласны, %arg1 будет снесен, а на его месте мы построим %arg2", "loc":""}
locObj.deadCounselorDemolishAnsYes = {"txt":"Да, сносим это здание", "loc":"Positive answer"}
locObj.buy = {"txt":"Купить", "loc":"На предмете для продажи Черного Рынка Гоблина"};
locObj.sell = {"txt":"Продать", "loc":"На предмете для продажи Черного Рынка Гоблина"};
Expand Down

0 comments on commit a41031b

Please sign in to comment.