Commit Graph

2843 Commits

Author SHA1 Message Date
Tamás Bálint Misius
18dfd6de86
Copy all text in Label, Textbox, etc. if none is selected (fixes #720)
This is more in line with what Cut does in Textboxes when nothing is selected.
2020-10-11 21:13:29 +02:00
Tamás Bálint Misius
a0a0e6c498
Correctly handle SDL_GetCurrentDisplayMode return value 2020-10-11 12:31:52 +02:00
Vladimir
f137bad7f8
Limit redrawing frequency (#693)
Co-authored-by: Tamás Bálint Misius <lbphacker@gmail.com>
2020-10-11 11:58:52 +02:00
Tamás Bálint Misius
bdcf486a8d
Refactor MomentumScroll to be more in line with other interface prefs 2020-10-10 21:57:29 +02:00
Tamás Bálint Misius
ba72dc7a22
Custom GOL (#731)
Co-authored-by: jacob1 <jfu614@gmail.com>
2020-10-08 20:23:59 +02:00
grufkork
02b26a9da3
Change ScrollPanel scroll behaviour
Small change to replace the momentum-based scrolling with the more common method of scrolling with each scroll wheel step.
2020-10-08 14:36:11 +02:00
RCAProduction
1f7e9095da
Add element ROCK (#724) 2020-10-08 01:27:25 +02:00
Tamás Bálint Misius
99c99132bd
Make energy particles visible to LSNS ant HSWC for reals (see 6052ef6) 2020-10-07 11:16:47 +02:00
Tamás Bálint Misius
02468d0786
Let ARAY control the life of all normal BRAY it spawns 2020-10-07 10:56:58 +02:00
Tamás Bálint Misius
6052ef6179
Make energy particles visible to LSNS ant HSWC for deserialization 2020-10-07 10:53:10 +02:00
Cracker1000
00ddc1f8be
Add VSNS (#707)
Co-authored-by: Tamás Bálint Misius <lbphacker@gmail.com>
2020-10-07 10:49:31 +02:00
nixls
d6de7e2ba8
Make Copy and Cut buttons disappear when no text is selected (#730) 2020-10-04 23:13:58 +02:00
Tamás Bálint Misius
c73dfe8ca0
Prioritise favourited elements in element search
Also prevent favourited tools from showing up twice there.
2020-09-25 20:47:39 +02:00
Tamás Bálint Misius
88fd676cd2
Fix stasis walls not keeping dying GOL cells in stasis 2020-09-22 19:43:01 +02:00
jacob1
efd2b41980 Fix default render modes not being the same as Fire display mode
Special effects like EMBR sparks weren't included, this only affected the renderer, causing those special effects to not render.
2020-09-15 15:23:05 -04:00
Tamás Bálint Misius
efc693bf43
Fix initial mouse position and unsafe SDL_Event union access 2020-08-23 00:25:43 +02:00
Tamás Bálint Misius
fd032eff36
Fix LuaSmartRefs acting on dead Lua states
This fixes problems with degenerate cases such as:

	local button
	assert(coroutine.resume(coroutine.create(function()
		button = Button(10, 10, 20, 20)
	end)))
	button:action(function()
		print("hi")
	end)
2020-08-21 11:16:11 +02:00
Tamás Bálint Misius
f9c6633c62
Make certificate revocation checks non-mission-critical
This will hopefully solve 612 errors on Windows.
2020-08-15 19:07:02 +02:00
Tamás Bálint Misius
126b7adfaa
Open URIs without popping up console windows 2020-08-09 14:26:19 +02:00
Tamás Bálint Misius
6490654733
Fix a few unused result warnings 2020-08-07 01:33:18 +02:00
Tamás Bálint Misius
6ec87ed1ed
Improve select all saves feature (fixes #725)
Ctrl+A no longer selects all saves if any of the textboxes in
the view are in focus, as a ctrl+A in that case is expected to
select everything in the textbox, not in the save browser.

This change also makes the shortcut deselect all saves if all
saves are selected.

And no, I'm not making events cancellable just for this.
2020-08-07 00:01:56 +02:00
ConnorCreate
5ab939720a
Add ctrl+a to select all saves in save browser (#698) 2020-07-26 19:29:55 +02:00
Bowserinator
0959354178
Customize BRAY collision life (#712) 2020-07-26 19:17:43 +02:00
Tamás Bálint Misius
94353a9a3b
Remove leftover cooldown-related code from ARAY and DRAY 2020-07-26 19:05:05 +02:00
Bowserinator
41254a2f95
Add PTNM (Platinum) (#711) 2020-07-26 18:48:15 +02:00
moonheart08
85ab70adb3 Add a reaction to produce BCOL 2020-07-26 11:53:37 +02:00
moonheart08
9413a1f0b6
Introduce element 187, SLCN. (#704)
Add SLCN

Co-authored-by: moonheart08 <moonheart08@noreply.github.com>
Co-authored-by: Tamás Bálint Misius <lbphacker@gmail.com>
2020-07-26 11:45:50 +02:00
Tamás Bálint Misius
6d95ad898e
Widen font ptrs to ints
Hopefully we'd be overflowing shorts otherwise.
2020-07-24 20:46:09 +02:00
Tamás Bálint Misius
5c190c1a7a
Remove gaps between lines of selected text 2020-07-01 16:18:35 +02:00
avevad
1635c93822 Fixed The-Powder-Toy/The-Powder-Toy#721 2020-06-22 17:14:57 +02:00
jacob1
688b4bec30 Fix bug with line tool while WIND is selected (id:2554353) 2020-06-14 15:23:27 -04:00
laurencedeclan
a9f07dc5b0 Data in user data directory (backwards-compatible) 2020-06-10 21:04:08 +02:00
Tamás Bálint Misius
9fcf780c78
Necromancy is bad
This is very similar to the SPRK-PROT bug (fixed by 4aa58d6c)
in that the cause for a later crash is the free list of particles
being corrupted by messing with the .life property of a dead
particle.

The code in the loop body following this kill_part call has no
effect on other particles if the call were to happen. The only
thing this continue skips is increasing pressure under the now
dead particle.

Credit goes to @QuanTech for finding the problem, see id:2547788
(originally his save, I just saved to my alt account for future
reference).
2020-05-27 08:42:49 +02:00
QuanTech0
dda7747688
safeguard FloodParts and kill_part (#717) 2020-05-11 10:20:01 -04:00
QuanTech0
49963980e6
Constrain brushx and brushy values (#716) 2020-05-09 13:54:12 -04:00
jacob1
9188f7bf8b FRAY: use floating point instead of double for this subtraction 2020-05-09 13:50:42 -04:00
QuanTech0
87ee7a54e1
Fix off-by-one in TPTScriptInterface::tptS_set (#715) 2020-05-08 10:04:10 +02:00
jacob1
3fc6b38111 DRAY: don't attempt to copy a particle if we stopped due to being out of bounds
(efficiency reasons only)
2020-05-04 20:54:56 -04:00
jacob1
6f845ed4b4 Fix unnecessary break in LSNS. Closes #713 2020-05-02 11:24:18 -04:00
QuanTech0
544c51c03f Cast malloc() in opt_meth_setoption 2020-04-28 00:30:30 -04:00
jacob1
899a2a046c Add ctrl+u shortcut to reset ambient heat 2020-04-27 23:20:54 -04:00
QuanTech0
4efe5875ab Simulation::create_part sanity check 2020-04-26 21:00:41 -04:00
jacob1
323a850e16 Don't delete SPRK/METL in detector wall, don't allow drawing metal on detector wall
This fixes the only valid bug on the "Glitches" wiki page. All the rest were already fixed (multi-head stkm) or are not bugs (lava ice, "destroying" dmnd with dray)
2020-04-11 23:51:56 -04:00
QuanTech0
6b3d5b9ce5
Fix typo in Options UI (#703) 2020-03-30 18:44:02 -04:00
Tamás Bálint Misius
fe15566d2c
Only change modes when the lock is being held, see 2333786 (fixes #700) 2020-03-23 23:08:52 +01:00
Tamás Bálint Misius
21b9e1a645
Allow everything Unicode except noncharacters and control characters
Thanks mniip, see a113cbe.
2020-03-12 09:49:45 +01:00
Tamás Bálint Misius
a113cbe57d
Don't allow literally *all* code points to be entered
Oops, my bad. See a2a8c876b.
2020-03-10 11:46:06 +01:00
mniip
34c0a94f98 Add a font.cpp merging utility 2020-03-10 02:13:48 +03:00
mniip
fd5867b57d Merge branch 'font-latin-1' 2020-03-10 01:28:57 +03:00
mniip
a38d8639e7 More font editor stuff 2020-03-10 01:18:12 +03:00
mniip
6607b7e845 Make font editor more convenient 2020-03-10 01:00:41 +03:00
Tamás Bálint Misius
c40a6bf13f Allow non-ASCII text to be pasted into textboxes
There is no end to the ASCII-isms >_>
2020-03-09 23:44:18 +03:00
Tamás Bálint Misius
a2a8c876b3 Finalize latin-1 supplement changes
Swap both versions of O with acute and grave accents
Fix a few ASCII-isms
Fix intro text; the latin-1 changes broke the line under The Powder Toy
2020-03-09 23:44:18 +03:00
jacob1
9e53612a5b Version 95.0 (build 345) 2020-02-26 22:03:21 -05:00
jacob1
36c980ba6f Fix --no-http compile 2020-02-23 23:06:57 -05:00
jacob1
89a5162448 restrict new LSNS features to version 95.0 also 2020-02-23 21:56:34 -05:00
Tamás Bálint Misius
82019ef020
Catch exception by reference rather than value 2020-02-23 23:43:11 +01:00
Tamás Bálint Misius
4f01130ecc
Restrict saved version to 95.0 if signs with macros are present 2020-02-23 23:37:01 +01:00
Tamás Bálint Misius
c6f653ac3c
Fix crash when overwriting existing local saves 2020-02-15 21:33:54 +01:00
jacob1
c868e79895 Fix TextPrompt::Blocking 2020-02-09 15:29:13 -05:00
jacob1
ffea880da1 Fix bug where deco renders on EMBR in save thumbnails 2020-02-09 14:10:27 -05:00
jacob1
88064970a3 whitespace fix 2020-02-08 14:22:01 -05:00
jacob1
6b73b2dd9b Fix fighters sometimes loading from saves with no element 2020-02-08 11:10:53 -05:00
jacob1
ca8f4e3aac replace mode: reset created element back to default properties, instead of just changing type 2020-02-08 10:40:29 -05:00
jacob1
1e23269dd4 Add "perfect circle brush" option (on by default), to allow using old circle brush 2020-02-03 00:20:46 -05:00
Tamás Bálint Misius
cb419cd85c
Failure to remove a tag shouldn't be fatal 2020-02-02 12:16:14 +01:00
Tamás Bálint Misius
3c6ae35cc4
Fix PMAPBITS compile-time sanity check 2020-01-24 22:25:15 +01:00
Tamás Bálint Misius
5dfda0c528
Only make the request a POST if POST parameters are present
This is a compatibility thing, eww. This also fixes handling ptsave from the command line.
2020-01-21 22:54:52 +01:00
Tamás Bálint Misius
7330d0412a
Fix random warnings from clang 8.0.0 2020-01-21 14:43:22 +01:00
jacob1
467be1dcb9 change to 1L because technically the argument is a long 2020-01-20 11:16:33 -05:00
jacob1
0c588c48fe allow making POST requests with empty body 2020-01-20 11:11:56 -05:00
jacob1
afefd045c8 split http.request into http.get and http.post (for api reasons)
It's cleaner together, but it's not a good api.
2020-01-20 00:30:30 -05:00
Tamás Bálint Misius
89282806e6
Make NOHTTP transparent to the Lua API
Also, HTTPRequest:status would never have returned queued since
the request is started immediately on creation.
2020-01-18 01:33:40 +01:00
Tamás Bálint Misius
194c50ae3c
Much good #defining ENFORCE_HTTPS does if we don't include Config.h 2020-01-16 20:33:54 +01:00
Tamás Bálint Misius
fe87203eb4
Add HTTP API for Lua
Also fix a bug with Requests where any connection that took
longer to finish than 15 seconds would be killed. Should have
used CURLOPT_CONNECTTIMEOUT instead of CURLOPT_TIMEOUT when
specifying the timeout, oops.
2020-01-16 20:05:31 +01:00
Tamás Bálint Misius
4d52531889
Ditch element and tool classes 2020-01-09 19:22:11 +01:00
QuanTech0
78203fc219 Division by Zero fix (#689) 2020-01-01 23:03:35 -05:00
jacob1
2576175762 remove unnecessary arguments to FloodINST. Fix random warning. 2019-12-23 00:34:21 -05:00
jacob1
5b4a0bf93b Fix MSVC compile 2019-12-21 16:17:37 -05:00
Secundario
a05e20f1bf Do a single CoordStack allocation per thread 2019-12-21 13:14:40 -05:00
suve
110250fe6a Guess best scale on startup (#684)
Guess best window scale at startup
2019-12-21 17:39:32 +01:00
Tamás Bálint Misius
a43463b137
If you don't assign the callback, it won't be called 2019-12-17 10:49:35 +01:00
Tamás Bálint Misius
7629c98f22
Get rid of tiny callback classes, round No.1
I say round No.1 because I'm not sure if there are any left.
Hopefully there aren't.
2019-12-16 21:20:33 +01:00
jacob1
131b965af2 Add Lua apis to interact with DefaultProperties, Create, CreateAllowed, and ChangeType 2019-12-09 22:32:30 -05:00
jacob1
bf7d182de5 Add CreateAllowed and ChangeType events
Used in create_part, kill_part, and part_change_type, allows us to remove element-specific stuff in those functions
Note: difference between Create and ChangeType is that Create is called when we want to initialize default element properties, but ChangeType is called every time a particle is changed to that type, even if it doesn't need default properties set. ChangeType is mainly used for things that need accurate state tracking, like the stkm spawn status.
ChangeType is called every time a particle is changed to or from its type, which includes if the particle is deleted, and also Lua.

Neither of these functions are called when loading saves, that's probably an oversight, will fix later
2019-11-29 19:32:33 -05:00
jacob1
9993290b72 Add Create function, handles setting default properties for elements that need randomness or special code
Most of the switch statement in create_part is gone. There's a few others that I will get rid of in future commits. There will also be a CreateAllowed function, and a ChangeType. ChangeType will handle stuff that is duplicated in both create_part and part_change_type. Considering making a Destroy function instead of ChangeType, though.

Later on, Lua events will be made for all 3

Credit to jacksonmj for the original design of all of this, I copied it into my mod years ago
2019-11-28 00:22:17 -05:00
Tamás Bálint Misius
5c1ea5ef0d
Blacklist SPRK in PCLN's and PBCN's ctypeDraw function
Apparently it used to be blacklisted before ctype-drawing got redone.
2019-11-27 21:00:47 +01:00
jacob1
0078fb4c6f Add DefaultProperties, replaces some of the case statements in create_part
The rest will will in a commit soon that adds the Create event and some other stuff
Lua events will come after that
PLSM default temp lowered to MAX_TEMP
2019-11-25 22:08:18 -05:00
jacob1
459790ffe0 also allow nil here 2019-11-24 23:20:22 -05:00
jacob1
876a9b3096 Fix crashes if returning invalid arguments from graphics or ctypeDraw lua functions 2019-11-24 23:12:22 -05:00
jacob1
b09158220f Fix crash if error happens in ctypeDraw lua function 2019-11-22 23:37:17 -05:00
Tamás Bálint Misius
d17c67b3a4
Fix unsigned integer properties being returned as signed integers from Lua functions 2019-11-14 00:28:27 +01:00
jacob1
7af51b55ac Fix STK2 rocket boots not saving in saves 2019-11-03 10:31:18 -05:00
jacob1
9ed7f1e85a Fix crash if any built-in scripts try to use the interface api
We don't have any scripts like this and never will. But if we did, this would fix the crash.
2019-10-17 23:56:40 -04:00
Tamás Bálint Misius
5f7dd033ec
Revert previous change, add NewtonianGravity element property instead 2019-10-17 22:29:24 +02:00
Tamás Bálint Misius
6b85231f23
Incorporate Gravity property into calculation of acceleration due to newtonian gravity 2019-10-16 01:27:48 +02:00
jacob1
a50b172999 Fix clang 8 compile warnings 2019-10-04 00:21:10 -04:00
Tamás Bálint Misius
ec2576d37f
Keep GameModel brush radius consistent 2019-09-30 14:55:17 +02:00
Nick Renieris
024c3c1b45 gui/game/brush: Add smooth/organic elliptical brush
Not sure why TPT's ellptical brush currently looks like that,
when you type "pixel circle" on Google every result is the
smooth version.

Got the idea from this post:
https://powdertoy.co.uk/Browse/View.html?ID=2464991

Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-26 22:25:32 +02:00
Tamás Bálint Misius
1cea59e521
Make sRGB the default colour space for deco tools, see 51e5f2b 2019-09-22 23:10:57 +02:00