Commit Graph

5957 Commits

Author SHA1 Message Date
Tamás Bálint Misius
36800a76cd
Complain about missing custom elements when opening online saves
The complaint manifests as a button in the bottom right corner of the half-size preview.

Also convert the loading error popup to such a button.
2023-10-15 13:30:28 +02:00
Tamás Bálint Misius
374209eebe
Remove a few outdated windows-only preprocessor hacks 2023-10-15 12:04:22 +02:00
Tamás Bálint Misius
9605e0fcb9
Fix spurious timeout errors from some callbacks
Mainly the new ones I added >_> Don't use lua_pcall, kids. tpt_lua_pcall records when control flow was "last seen" on the C++ side, so you have to call it rather than just lua_pcall if you want to avoid timeout ("script not responding") errors.

For the record, I had a really hard time reproducing these errors. I had to tune the timeout to such a low value that the errors might as well have not been spurious, i.e. not much could have been done in such a short period of time anyway, bugs or no bugs.
2023-10-15 11:32:00 +02:00
Tamás Bálint Misius
8534be2bf9
Fix guess best scale prompt showing up even when it guesses the default
Also fix a few warnings.
2023-10-14 15:38:37 +02:00
Tamás Bálint Misius
04b8378de4
Add bound checking to Simulation::clear_area
Fixes a crash easily reproducible with sim.clearRect(-10000000, -10000000, 20000000, 20000000)
2023-10-09 23:48:57 +02:00
jacob1
b2045c067e
Make save history icon not so hard to find, and show up on all saves (not just your own)
The icon is now shown whenever you hover over the save, not just when you hover over where the icon is supposed to be
2023-10-08 19:08:03 -04:00
Saveliy Skresanov
f5f275e657
Add descriptions for RSST and RSSS. 2023-10-08 19:33:01 +02:00
Saveliy Skresanov
15a22c6906
Add ctype mechanics. 2023-10-08 19:33:01 +02:00
Saveliy Skresanov
c4db637887
Add reactions of resist with other elements. 2023-10-08 19:33:01 +02:00
Saveliy Skresanov
4377f83184
Add liquid resist (RSST) and solid resist (RSSS). 2023-10-08 19:33:01 +02:00
Saveliy Skresanov
84b790ceaf Add descriptions for RSST and RSSS. 2023-10-09 00:20:15 +07:00
Saveliy Skresanov
0165a9b121
Fix a bug in the font editor where the last row of a symbol is cleared
when shifting the whole symbol up.
2023-10-08 12:25:14 -04:00
Saveliy Skresanov
48a3bf45fc
Center more icons. 2023-10-08 12:25:14 -04:00
Saveliy Skresanov
3428ccc80a
Center sensors, search and pause icons. 2023-10-08 12:25:14 -04:00
jacob1
dd5e5b1f3a
misc: Fix sim.partNeighbors table being 0-indexed, rename SIM_MAXVELOCITY to MAX_VELOCITY 2023-10-08 12:19:06 -04:00
Tamás Bálint Misius
7541273640
Add blurry scaling option
This looks slightly nicer on very pixel-dense screens (scale factors 5 and up) than nearest neighbour fractional upscaling does.

Also fix window icon disappearing at times and the window being resized after configuration changes.

We should maybe start preserving window size also at some point, the way we do position now.
2023-10-06 15:04:29 +02:00
jacob1
814b73a5ed
Change sim.walls to use real wall identifiers, and also have reverse lookup 2023-10-05 23:59:09 -04:00
jacob1
fde1211cd9
Add ctrl+e shortcut to cycle through edge modes 2023-10-05 21:34:09 -04:00
jacob1
29ea811642
Add enums for gravity/air/edge modes, add more constants to Lua
Constants for the new enums were added, along with walls (in the sim.walls table), x/y center, and a few movement constants
2023-10-05 21:34:09 -04:00
Tamás Bálint Misius
bc51bdf634
Add shortcut to toggle fullscreen 2023-10-05 23:19:59 +02:00
Tamás Bálint Misius
7bb8344d3b
Fix the Maximized property of windows shortcuts not being respected
By not resizing the window if it's resizeable and is somehow already maximized.
2023-10-05 21:23:20 +02:00
Tamás Bálint Misius
bb8605fa3b
Fix ubuntu 20.04 pipelines
By not using SDL_RenderLogicalToWindow if it's not available.

Because of course ubuntu 20.04 has sdl 2.0.10, which of course doesn't yet have SDL_RenderLogicalToWindow which was added in 2.0.18, which is of course needed because of course SDL_SetTextInputRect takes window coordinates rather than logical coordinates. At least official static linux builds are not affected because tpt-libs uses much newer sdl.
2023-10-05 21:23:04 +02:00
Tamás Bálint Misius
79760f5c89
Fix input method candidates being aligned wrong in some cases
Namely when the main window is resizeable and its size isn't the same as it would be with the active scale mode with resizing disabled.

Also fix window position not being restored when the main window is resizeable.
2023-10-05 20:10:50 +02:00
Tamás Bálint Misius
0fb36012a2
Clean up window creation somewhat
Fixes most of the rat's nest situation mentioned in 8cfe7cdd93.
2023-10-05 19:47:29 +02:00
Tamás Bálint Misius
1a8ebd0981
Fix occasional crashes upon opening settings
By zero-initializing pointers in OptionsView so they don't crash when they don't get initialized, which up until very recently they always had. In the cases of the emscripten and android ports, certain components are never created.
2023-10-04 19:32:08 +02:00
Tamás Bálint Misius
8cfe7cdd93
Clean up window frame settings somewhat
Another rat's nest; I'm still not entirely satisfied.

This introduces "frame personalities": one for embedded frames (emscripten), one for handheld devices and everything else that doesn't really work with windows (android), and one for everything else. For now these affect which frame options are configurable by the user and what values they are forced to take if they are not configurable, and whether optimal scale is guessed based on screen size.

Also introduce a future TouchUI config node to allow switching between normal and touch-optimized UI on android. Again, because chromebooks and other android devices with mouse and keyboard support are a thing.

Also enable debugging of debug builds of android. It took me hours to attach a stupid debugger to the process; see:

 - https://www.sh-zam.com/2019/05/debugging-krita-on-android.html
 - https://source.android.com/docs/core/tests/debug/gdb#app-startup

I also had to adb forward the port that lldb was supposedly talking to lldb-server over because otherwise it wouldn't attach; I don't get it either.
2023-10-04 16:01:00 +02:00
Tamás Bálint Misius
d04768fa0e
Give untagged build artifacts a distinct app ID
Their app ID would clash with that of stable otherwise, preventing them from being installed without disrupting stable installs.
2023-10-04 07:55:31 +02:00
Tamás Bálint Misius
b6680a03b2
Fix a few warnings 2023-10-03 18:25:35 +02:00
Tamás Bálint Misius
e635a45251
Make Lua hook timeout configurable 2023-10-03 18:25:34 +02:00
Tamás Bálint Misius
b89d29b744
Enable libcurl on android 2023-10-03 18:25:34 +02:00
Tamás Bálint Misius
f94b436cbc
Use mbedtls on windows 2023-10-03 18:25:34 +02:00
Tamás Bálint Misius
8385796ca1
Bump android toolchain version to 21 2023-10-03 18:25:34 +02:00
Tamás Bálint Misius
baf484653a
Update tpt-libs 2023-10-03 18:25:32 +02:00
Saveliy Skresanov
78bc86d107 Add ctype mechanics. 2023-10-02 22:41:22 +07:00
Saveliy Skresanov
b000abcdd8 Add reactions of resist with other elements. 2023-10-01 21:00:53 +07:00
Tamás Bálint Misius
5584acd189
Add version info to bluescreen 2023-09-30 22:15:38 +02:00
Saveliy Skresanov
93cbb065dd Add liquid resist (RSST) and solid resist (RSSS). 2023-09-30 20:05:29 +07:00
Tamás Bálint Misius
146fb4b549
Sample "into" the PROP tool when it is active
That is, if the PROP tool is active and is configured correctly, instead of sampling a type and activating the corresponding ElementTool, sample whichever property has been configured in the PROP tool and put the result back into the PROP tool.
2023-09-29 23:00:35 +02:00
jacob1
d1a4c6ad85
Fix custom can_move settings being reset after using tpt.el 2023-09-25 20:16:07 -04:00
Tamás Bálint Misius
ef04068a85
Make find mode work with the PROP tool 2023-09-20 07:16:28 +02:00
Tamás Bálint Misius
ca6558bd5d
Fix FUSE not burning as fiercely as meant to
Broken in 49703404be.

Also fix .chance's parameter names.
2023-09-16 21:41:07 +02:00
Tamás Bálint Misius
70e6f4e241
Fix fs.makeDirectory negating its result 2023-09-16 07:22:04 +02:00
Tamás Bálint Misius
b99914bac5
Fix crash from Lua prompts when exiting the game completely
The problem is that Engine outlives GameController and thus also LuaScriptInterface. The solution is to not try to access LSI's lua_State if it doesn't exist; this is the case in Engine's dtor.

This is ugly as hell and the root of the problem is the cursed ownership model of LuaComponents and Windows by Engine, which I don't think I'll be fixing any time soon.
2023-09-14 19:58:59 +02:00
Tamás Bálint Misius
a2c82444aa
Fix local browser sometimes failing to load saves
Namely when they have been scrolled past already so they have been unloaded to save memory.
2023-09-12 19:28:11 +02:00
Tamás Bálint Misius
fcba9f1f2e
Fix RenderView not drawing any simulation content
This used to work without the explicit copy because Graphics and Renderer used to share backing buffers.
2023-09-12 19:00:38 +02:00
Tamás Bálint Misius
440dc68b5e
Fix PMODE_SPARK producing black spots
PMODE_SPARK does weird colour ops with alpha values larger than 255, so of course it looks odd with the new code that expects alpha to be at most 255. The solution is to do the work on the spot.

Other effects may also be affected by this new assumption.
2023-09-12 18:41:44 +02:00
Tamás Bálint Misius
d2d1fd902f
Fix crash upon changing tpt.brushID
This was because brushes are not in an initialized state by default, SetRadius needs to be called on them before they can be used. This is ensured elsewhere but had not been ensured on this code path.

This is hilariously bad design and needs to be fixed sometime.
2023-09-10 11:32:32 +02:00
Tamás Bálint Misius
28d86d2859
Unify InBounds implementations 2023-09-07 22:40:01 +02:00
Tamás Bálint Misius
1b1ef99194
Move callback parameter of ui.begin* functions up
See 4f31f85b6b. This is better because the need to pad partial parameter lists with nils is avoided.
2023-09-07 21:29:44 +02:00
Tamás Bálint Misius
59b79e805f
Make ui.beginInput return nil if cancelled 2023-09-07 20:56:46 +02:00