Skip to content

Commit

Permalink
You can now select arcs for all ordnance and removed broadside 'disco…
Browse files Browse the repository at this point in the history
…unts' for ships in beta orientation.
  • Loading branch information
Perlkonig committed Apr 30, 2023
1 parent 4676200 commit 53863e2
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 30 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v3.5.0] - 2023-04-29

### Changed

* Normalized all the ordnance systems so you can select which three arcs the launcher targets. This change should be backwards compatible.

### Fixed

* Fixed all ordnance arc selectors so the blacked out rear arc is removed in beta orientation.
* The rules have some special "discounts" for some weapons (i.e., beams, Gatling batteries, and twin particle arrays) if they select one of the pairs of "broadside" arcs. While not explicit, it is logical that this only applies in alpha orientation. So the discount and arc auto-selection for those particular weapons have been disabled for ships in beta orientation.

## [v3.4.1] - 2023-04-28

### Added

* You can now load JSON files from the file system using a standard file input box, including drag and drop. Remember that all processing is local. No files are transferred. Error handling is minimal. (Many thanks to @shadowmouse for the pull request!)

## [v3.4.0] - 2023-04-25

### Added
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ftshipbuilder",
"private": true,
"version": "3.4.0",
"version": "3.5.0",
"description": "A web-based tool for generating valid Full Thrust ships",
"author": "Aaron Dalton <aaron@daltons.ca> (https://www.perlkonig.com)",
"license": "MIT",
Expand Down Expand Up @@ -40,7 +40,7 @@
"@zerodevx/svelte-toast": "^0.9.3",
"canvg": "^4.0.1",
"fast-xml-parser": "^4.2.0",
"ftlibship": "github:perlkonig/ftLibShip#v2.0.4",
"ftlibship": "github:perlkonig/ftLibShip#v2.1.0",
"lz-string": "^1.5.0",
"nanoid": "^4.0.2",
"robust-point-in-polygon": "^1.0.3",
Expand Down
12 changes: 10 additions & 2 deletions src/components/LoadShip.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
let modalLoadJSON: string;
let modalDelShip: string;
let shipJSON: string;
let fileInput;
let fileInput: HTMLInputElement;
const loadJSON = () => {
// strip leading whitespace
Expand All @@ -42,6 +42,7 @@
modalLoadJSON = undefined;
compatCheck();
toast.push("Ship loaded");
clearLoadJSON();
} catch (e) {
toast.push("Invalid JSON provided", {});
}
Expand All @@ -52,12 +53,19 @@
modalLoadJSON = undefined;
compatCheck();
toast.push("Ship loaded");
clearLoadJSON();
} catch (e) {
toast.push("Invalid code provided");
}
}
}
const clearLoadJSON = () => {
modalLoadJSON = "";
shipJSON = null;
fileInput.value = null;
}
const readConfigJson = (e) => {
let file = e.target.files[0];
let reader = new FileReader();
Expand Down Expand Up @@ -183,7 +191,7 @@
</section>
<footer class="modal-card-foot">
<button class="button is-success" on:click="{loadJSON}">Load Ship</button>
<button class="button" on:click="{() => modalLoadJSON = ""}">Cancel</button>
<button class="button" on:click="{clearLoadJSON}">Cancel</button>
</footer>
</div>
</div>
Expand Down
37 changes: 16 additions & 21 deletions src/components/SysDisplay.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -108,44 +108,39 @@
prop={prop}
idx={idx}
/>
{:else if ( (sys.name === "missile") || (sys.name === "salvo") ) }
<Modifier
prop={prop}
idx={idx}
choices={[["er", "Long Range"], ["twostage", "Multistage"]]}
/>
{:else if sys.name === "mkp"}
<ArcSingle
prop={prop}
idx={idx}
/>
{:else if sys.name === "rocketPod"}
{:else if ( (sys.name === "rocketPod") || (sys.name === "missile") || (sys.name === "salvo") || (sys.name === "salvoLauncher" ) || (sys.name === "amt") )}
{#if ( (sys.name === "missile") || (sys.name === "salvo") )}
<Modifier
prop={prop}
idx={idx}
choices={[["er", "Long Range"], ["twostage", "Multistage"]]}
/>
{/if}
<Arcs
prop={prop}
idx={idx}
minArcs={3}
maxArcs={3}
arcBlacklist={["A"]}
/>
arcBlacklist={$ship.orientation === "beta" ? [] : ["A"]}
/>
{#if sys.name === "salvoLauncher"}
<Magazine
prop={prop}
idx={idx}
/>
{/if}
{:else if sys.name === "ads"}
<Arcs
prop={prop}
idx={idx}
minArcs={3}
maxArcs={6}
/>
{:else if sys.name === "salvoLauncher"}
<Arcs
prop={prop}
idx={idx}
minArcs={3}
maxArcs={3}
arcBlacklist={["A"]}
/>
<Magazine
prop={prop}
idx={idx}
/>
{:else if ( (sys.name.startsWith("spinal")) && (sys.name !== "spinalNova") && (sys.name !== "spinalWave") ) }
<Range
prop={prop}
Expand Down

0 comments on commit 53863e2

Please sign in to comment.