Skip to content

Commit

Permalink
Merge 3e6db87 into release
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Jun 27, 2022
2 parents 75ecf14 + 3e6db87 commit 9f56fa2
Show file tree
Hide file tree
Showing 27 changed files with 610 additions and 99 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
Expand Down
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"rust-analyzer.cargo.unsetTest": [
"core",
"derivative" // TODO.upstream remove this https://github.com/rust-lang/rust-analyzer/issues/7459
]
}
File renamed without changes.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

Tiger is a graphical tool for generating spritesheets and metadata about the animation and hitboxes they contain.

![Tiger](res/readme/screenshot-0.2.0.png?raw=true "Tiger")
![Tiger](res/readme/screenshot-0.4.0.png?raw=true "Tiger")

# Key Features

- Timeline-editing for authoring animations
- Easy to add and position hitboxes
- Support for custom formats when exporting metadata
- Use custom formats when exporting spritesheet metadata
- Generated texture atlas for use in-engine
- Free and open-source with a permissive license

⚠️ This project is under development. It is already usable and is generating spritesheets for [Project Crystal](https://github.com/agersant/crystal). However, you should come back in a few months if you are looking for a polished experience!
⚠️ This project is under development.

# Getting Started

Expand Down
45 changes: 26 additions & 19 deletions Roadmap.md → ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@

- [x] UI rewrite (prettier)
- [x] In-place rename UX
- [x] Right click menu to rename item
- [x] Right click menu to delete item
- [x] Filter frames/animations in content panel by text search
- [x] Can display frames in thumbnail or list mode
- [x] Add option to hide origin
- [x] Add option to hide hitboxes
- [x] Add option to lock hitboxes
- [x] Add readability mode
- [x] Edit hitbox offset and size from details panel
- [x] Edit keyframe duration and offset from details panel
- [x] Support multiple directions/angles for the same animation
Expand All @@ -113,35 +113,43 @@
- [x] Add toggle to hide keyframes (replaces linking/locking)
- [x] Add sprite darkening readility mode
- [x] Workbench tabs
- [ ] Replace powershell release script with Github action
- [x] Copy/paste animations
- [x] Copy/paste keyframes
- [x] Copy/paste hitboxes
- [x] Replace powershell release script with Github action
- [x] Unit test sheet module

## Tiger 0.5

- [ ] Export process creates intermediate directories if needed
- [ ] Error dialog specifies problematic path when export fails due to IO problem
- [ ] Angle in liquid template sequence data
- [ ] Nicer looking paths in export settings (no concat)
- [ ] Nicer looking paths in export settings (no ../ concat)
- [ ] Consider merging some code between save, save_as and save_all
- [ ] Automatically add extensions to exported files
- [ ] Default paths for NFD dialogs
- [ ] Add menu entry to open recent files
- [ ] Export perf improvements
- [ ] Duplicate animation / keyframe (within same sheet)
- [ ] Copy/paste hitboxes
- [ ] Rework content browser: view animations and frames at the same time, possibly with previews?
- [ ] Unit test timeline commands
- [ ] Unit test transient commands

## Tiger 0.6

- [ ] Tooltips everywhere
- [ ] Add buttons to align frame edges or center to origin
- [ ] Draw hitbox names in workbench
- [ ] Playback speed controls
- [ ] Time snapping of animation frames
- [ ] Fix bug where when zoomed in a lot, resize handles on hitboxes arent correctly centered
- [ ] Time snapping / quantizing of animation frames
- [ ] Fix bug where when zoomed in a lot, resize handles on hitboxes are not correctly centered

## Tiger 0.7

- [ ] Right click menu to rename item
- [ ] Export dialog links to documentation
- [ ] Export perf improvements
- [ ] Can zoom workbench with mousewheel
- [ ] Can zoom timeline with mousewheel
- [ ] Can scroll timeline with mousewheel
- [ ] Backend keeps track of frames pane scroll position in undo stack
- [ ] Backend keeps track of animations pane scroll position in undo stack
- [ ] Backend keeps track of timeline scroll position in undo stack

## Tiger 0.8

Expand All @@ -153,23 +161,23 @@

- [ ] Timeline scrolling follows playback
- [ ] Timeline scrolling follows frame selection (or double click?)
- [ ] Can scroll timeline with mousewheel
- [ ] Backend keeps track of content pane scroll position in undo stack
- [ ] Backend keeps track of timeline scroll position in undo stack
- [ ] Fix jank spacing in exported metadata files
- [ ] Export complete notification
- [ ] Unit test UI
- [ ] Document template format
- [ ] Export dialog links to documentation
- [ ] Auto-updates
- [ ] Splash screen

## Tiger 1.0

- [ ] Review all TODO
- [ ] Tiger file format uses semver
- [ ] Remove support for pre-1.0 versions of Tiger file format
- [ ] Provide export templates for some common formats (TBD)
- [ ] Document template format
- [ ] Readme Logo
- [ ] Readme logo
- [ ] About dialog
- [ ] App icon
- [ ] App icon (file explorer, taskbar, add/remove programers, installer, title bar)
- [ ] Itch.io or other distribution method

## Post 1.0
Expand All @@ -182,7 +190,6 @@
- [ ] Import animation data from other software (Asesprite, TBD)
- [ ] Sockets (like hitbox but point)
- [ ] Events (arbitrary markers on timeline)
- [ ] Copy/paste animation or keyframe (between sheets)
- [ ] Drag and drop frames from OS to content panel
- [ ] Drag and drop frames from OS to content panel
- [ ] Drag and drop frames from OS to timeline panel
- [ ] Projects?
Binary file added res/readme/screenshot-0.4.0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions src-tauri/Cargo.lock

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

3 changes: 2 additions & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ image = "0.24"
json-patch = "0.2.6"
liquid = "0.26"
notify = "4.0"
regex = "1.5.6"
pathdiff = "0.2.1"
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.0.0", features = ["dialog-open", "dialog-save", "protocol-asset", "window-close", "window-maximize", "window-minimize", "window-start-dragging", "window-unmaximize"] }
tauri = { version = "1.0.0", features = ["clipboard", "clipboard-read-text", "clipboard-write-text", "dialog-open", "dialog-save", "protocol-asset", "window-close", "window-maximize", "window-minimize", "window-start-dragging", "window-unmaximize"] }
texture_packer = "0.24"
thiserror = "1.0"

Expand Down
87 changes: 72 additions & 15 deletions src-tauri/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use euclid::vec2;
use json_patch::Patch;
use std::path::PathBuf;
use std::time::Duration;
use tauri::ClipboardManager;

use crate::dto::{self, ToFileName};
use crate::export::export_sheet;
Expand Down Expand Up @@ -328,6 +329,56 @@ pub fn redo(app_state: tauri::State<'_, AppState>) -> Result<Patch, ()> {
}))
}

#[tauri::command]
pub fn cut(
tauri_app: tauri::AppHandle,
app_state: tauri::State<'_, AppState>,
) -> Result<Patch, ()> {
Ok(app_state.mutate(|app| {
if let Some(data) = app.current_document().and_then(|d| d.copy()) {
if let Ok(serialized) = serde_json::to_string(&data) {
let mut clipboard = tauri_app.clipboard_manager();
clipboard.write_text(serialized).ok();
}
}
if let Some(document) = app.current_document_mut() {
document.process_command(Command::DeleteSelection).ok();
}
}))
}

#[tauri::command]
pub fn copy(
tauri_app: tauri::AppHandle,
app_state: tauri::State<'_, AppState>,
) -> Result<Patch, ()> {
Ok(app_state.mutate(|app| {
if let Some(data) = app.current_document().and_then(|d| d.copy()) {
if let Ok(serialized) = serde_json::to_string(&data) {
let mut clipboard = tauri_app.clipboard_manager();
clipboard.write_text(serialized).ok();
}
}
}))
}

#[tauri::command]
pub fn paste(
tauri_app: tauri::AppHandle,
app_state: tauri::State<'_, AppState>,
) -> Result<Patch, ()> {
Ok(app_state.mutate(|app| {
let clipboard = tauri_app.clipboard_manager();
if let Ok(Some(serialized)) = clipboard.read_text() {
if let Ok(data) = serde_json::from_str(&serialized) {
if let Some(document) = app.current_document_mut() {
document.process_command(Command::Paste(data)).ok();
}
}
}
}))
}

#[tauri::command]
pub fn set_frames_list_mode(
app_state: tauri::State<'_, AppState>,
Expand Down Expand Up @@ -1387,31 +1438,37 @@ pub fn cancel_export_as(app_state: tauri::State<'_, AppState>) -> Result<Patch,

#[tauri::command]
pub async fn end_export_as(app_state: tauri::State<'_, AppState>) -> Result<Patch, ()> {
let mut patch = app_state.mutate(|app| {
if let Some(document) = app.current_document_mut() {
document.process_command(Command::EndExportAs).ok();
}
});

let (sheet, document_name) = {
let app = app_state.0.lock().unwrap();
match app.current_document() {
Some(d) => (d.sheet().clone(), d.path().to_file_name()),
_ => return Ok(Patch(Vec::new())),
_ => return Ok(patch),
}
};

let result = tauri::async_runtime::spawn_blocking(move || export_sheet(&sheet))
.await
.unwrap();

Ok(app_state.mutate(|app| match result {
Ok(_) => {
if let Some(document) = app.current_document_mut() {
document.process_command(Command::EndExportAs).ok();
}
let mut additional_patch = app_state.mutate(|app| {
if let Err(e) = result {
app.show_error_message(
"Export Error".to_owned(),
format!(
"An error occured while trying to export `{}`",
document_name.to_file_name(),
),
e.to_string(),
);
}
Err(e) => app.show_error_message(
"Export Error".to_owned(),
format!(
"An error occured while trying to export `{}`",
document_name.to_file_name(),
),
e.to_string(),
),
}))
});

patch.0.append(&mut additional_patch.0);
Ok(patch)
}
2 changes: 2 additions & 0 deletions src-tauri/src/dto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ pub struct Animation {
sequences: HashMap<Direction, Sequence>,
direction_preset: Option<DirectionPreset>,
is_looping: bool,
key: Uuid,
}

#[derive(Clone, Copy, Deserialize, Eq, PartialEq, Hash, Serialize)]
Expand Down Expand Up @@ -356,6 +357,7 @@ where
.collect(),
direction_preset: animation.1.direction_preset().map(|p| p.into()),
is_looping: animation.1.looping(),
key: animation.1.key(),
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ fn main() {
api::save_as,
api::undo,
api::redo,
api::cut,
api::copy,
api::paste,
api::set_frames_list_mode,
api::filter_frames,
api::filter_animations,
Expand Down
Loading

0 comments on commit 9f56fa2

Please sign in to comment.