Commit Graph

24 Commits

Author SHA1 Message Date
Cidwel Highwind 3366db0ad9 Diagnose Analyze silent failure when sourceImage is nil 2026-04-05 14:02:36 +02:00
Cidwel Highwind 6a97dbd527 Fix preview window growing on mode switch
Don't close/reopen preview when cycling All/One/Static modes.
Just update button labels and repaint in place, preserving window
size and position. Remove unused pvWinW/H saved size system.
Fit still reopens with calculated content size (All/One only).
2026-04-04 14:27:52 +02:00
Cidwel Highwind 3517e65294 Allow left-click drag to scroll in Static preview mode 2026-04-04 13:30:12 +02:00
Cidwel Highwind 222a36623e Remember preview window size per mode (All/One/Sta), per preset
- Each mode stores its own window width/height in the preset file
- Switching modes saves current bounds and reopens with saved size
- Fit clears saved size to recalculate from content
- Button order: Mode → Fit → Setup; "Sta" renamed to "Static"
2026-04-04 13:29:21 +02:00
Cidwel Highwind df9a2a3dcf Fix sprite.version crash and stale anim name on preset switch
- Remove app.sprite.version (doesn't exist in Aseprite API), use
  filename + frame number + periodic refresh every 2.5s for edits
- Clamp previewSingleIdx and update pvAnimName label when switching
  presets, so One mode doesn't show names from another preset
2026-04-04 13:17:56 +02:00
Cidwel Highwind ca3f760d87 Fix Sta mode: no auto-size window, lazy refresh on sprite change only
- calcPreviewSize ignores Sta mode, uses All sizing (no giant window)
- Refresh timer in Sta only calls refreshSource when sprite version or
  frame changes, not every 0.5s
- Initial refreshSource on entering Sta mode
2026-04-04 13:04:06 +02:00
Cidwel Highwind b2a333405a Fix Sta mode 100% CPU: skip checkerboard, skip idle repaints
- Replace pixel-by-pixel checkerboard with solid bg in Sta mode
- Animation timer skips repaint in static mode (no animation)
- Refresh timer only repaints Sta when source image actually changes
2026-04-04 12:52:43 +02:00
Cidwel Highwind 83645dbeae Add scroll/pan support for Sta preview mode
- Right-click drag to pan the canvas in static mode
- Scroll position (X/Y) persisted across sessions
- Uses independent zoom and scroll settings from One/All modes
2026-04-04 12:42:34 +02:00
Cidwel Highwind 00511eb8c1 Add Sta (static) preview mode: shows raw sprite canvas
- Preview mode now cycles All → One → Sta
- Sta mode renders the full sprite without animations, with its own zoom
- Fit button disabled in Sta mode
- Mode toggle no longer closes/reopens window (preserves position)
2026-04-04 12:39:32 +02:00
Cidwel Highwind 68557e2a21 Fix lock file: timestamp-based staleness, periodic refresh
- Lock file now contains a timestamp, refreshed every 0.5s
- Stale locks (>5s old) are ignored and cleaned up automatically
- Fixes: Aseprite crash leaving orphan lock, lock not cleaned on close
- Silent ignore still works for active instances
2026-04-03 21:32:21 +02:00
Cidwel Highwind c6b4ff17e1 Instant preset switch, silent lock, fractional zoom
- Preset combobox now loads preset instantly on selection (no OK needed)
- Lock file silently prevents duplicate instances (no alert popup)
- Zoom supports fractional levels (0.125x, 0.25x, 0.5x) for large tilesets
- All zoom handlers use zoomStep() with predefined level table
2026-04-03 21:16:07 +02:00
Cidwel Highwind 673e114753 Prevent preview window repositioning on file/preset changes
- Remove all automatic preview window close+reopen on file change
- Remove preview reopen from preset New/Clone/Rename/Delete actions
- Preview title may be stale after preset change but window stays in place
- User can press Fit to update title when desired
2026-04-03 20:46:15 +02:00
Cidwel Highwind 67edfb0b1d Round 8: preset UX improvements, lock file, auto-save
- Preset combobox now reflects current preset correctly
- Selecting different preset in Config auto-loads it on OK
- Preset buttons changed to: New, Clone, Rename, Delete (removed Save/Load)
- New creates preset with default values
- Clone copies current preset state to new name
- Rename changes preset name and updates file associations
- Delete removes preset (Default protected) and switches to Default
- Window titles show preset: "AniPhallow (PresetName)"
- Lock file prevents duplicate plugin instances
- Auto-save (saveAll) called on every state-modifying action
- addPresetName/removePresetName helpers for sorted preset list
2026-04-03 20:35:59 +02:00
Cidwel Highwind 9e3a2702dc Round 7: presets system, file associations, plugin toggle
Major features:
- Presets system: save/load/clone/delete animation configurations
  - Each preset stored as .ini in ~/.config/aseprite/aniphallow_presets/
  - Master file tracks global prefs and file-to-preset associations
  - Config dialog has Presets section with combobox + Save/Load/Clone/Delete
  - Default preset created automatically on first run
  - Migration from old single prefs file to preset system
- File-to-preset association: each .aseprite file remembers its preset
  - Auto-detects file changes and loads appropriate preset
  - Preset association saved when loading a preset
- Plugin toggle: running the plugin again closes it (no duplicate windows)
- Preview title fixed to "AniPhallow Preview" (always)
- Animation name label shown below canvas in Show One mode
- Show One navigation (L/R click) no longer closes/reopens window
- Config dialog reorganized: Presets > Animations > Optimization > Preview
2026-04-03 19:56:31 +02:00
Cidwel Highwind 91af5f5691 Round 6: compact preview, Optimize tab, deselect, click improvements
- Remove Preview toggle button from main dialog (preview is primary)
- Preview buttons compact: Setup / All|One / Fit on single row
- Preview navigation: L-click=prev, R-click=next in single mode
- Preview title: "AniPhallow: All" or "AniPhallow: <name>"
- Rename GB tab to Optimize, config labels updated accordingly
- Combined separator texts: Source || Frames, Source || Optimized
- GB canvases taller (240px each) to match Animations tab
- Optimized canvas: candidate-based click with offset/silhouette support
- R-click deselects in both Occurrences and Optimized canvases
- Frame strip: L-click on selected frame deselects it
- Remove view height config options (didn't work)
- Clean up stale IDs (lblFrames, lblGbOpt, tabPreview)
2026-04-03 19:01:56 +02:00
Cidwel Highwind b9b54867f1 Preview: independent zoom per mode, Show One, nav row, Adjust button
- Independent zoom for Show All and Show One modes (saved separately)
- "Single" button renamed to "Show One"
- <- -> navigation buttons on a new row (not inline with Setup/Show One)
- Animation name label shown below canvas in Show One mode
- Adjust button at bottom re-fits preview window to content size
- previewZoomAll and previewZoomOne saved/loaded in prefs
2026-04-03 17:47:04 +02:00
Cidwel Highwind fa6c3d3615 Round 5: preview layout config, single/all mode, offset indicator
- Frame offset indicator: cyan dot on thumbnails when offX/offY != 0
- GB canvases taller (220px each) to match Animations tab height
- Preview layout config: auto/fixedCols/fixedRows with value setting
- Preview Show All/Single toggle with <- -> navigation in single mode
- Preview canvas resizes responsively on zoom and mode change
- calcPreviewSize() and getPreviewGrid() helpers for layout math
- Preview zoom and mode saved/loaded in preferences
- previewSingleIdx clamped on load and mode switch
2026-04-03 17:24:07 +02:00
Cidwel Highwind cdeefd642d Round 4: two-window architecture, preview-first launch
- Plugin now opens Preview Window first on launch (primary view)
- Preview window has "Setup" button to open the Main Dialog
- Main dialog tabs: [Animations] [GB] + [Preview] toggle button
- Preview button toggles separate preview window on/off
- Tab order: Animations, GB, Preview (GB is now second)
- Removed embedded Preview tab content (redundant with window)
- Fix Analyze nil compare error (GB_OPT_H now module-level)
- Labels changed to separators for consistent styling
- Frames label: "Frames (L-click=select, R-click=remove, drag=reorder)"
- GB canvases taller (200px each) to match Animations tab height
- refreshSource() moved to module level for both windows
- getFrameImageGlobal() at module level for shared access
- Cross-dialog updates (preview close updates main dialog button)
- Preview window has its own refresh timer for source updates
2026-04-03 16:57:45 +02:00
Cidwel Highwind 99ca77ef3b Round 3: frame offsets, compact layout, auto-reopen preview
- Remove preview selection/offset buttons (reverted jump feature)
- Add per-frame pixel offsets (Up/Down/Left/Right/Reset) in Animations
  tab for visual jump effects without creating extra tiles
- Frame offsets applied in all previews (main + separate window)
- Remove separator between Source and Frames canvases for compact layout
- Move "Frames" label below frames canvas, remove action separator
- Shared zoom between Source and Frames canvases (wheel affects both)
- Separate preview window: content-based sizing instead of copying main
- Remember and auto-reopen separate preview window on plugin launch
- GB: both Occurrences and Optimized canvases same height (150px)
- GB: remove separator between canvases, label below Optimized
- GB: shared zoom between both canvases
- Config: remove view heights options (didn't work)
2026-04-03 16:29:39 +02:00
Cidwel Highwind 6449f20a35 UX round 2: clone, preview offsets, configurable views, GB tile W/H
- Animation buttons renamed to +/-/Rename/Clone for compact layout
- Clone button: copy animation with optional Flip X on all frames
- Frame buttons renamed to FlipX/FlipY/<-/->/Del to save width
- Pixel-perfect integer scaling for frame thumbnails (THUMB_SIZE=24)
- Source canvas taller by default (400px) and configurable in Config
- Preview tab: L-click selects animation, Up/Down/Left/Right/Reset
  buttons offset sprites visually for jump effects (preview-only)
- Preview offsets also apply in separate preview window
- Config: Zoom removed (wheel only), labels Sprite W/H, GB Tile W/H
  separate, three view height options (Source/Occurrences/Optimized)
- Config button visible on all tabs (not just Animations)
- GB: Silhouette checkbox before Compress, separator text L-click=select
- GB: clicking already-selected tile in Optimized deselects it
- GB tile analysis fully supports non-square tiles (W != H)
- Copy to clipboard: fixed white background on transparent areas
- Tab mismatch fix: always opens on Animations tab
2026-04-03 15:56:12 +02:00
Cidwel Highwind e805e75925 Major UX overhaul: combobox anims, configurable tile size, UI cleanup
- Replace animation buttons with alphabetically-sorted combobox
- Add Rename animation button, remove Move Up/Down buttons
- Remove Clear Anim button; enhance Remove to delete last frame or animation
- Fix frame thumbnails aspect ratio (no longer squished)
- Remove Preview section from Animations tab
- Add Separate Window button to Preview tab for detachable preview
- Rename GB buttons: Analyze, Find similars, Threshold
- Reorder GB tab: Occurrences in Source before Optimized Spritesheet
- Change Optimized canvas to L-click select (was R-click)
- Add click-to-select on Source occurrences canvas with layer overlap cycling
- Make GB tile size configurable in Config (default 8x8)
- Parameterize all hash/analysis functions with tile size
- Fix Copy to Clipboard to preserve transparency
- Remove source viewport height/auto-resize options
- Remove Close button from dialog
- Fix tab mismatch on plugin open
- Fix spacing issues on Preview and GB tabs
- Change hints to L-click/R-click
- Save currentAnimName instead of index for robust prefs
2026-04-03 15:00:23 +02:00
Cidwel Highwind 0c1d5d9c90 Improve animations tab, fix Save as Layer, and enhance GB similarity colors
- Fix Save as Layer: convert image to sprite color mode before creating cel
- Remove "Selected ->" label (brackets on buttons suffice)
- Add Remove button and right-click to remove frames in strip
- Add Move Animation Up/Down buttons for reordering animations
- Add configurable source viewport height and auto-resize with zoom
- Rename GB buttons: Analyze Duplicates, Analyze Similars, Similarity >=X%
- Reorder GB buttons: Analyze -> Similars -> Similarity threshold
- Use distinct colors per group for similar tile highlighting (union-find)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 13:46:31 +02:00
Cidwel Highwind 534fc09da3 Major UI overhaul and bug fixes
- Fix Save Layer creating empty layers (clone image before creating cel)
- Fix Copy to Clipboard (use MaskAll instead of SelectAll)
- Remove Layer saved alert dialog
- Rename tabs: Setup to Animations, Render to Preview
- Config button now visible on all tabs
- Animation selection: Add/Remove buttons, brackets on selected, Selected label
- Delete animation now asks for confirmation
- Source canvas: left-click add or scroll drag, mouse wheel zoom
- Frames strip: click to select, drag and drop to reorder frames
- New frame actions: Flip X, Flip Y, Move Left, Move Right, Clear Anim
- Added vertical flip support for frames
- Removed destructive Clear All button
- Added Preview canvas in Animations tab with wheel zoom
- Updated all hint labels to be more descriptive
- Backward-compatible prefs migration for old tab names

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 13:14:10 +02:00
Cidwel Highwind 23d74a6f2a Initial commit: add aniphallow.lua Aseprite tool
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 12:11:29 +02:00