Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
# Stracciatella Toolset

This is a prototye desktop application with the goal of being an editor for mods for JA2 Stracciatella.
A desktop application to create mods for JA2 Straccatella.

![Screenshow](docs/screenshot.jpg)

## Features

This app currently allows editing json data for JA2 Stracciatella only. Some JSONs might still be missing or broken.
This app currently allows editing json data for JA2 Stracciatella. Most json files are supported, although some might still be missing. Known missing files are:

- Dealer Inventories
- Translations

## Install

The best way to install the app is to download the latest release from the [releases page](https://github.com/ja2-stracciatella/stracciatella-toolset/releases).

## Development Setup

Install build dependencies:

- [NodeJS / NPM](https://nodejs.org/)
Expand All @@ -19,26 +28,34 @@ Clone the repo and install node dependencies:
npm install
```

## Starting Development
## Starting the App for Development

Start the app in the `dev` environment:

```bash
npm start
```

## Linting & Formatting
## Testing

Linting:
You can run the following commands:

Typechecking:

```bash
npm run tsc:check
```

Linting:

```bash
npm run lint
```

Auto-fix:
Tests (in watch mode):

```
npm run lint -- --fix
```bash
npm run test:watch
```

## Packaging the App
Expand Down
Binary file modified assets/icon.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
258 changes: 235 additions & 23 deletions assets/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icons/1024x1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icons/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icons/16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icons/24x24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icons/256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icons/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icons/48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icons/512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icons/64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icons/96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"description": "A foundation for scalable desktop apps",
"description": "A desktop application to create mods for JA2 Straccatella.",
"license": "MIT",
"version": "0.22.0",
"main": "./.erb/dll/main.bundle.dev.js",
Expand All @@ -19,7 +19,8 @@
"start:main": "concurrently -k \"cross-env NODE_ENV=development webpack --watch --config ./.erb/configs/webpack.config.main.dev.mts\" \"electronmon .\"",
"start:preload": "cross-env NODE_ENV=development webpack --config ./.erb/configs/webpack.config.preload.dev.mts",
"start:renderer": "cross-env NODE_ENV=development webpack serve --config ./.erb/configs/webpack.config.renderer.dev.mts",
"test": "cross-env NODE_ENV=development vitest --run"
"test": "cross-env NODE_ENV=development vitest run",
"test:watch": "cross-env NODE_ENV=development vitest watch"
},
"browserslist": [],
"prettier": {
Expand Down
8 changes: 4 additions & 4 deletions release/app/package-lock.json

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

11 changes: 5 additions & 6 deletions release/app/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "electron-react-boilerplate",
"version": "4.6.0",
"description": "A foundation for scalable desktop apps",
"name": "stracciatella-toolset",
"version": "0.22.0",
"description": "A desktop application to create mods for JA2 Straccatella.",
"license": "MIT",
"author": {
"name": "Electron React Boilerplate Maintainers",
"email": "electronreactboilerplate@gmail.com",
"url": "https://github.com/electron-react-boilerplate"
"name": "JA2 Stracciatella Team",
"url": "https://github.com/ja2-stracciatella"
},
"main": "./dist/main/main.js",
"scripts": {
Expand Down
42 changes: 23 additions & 19 deletions src-rust/src/invokables/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ pub enum ResourceEntry {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct List {
path: String,
mod_only: Option<bool>,
}

impl Invokable for List {
Expand All @@ -36,26 +38,28 @@ impl Invokable for List {
let selected_mod = state.try_selected_mod()?;
let mut result = HashSet::new();

let candidates = selected_mod.vfs.read_dir(&Nfc::caseless(&self.path)).ok();
for candidate in candidates.iter().flatten() {
let path = if self.path.is_empty() {
candidate.clone()
} else {
Nfc::caseless(&format!("{}/{}", self.path, candidate))
};
// Workaround to determine whether the candidate is a file
let is_file = selected_mod.vfs.open(&path).is_ok();
let entry = if is_file {
ResourceEntry::File {
path: candidate.to_string().to_lowercase(),
}
} else {
ResourceEntry::Dir {
path: candidate.to_string().to_lowercase(),
}
};
if !self.mod_only.unwrap_or(true) {
let candidates = selected_mod.vfs.read_dir(&Nfc::caseless(&self.path)).ok();
for candidate in candidates.iter().flatten() {
let path = if self.path.is_empty() {
candidate.clone()
} else {
Nfc::caseless(&format!("{}/{}", self.path, candidate))
};
// Workaround to determine whether the candidate is a file
let is_file = selected_mod.vfs.open(&path).is_ok();
let entry = if is_file {
ResourceEntry::File {
path: candidate.to_string().to_lowercase(),
}
} else {
ResourceEntry::Dir {
path: candidate.to_string().to_lowercase(),
}
};

result.insert(entry);
result.insert(entry);
}
}

let dir = selected_mod.data_path(&self.path);
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/renderer/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { renderWithTestProviders } from './test-utils/render';
import { it, describe, expect } from 'vitest';

describe('App', () => {
it('should render the configuration dialog when toolset is not configured', async () => {
it('should render loading as the default', async () => {
const { getByLabelText } = renderWithTestProviders(<AppWithoutProviders />);

await waitFor(() => {
Expand Down
Loading