Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Commit

Permalink
Things you didn't know you needed.
Browse files Browse the repository at this point in the history
More performance improvements.
Reduced memory usage of Ahorn a bit.
Updated controls in the README. Please read it. It's good now.
Added option to disable parallax preview by double clicking it.
Added smoothening when drawing with brushes. Should feel much nicer now.
Added Fade X and Fade Y to parallax in stylegrounds window.
Added colour to windsnow styleground effect.
Added Cutscene Node entity.
Added hotkeys to zoom in and out.
Added hotkeys to rotate tiles and entities.
Added hotkeys to flip tiles, entities, and areas.
Added hotkey to clear the selection.
Inverted the rotation of brushes to be consistent with the rest.
Improved behaviour when using keyboard shortcuts in selection tool.
Improved selection previews in selection tool.
Fixed middle clicking entities/triggers.
Fixed effects having the wrong fields sometimes.
Fixed weird alpha issues with tilesets.
Unknown tiles are actually being rendered now.
Warnings on bad XML files are now more visible.
Update window should now be less confusing.

Added better error messages to ahorn.bat
Added launch arguments to ahorn.bat
Julia detection in ahorn.bat is better now.
Please download the new ahorn.bat

For plugin developers:
You can now sort your plugins into subfolders. Organize!
You can now put plugins in a "libraries" folder.
 Libraries are loaded before any other plugins.
 Makes it easy to share code across multiple files and mods.
Added Ahorn.editingOrder() and Ahorn.editingIgnored() to entities, triggers, and effects.
Added Ahorn.moved() and Ahorn.deleted() to entities and triggers.
 Implement Ahorn.moved() instead of moved(). moved() has been deprecated.
Added Ahorn.resized(), Ahorn.flipped(), and Ahorn.rotated() to entities and triggers.
Entity placement and resizing now respect Ahorn.canResize() better.
Improved loading of plugins in zip files.
Improved error messages from plugins.

Co-authored-by: Vexatos <[email protected]>
  • Loading branch information
Cruor and Vexatos committed Oct 23, 2020
1 parent dd0dbf0 commit 79f17dd
Show file tree
Hide file tree
Showing 46 changed files with 1,430 additions and 449 deletions.
109 changes: 75 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,40 +43,81 @@ Hold right click to move around the map. Left click is your main way to place an
In any menu, you can hover over the name of an option or field for a detailed tooltip explaining its meaning and usage.

Ahorn supports a couple of keybinds and special mouse functionality, with more to come. The following list might not be comprehensive.
- Ctrl + t: New room
- Ctrl + shift + t: Configure current room
- Ctrl + n: New map
- Ctrl + m: Metadata window
- Ctrl + shift + alt + s: Open settings window
- q, e: shrink / grow width on selected
- a, d: shrink / grow height on selected
- Arrow keys: move selected
- Left mouse button over selected: dragging selected
- Holding ctrl + any of the above: use 1 as step size instead of 8 for more fine-grained placements
- Shift selecting keeps previous selection as well
- Ctrl + f: Focus search field
- Ctrl + c: Copy selection
- Ctrl + x: Cut selection
- Ctrl + v: Paste selection
- Ctrl + z: Undo changes
- Ctrl + shift + z: Redo changes
- Esc/Enter: Exit search field
- v, h: vertical / horizontal mirror of decal
- r: Rotate selected brush
- delete: delete the given node / target
- n/+: add node to target (after the targeted node / entity)
- Middle click: pick what's currently under the cursor in the selected layer
- Ctrl + number key row 0-9: shortcuts to select tools
- Alt + arrow keys: move a room
- Alt + delete: delete room
- Double click layer name in selection menu: toggle visibility
- Double click material name in tools: toggle favourite
- Right click entity / trigger with placements / selection tool: open properties menu
- Double click with selections selects all similar targets
- Holding ctrl when doing the above restricts it to targets in a more strict manner

With Everest installed and Celeste running in debug mode, it supports some more:
- Ctrl + alt + leftclick on a room in Ahorn: teleport to that room in the game

---

#### General Controls

- Ctrl + N: New map
- Ctrl + S: Save map
- Ctrl + Shift + S: Save map as...
- Ctrl + T: New room
- Ctrl + Shift + T: Configure current room
- Alt + Arrow keys: Move room
- Alt + Delete: Delete room
- Right click & drag: Move around the map
- Ctrl + M: Metadata window
- Ctrl + Shift + Alt + S: Open settings window
- Ctrl + Z: Undo action
- Ctrl + Shift + Z: Redo action
- Ctrl + F: Focus search field
- Return in search field: Exit and clear search field
- Escape in search field: Exit search field
- Scroll wheel: Zoom
- Ctrl + ➕ (plus): Zoom in
- Ctrl + ➖ (minus): Zoom out
- Double Left click material name in tools: Toggle favourite
- Double Left click preview in stylegrounds window: Toggle preview
- Ctrl + number key row 0-9: Shortcuts to select tools

#### Placements

- Left click: Place object
- Holding Ctrl + Left click: Use 1 as step size instead of 8 for more fine-grained placements
- Right click: Open properties of object under cursor
- Left click & drag: Adjust size of resizeable objects while placing
- Middle click: Clone object under cursor
- Q, E: Shrink / grow width on decal
- A, D: Shrink / grow height on decal
- L, R: Rotate supported objects counter-clockwise / clockwise
- V, H: Flip supported objects vertically / horizontally

#### Selections

- Left click & drag: Select objects
- Shift + Left click & drag: Add to current selection
- Right click selection: Open properties of selected object(s)
- Holding Left mouse button over selection: Drag selected objects
- Double Left click: Select all similar objects
- Ctrl + Double Left click: Select all similar objects but more strict
- Arrow keys: Move selected objects
- Q, E: Shrink / grow width on selected entities/triggers
- A, D: Shrink / grow height on selected entities/triggers
- Holding Ctrl + any of the above: use 1 as step size instead of 8 for more fine-grained control
- L, R: Rotate supported objects counter-clockwise / clockwise
- V, H: Flip supported objects vertically / horizontally
- Shift + V / Shift + H: Flip selected area vertically / horizontally
- N or ➕ (plus) on entity/trigger: Add starting node to entity/trigger
- N or ➕ (plus) on node: Add node to entity/trigger after selected node
- Delete: Delete selected object(s)
- Return or Escape: Clear selection
- Ctrl + C: Copy selection
- Ctrl + X: Cut selection
- Ctrl + V: Paste selection

#### Brushes

- Left click: Place brush
- Left click & drag: Drag brush
- Middle click: Change material to tile under cursor
- L, R: Rotate supported brush counter-clockwise / clockwise

#### Everest Integration

With Everest installed and Celeste running in debug mode, it supports some more:
- Ctrl + Alt + Left click on a room in Ahorn: Teleport to that room in the game

---

If you are serious about making maps, it is highly recommended to use [Everest](https://github.com/EverestAPI/Everest) for the F5 (force map reload) and F6 (open map editor for the current map) features.

Expand Down
175 changes: 153 additions & 22 deletions ahorn.bat
Original file line number Diff line number Diff line change
@@ -1,20 +1,89 @@
@echo off
@echo off
setlocal EnableDelayedExpansion

set minimum_version="v\"1.3.0\""
set julia_url_64bit=https://julialang-s3.julialang.org/bin/winnt/x64/1.4/julia-1.4.1-win64.exe
set julia_url_32bit=https://julialang-s3.julialang.org/bin/winnt/x86/1.4/julia-1.4.1-win32.exe
set julia_filename=julia-1.4.1-installed.exe
set julia_url_64bit=https://julialang-s3.julialang.org/bin/winnt/x64/1.5/julia-1.5.2-win64.exe
set julia_url_32bit=https://julialang-s3.julialang.org/bin/winnt/x86/1.5/julia-1.5.2-win32.exe
set julia_filename=julia-1.5.2-installed.exe
set install_url=https://raw.githubusercontent.com/CelestialCartographers/Ahorn/master/install_ahorn.jl
set install_filename=install_ahorn.jl

rem Set up launch arguments
rem Not the best solution, but it works for simple arguments

set darkMode=0
set developerMode=0
set onlyUpdate=0
set updateFirst=0
set displayHelp=0

for %%A in (%*) do (
if "%%A" equ "--dark" (
set darkMode=1
)

if "%%A" equ "--developer" (
set developerMode=1
)

if "%%A" equ "--update" (
set updateFirst=1
)

if "%%A" equ "--onlyUpdate" (
set onlyUpdate=1
set updateFirst=1
)

if "%%A" equ "--help" (
set displayHelp=1
)
)

:darkmode

if %darkMode% equ 1 (
SET GTK_CSD=1
SET GTK_THEME=Adwaita:dark
)

:displayHelp

if %displayHelp% equ 1 (
echo Program launch flags

echo --help
echo Displays this page.
echo.

echo --dark
echo Sets environmental variables to use the default GTK.jl dark theme.
echo This is not a native Windows theme, some interface elements might look different.
echo.

echo --developer
echo Puts error messages in the terminal rather than in the error log.
echo.

echo --update
echo Attempts to update Ahorn before starting.
echo.

echo --onlyUpdate
echo Only attempts to update Ahorn. Does not start the program afterwards.
echo.

goto :end
)

:start

where julia >nul 2>nul
rem Check if Julia runs at all when set with PATH
rem For some reason Windows might ship without `where` program
julia -e "exit(0)" >nul 2>nul
if %ERRORLEVEL% equ 0 (
echo Using Julia from PATH environmental variable.
echo Make sure this version is meeting the requirements for Ahorn.
where julia
echo Making sure this version is meeting the requirements for Ahorn.

julia -e "exit(Int(VERSION < %minimum_version%))"
if !ERRORLEVEL! neq 0 (
Expand All @@ -23,13 +92,30 @@ if %ERRORLEVEL% equ 0 (
goto :autodetect
)

goto :run
goto :install
)

:autodetect

rem New default directory, used for Julia 1.4
for /F " tokens=*" %%i IN ('dir /b /ad-h /o-d "%LocalAppData%\Programs\Julia"') do (
rem Default for 1.5
rem Looks for both Julia- and Julia, just to be safe
for /F " tokens=*" %%i in ('dir /b /ad-h /o-d "%LocalAppData%\Programs"') do (
set fn=%%i
if "!fn:~0,6!" == "Julia-" (
set JULIA_PATH="%LocalAppData%\Programs\%%i\bin"

goto :foundJulia
)

if "!fn:~0,6!" == "Julia " (
set JULIA_PATH="%LocalAppData%\Programs\%%i\bin"

goto :foundJulia
)
)

rem Default for 1.4
for /F " tokens=*" %%i in ('dir /b /ad-h /o-d "%LocalAppData%\Programs\Julia"') do (
set fn=%%i
if "!fn:~0,6!" == "Julia-" (
set JULIA_PATH="%LocalAppData%\Programs\Julia\%%i\bin"
Expand All @@ -38,8 +124,8 @@ for /F " tokens=*" %%i IN ('dir /b /ad-h /o-d "%LocalAppData%\Programs\Julia"')
)
)

rem Old default directory, Julia 1.3 is a valid target
for /F " tokens=*" %%i IN ('dir /b /ad-h /o-d "%LocalAppData%"') do (
rem Default for 1.3
for /F " tokens=*" %%i in ('dir /b /ad-h /o-d "%LocalAppData%"') do (
set fn=%%i
if "!fn:~0,6!" == "Julia-" (
set JULIA_PATH="%LocalAppData%\%%i\bin"
Expand All @@ -48,7 +134,7 @@ for /F " tokens=*" %%i IN ('dir /b /ad-h /o-d "%LocalAppData%"') do (
)
)

echo Julia installation not found in default install directory "%LocalAppData%\Programs\Julia\".
echo Julia installation not found in default install directory "%LocalAppData%\Programs\".
echo Please install to the default directory or add Julia manually to the PATH environmental variable.

goto :installPrompt
Expand Down Expand Up @@ -78,6 +164,14 @@ if %ERRORLEVEL% neq 0 (
powershell -Command "(New-Object Net.WebClient).DownloadFile('%julia_url_32bit%', '%julia_filename%')"
)

if !ERRORLEVEL! neq 0 (
echo Unable to download Julia installer.
echo Might be due to TLS issues or PowerShell version.
echo Please manually download and install Julia from the Julia website.

goto end
)

echo Running installer
start /wait "" "%~dp0%julia_filename%"

Expand All @@ -89,7 +183,7 @@ if %ERRORLEVEL% neq 0 (
goto :end
)

:run
:install

set AHORN_PATH=%LocalAppData%\Ahorn
set "AHORN_PATH=%AHORN_PATH:\=/%"
Expand All @@ -100,26 +194,63 @@ if %ERRORLEVEL% equ 0 (
echo Installing Ahorn, this might take a while.
echo Please make sure not to put the command line into select mode, that means do not click inside the window.

powershell -Command "(New-Object Net.WebClient).DownloadFile('%install_url%', '%install_filename%')"
if not exist "%cd%\%install_filename%" (
powershell -Command "(New-Object Net.WebClient).DownloadFile('%install_url%', '%install_filename%')"

if !ERRORLEVEL! neq 0 (
echo Unable to download Ahorn install script.
echo Might be due to TLS issues or PowerShell version.
echo Please manually download install_ahorn.jl and put it in the same folder as Ahorn.bat and then rerun.
echo Optionally install Ahorn manually via cross platform instructions.

goto :end
)
)

julia "%~dp0%install_filename%"

del "%~dp0%install_filename%"

julia -e "using Pkg; Pkg.activate(%AHORN_ENV%); exit(length(Pkg.installed()))" > NUL 2>&1
if !ERRORLEVEL! equ 0 (
goto end
goto :end
)

goto :install
)

:update

if %updateFirst% equ 1 (
echo Attemtping to update Ahorn.

if !developerMode! equ 1 (
julia -e "using Pkg; Pkg.activate(%AHORN_ENV%); Pkg.update()"

) else (
julia -e "using Pkg; Pkg.activate(%AHORN_ENV%); Pkg.update()" 2> "%AHORN_PATH%/update.log"
)

goto :run
if !onlyUpdate! equ 1 (
goto :end
)
)

echo If this is the first time running Ahorn, this might take a while.
echo The window might stay blank for a long time, this is normal as packages are precompiling in the background.
echo Be patient, the program is still running until the terminal says "Press any key to continue" (or equivalent in your language).
echo The error log is located at "%AHORN_PATH%/error.log", should any problems occur.
:run

if %developerMode% equ 1 (
echo Warnings and errors will be printed to this window rather than error log.

julia -e "using Pkg; Pkg.activate(%AHORN_ENV%); using Ahorn; Ahorn.displayMainWindow()" 2> "%AHORN_PATH%/error.log"
julia -e "using Pkg; Pkg.activate(%AHORN_ENV%); using Ahorn; Ahorn.displayMainWindow()"

) else (
echo If this is the first time running Ahorn, this might take a while.
echo The window might stay blank for a long time, this is normal as packages are precompiling in the background.
echo Be patient, the program is still running until the terminal says "Press any key to continue" (or equivalent in your language^).
echo The error log is located at "%AHORN_PATH%/error.log", should any problems occur.

julia -e "using Pkg; Pkg.activate(%AHORN_ENV%); using Ahorn; Ahorn.displayMainWindow()" 2> "%AHORN_PATH%/error.log"
)

:end
endlocal
Expand Down
Binary file added assets/cutscene_node.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 79f17dd

Please sign in to comment.