Skip to content

Commit

Permalink
Merge pull request #186 from sh4rkman/dev
Browse files Browse the repository at this point in the history
legacy code rework
  • Loading branch information
sh4rkman authored Jul 31, 2024
2 parents c44fdc3 + 33b2393 commit 2825725
Show file tree
Hide file tree
Showing 22 changed files with 329 additions and 499 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# <img src="https://img.shields.io/badge/-minor%20release-cd6f68?style=for-the-badge"> **28.0.4** *(2024-07-31)*

<img src="https://img.shields.io/badge/-%20fix%20-orange"> Added missing translations on legacy mode

<img src="https://img.shields.io/badge/-%20fix%20-orange"> Fixed height calculations on legacy mode

<img src="https://img.shields.io/badge/-%20fix%20-orange"> Now hidding the classic cursor setting on touch screen

<img src="https://img.shields.io/badge/-%20fix%20-orange"> Fixed gorodok heightmap/zscaling

<img src="https://img.shields.io/badge/-%20improv%20-orange"> Code reworking

</br></br><!-- CHANGELOG SPLIT MARKER -->


# <img src="https://img.shields.io/badge/-minor%20release-cd6f68?style=for-the-badge"> **28.0.3** *(2024-07-26)*

<img src="https://img.shields.io/badge/-%20improv%20-orange"> Improved language loading mechanic
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
</h1>

<p align="center">
<a href="https://github.com/sh4rkman/SquadCalc/blob/master/LICENSE"><img src="https://img.shields.io/github/license/Naereen/StrapDown.js.svg?style=for-the-badge" alt="Licence"></a>
<img src="https://up.sharkman.info/api/badge/3/uptime/72?style=for-the-badge" alt="Uptime">
<a href="https://github.com/sh4rkman/SquadCalc?tab=MIT-1-ov-file#readme">
<img src="https://img.shields.io/github/license/Naereen/StrapDown.js.svg?style=for-the-badge" alt="Licence">
</a>
<a href="https://squadcalc.app">
<img src="https://up.sharkman.info/api/badge/3/uptime/72?style=for-the-badge" alt="Uptime">
</a>
</p>

<p align="center">
Expand Down
414 changes: 196 additions & 218 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "squadcalc",
"version": "28.0.3",
"version": "28.0.4",
"description": "A Complete Mortar Calculator for Squad",
"author": "Maxime 'sharkman' Boussard",
"license": "MIT",
Expand Down
5 changes: 4 additions & 1 deletion public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
"heightDiff": "Height Difference",
"outOfRange": "Target is out of range :",
"invalidMortar": "Invalid Weapon",
"invalidTarget": "Invalid Target"
"invalidTarget": "Invalid Target",
"invalidMortarTarget": "Invalid Weapon & Target",
"targetOutOfRange": "Target is out of range",
"targetTooClose" : "Target is too close"
}
5 changes: 4 additions & 1 deletion public/locales/fr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
"heightDiff": "Différence de hauteur",
"outOfRange": "La cible est hors de portée :",
"invalidMortar": "Arme invalide",
"invalidTarget": "Cible invalide"
"invalidTarget": "Cible invalide",
"invalidMortarTarget": "Arme & Cible invalides",
"targetOutOfRange": "Cible hors de portée",
"targetTooClose" : "Cible trop proche"
}
5 changes: 4 additions & 1 deletion public/locales/ru/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
"heightDiff": "Разница высот",
"outOfRange": "Цель вне дальности:",
"invalidMortar": "Недействительное оружие",
"invalidTarget": "Неверная цель"
"invalidTarget": "Неверная цель",
"invalidMortarTarget": "Инвалидное оружие и мишень",
"targetOutOfRange": "Цель находится вне зоны действия",
"targetTooClose" : "Цель слишком близко"
}
5 changes: 4 additions & 1 deletion public/locales/uk/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
"heightDiff": "Різниця висот",
"outOfRange": "Ціль знаходиться за межами дальності:",
"invalidMortar": "Недійсна зброя",
"invalidTarget": "Недійсна ціль"
"invalidTarget": "Недійсна ціль",
"invalidMortarTarget": "Непридатна зброя та мішень",
"targetOutOfRange": "Ціль поза зоною досяжності",
"targetTooClose" : "Ціль занадто близько"
}
5 changes: 4 additions & 1 deletion public/locales/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
"heightDiff": "高度差",
"outOfRange": "目标超出射程:",
"invalidMortar": "无效的武器",
"invalidTarget": "无效的目标"
"invalidTarget": "无效的目标",
"invalidMortarTarget": "取消武器和目标",
"targetOutOfRange": "目标超出范围",
"targetTooClose" : "目标太近"
}
Binary file modified public/maps/gorodok/heightmap.webp
Binary file not shown.
2 changes: 2 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ export function changeWeapon() {
App.minimap.updateTargets();
}


// TODO, move this uglyness to squadWeapons.js
export function changeShell(shell){

if ($(".dropbtn2").val() != 6) { return;}
Expand Down
28 changes: 1 addition & 27 deletions src/data/maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,207 +2,181 @@ export const MAPS = [
{
name: "AlBasrah",
size: 3040, // OK
offset: [0, 0],
scaling: 0.01294, // OK
mapURL: "/albasrah/",
maxZoomLevel: 4,
},
{
name: "Anvil",
size: 3060, //OK
offset: [0, 0],
scaling: 0.216675,
mapURL: "/anvil/",
maxZoomLevel: 4,
},
{
name: "Belaya",
size: 3904, //OK
offset: [0, 0],
scaling: 0.0726,
mapURL: "/belaya/",
maxZoomLevel: 4,
},
{
name: "BlackCoast",
size: 4600, // OK but not what mapdata gave us. Maybe because of x scaling?
offset: [0, 0],
scaling: 0.35,
mapURL: "/blackcoast/",
maxZoomLevel: 4,
},
{
name: "Chora",
size: 4064, // OK
offset: [0, 0],
scaling: 0.064,
mapURL: "/chora/",
maxZoomLevel: 4,
},
{
name: "Fallujah",
size: 3005, // OK
offset: [0, 0],
scaling: 0.0401, // OK
mapURL: "/fallujah/",
maxZoomLevel: 4,
},
{
name: "FoolsRoad",
size: 1774, // OK
offset: [0, 0],
scaling: 0.21600000000000003,
mapURL: "/foolsroad/",
maxZoomLevel: 4,
},
{
name: "GooseBay",
size: 4031, // OK
offset: [0, 0],
scaling: 0.22064, // OK
mapURL: "/goosebay/",
maxZoomLevel: 4,
},
{
name: "Gorodok",
size: 4064, // OK
offset: [200, 200],
scaling: 0.236,
scaling: 0.2, // OK
mapURL: "/gorodok/",
maxZoomLevel: 4,
},
{
name: "Jensen",
size: 4008, // OK
offset: [0, 0],
scaling: 0.0859, // OK
mapURL: "/jensen/",
maxZoomLevel: 4,
},
{
name: "Harju",
size: 4032, // OK
offset: [0, 0],
scaling: 0.131, // OK
mapURL: "/harju/",
maxZoomLevel: 4,
},
{
name: "Kamdesh",
size: 4032, // OK
offset: [0, 0],
scaling: 0.190215,
mapURL: "/kamdesh/",
maxZoomLevel: 4,
},
{
name: "Kohat",
size: 4617, // OK
offset: [0, 0],
scaling: 0.733125, // OK
mapURL: "/kohat/",
maxZoomLevel: 4,
},
{
name: "Kokan",
size: 2496, // OK
offset: [0, 0],
scaling: 0.0164,
mapURL: "/kokan/",
maxZoomLevel: 4,
},
{
name: "Lashkar",
size: 4334, // OK
offset: [0, 0],
scaling: 0.28215,
mapURL: "/lashkar/",
maxZoomLevel: 4,
},
{
name: "Logar",
size: 1761, // OK
offset: [0, 0],
scaling: 0.13575,
mapURL: "/logar/",
maxZoomLevel: 4,
},
{
name: "Manicouagan",
size: 4031, // OK
offset: [0, 0],
scaling: 0.3564,
mapURL: "/manicouagan/",
maxZoomLevel: 4,
},
{
name: "Mestia",
size: 2400,
offset: [0, 0],
scaling: 0.41028,
mapURL: "/mestia/",
maxZoomLevel: 4,
},
{
name: "Mutaha",
size: 2755, // OK
offset: [-70, -100],
scaling: 0.07071,
mapURL: "/mutaha/",
maxZoomLevel: 4,
},
{
name: "Narva",
size: 2800, // OK
offset: [-100, -100],
scaling: 0.0583,
mapURL: "/narva/",
maxZoomLevel: 4,
},
/*{
name: "Narva (f)",
size: 2800, // OK
offset: [-100, -100],
scaling: 0.0583,
mapURL: "/narva-flooded/{z}_{x}_{y}.webp",
maxZoomLevel: 4,
}, */
{
name: "Sanxian",
size: 4600,
offset: [0, 0],
scaling: 0.1892,
mapURL: "/sanxian/",
maxZoomLevel: 4,
},
{
name: "Skorpo",
size: 6869, // OK
offset: [0, 0],
scaling: 1.0927,
mapURL: "/skorpo/",
maxZoomLevel: 4,
},
{
name: "Sumari",
size: 1300, // OK
offset: [0, 0],
scaling: 0.035925,
mapURL: "/sumari/",
maxZoomLevel: 4,
},
{
name: "Tallil",
size: 4680, // OK
offset: [-200, -200],
scaling: 0.05275,
mapURL: "/tallil/",
maxZoomLevel: 4,
},
{
name: "Yehorivka",
size: 6350, // Not the SDK values weirdly
offset: [-8300, -8300],
scaling: 0.3332,
mapURL: "/yehorivka/",
maxZoomLevel: 4,
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ <h2 data-i18n="settings:SettingsTitle">Settings</h2>
<td data-i18n="settings:showMaxRange"></td>
</tr>

<tr>
<tr class="cursorChoiceSettings">
<td>
<label class="mcui-checkbox">
<input id="cursorChoiceSettings" type="checkbox">
Expand Down
1 change: 0 additions & 1 deletion src/js/ellipse.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ var Ellipse = Path.extend({
},

getBounds: function () {
// TODO respect tilt (bounds are too big)
var lngRadius = this._getLngRadius(),
latRadius = this._getLatRadius(),
latlng = this._latlng;
Expand Down
2 changes: 1 addition & 1 deletion src/js/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function loadLanguage() {
minimumResultsForSearch: -1, // Disable search
});

LANGUAGES.forEach(function(lng, i) {
LANGUAGES.forEach(function(lng) {
LANG_SELECTOR.append("<option value=\"" + lng[0] + "\">" + lng[1] + "</option>");
});

Expand Down
4 changes: 2 additions & 2 deletions src/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function loadSettings(){
}
else {
$("#keypadUnderCursorSettingRow").hide();
//$("#cursorChoiceSettings").hide();
$(".cursorChoiceSettings").hide();
App.userSettings.keypadUnderCursor = false;
}

Expand Down Expand Up @@ -262,7 +262,7 @@ $("#bearingOverDistanceSettings").on("change", function() {
}

// Update every targets to add/remove distance
App.minimap.updateTargets(); // TODO, don't update everything, just the marker content
App.minimap.updateTargets();
updatePreview();
});

Expand Down
Loading

0 comments on commit 2825725

Please sign in to comment.