Robert Müller
833f690c59
Refactor editor sound selection popup using CScrollRegion
...
Decrease popup size by remove the unused empty space designated for "previewing" sounds.
2022-09-04 22:59:33 +02:00
Robert Müller
cef984294c
Fix minimum/maximum values of editor properties
...
The Order-property maximum value was too large, so it was temporarily (only visually) possible to go beyond the maximum.
The minimum/maximum values for the Color-property were incorrect and redundant, as `PROPTYPE_COLOR` is used for RGBA color properties and not for envelope IDs.
2022-09-04 13:06:15 +02:00
Robert Müller
130275a7b2
Refactor editor automapper config list using CScrollRegion
...
- Fix the currently selected item not being highlighted after opening the dialog.
- Remove static limit of 255 automapper rules, after which the editor previously caused out-of-bounds accesses, by using the address of the automapper config name as button ID.
2022-09-03 16:41:31 +02:00
Robert Müller
7b80ad1982
Refactor editor layer image selection popup using CScrollRegion
...
The width of the popup and list are also slightly increased to better support images with longer names.
2022-08-23 10:01:28 +02:00
bors[bot]
49bed71932
Merge #5696
...
5696: Add option for parallax-aware zoom r=def- a=Fireball-Teeworlds
## How this works
Currently we have parallax X and Y parameters that control how far away a layer feels. Currently it's only taken into account for camera moving sideways.
This pull request makes zoom behave as if the camera was moving closer or further away, taking into account the distance to the layer.
In order to provide flexibility, this behaviour is using a separate parallax value, similar to how we have separate values for X and Y. Para Zoom will default to the minimum of parallax X, Y, clamped to be between 0 and 100. This seems to look well on most maps.
This pull request also introduces two new features to the Editor:
* Controls for configuring per-group Para Zoom value. If Custom Zoom is set to No, Para Zoom will automatically keep following to the default value described above, so that people new to the feature don't have to figure out how it works.
* Zoom button that previews the zoom behavior (next to Proof at the top).
## Editor Screenshots
### Para Zoom controls
![screenshot_2022-08-22_21-38-04](https://user-images.githubusercontent.com/68162181/186014490-f7b91245-460f-405f-8d5c-3f91db2a1b9a.png )
![screenshot_2022-08-22_21-37-58](https://user-images.githubusercontent.com/68162181/186014522-03b6e814-4dd9-4d07-9af9-7db5fb434a56.png )
### Zoom Button
![screenshot_2022-08-22_21-40-46](https://user-images.githubusercontent.com/68162181/186014856-2d1d499d-9011-439c-b217-536957e0c1e3.png )
![screenshot_2022-08-22_21-40-50](https://user-images.githubusercontent.com/68162181/186014874-6d2939d3-00ff-4327-a790-414b5151ba31.png )
## In-Game Screenshots
Video: https://youtu.be/W7eXQN0gRFI
This is an older version of the pull request that had an option to disable the new behaviour. The current version can only be disabled in map editor for a particular map.
### Springlobe 3
With new feature:
![screenshot_2022-08-02_04-28-19](https://user-images.githubusercontent.com/68162181/182286371-b67cee1c-73d8-4a24-a9c3-1b28340a3b42.png )
Without:
![screenshot_2022-08-02_04-28-25](https://user-images.githubusercontent.com/68162181/182286367-24555381-1700-4ff1-80c7-39e5dce63820.png )
### Beyond Dreams
With new feature:
![screenshot_2022-08-02_04-28-59](https://user-images.githubusercontent.com/68162181/182286322-114ecb90-0860-462c-9012-bb2f3ff848fb.png )
Without:
![screenshot_2022-08-02_04-28-55](https://user-images.githubusercontent.com/68162181/182286654-f34da72b-7991-4f42-89ad-679279fcb83e.png )
## Checklist
- [X] Tested the change ingame
- [X] Provided screenshots if it is a visual change
- [X] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [X] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [X] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck ) (optional)
Co-authored-by: Fireball <fireball.teeworlds@gmail.com>
2022-08-22 21:15:41 +00:00
Corantin H
ae8b9914aa
Editor: added a goto button
2022-08-20 20:47:46 +02:00
Corantin H
29a3baaa75
Editor: added the possibility to duplicate layers
2022-08-19 13:20:50 +02:00
Robert Müller
51fb3e9a22
Merge CUIEx
class into CUI
...
There is no need to separate the UI in two classes anymore, as the dependency on `CRenderTools` has been removed.
2022-08-12 19:59:19 +02:00
Robert Müller
95550fd6a9
Move CRenderTools::DrawUIRect/4
to CUIRect::Draw/4
...
Use `ColorRGBA` instead of `vec4` for `Draw4`.
2022-08-12 19:37:08 +02:00
Robert Müller
7b20009980
Move CUI::CORNER_*
enum to IGraphics::CORNER_*
...
Entirely automatic replacement in preparation for moving rect drawing methods from `CRenderTools` to `IGraphics`.
2022-08-12 17:42:04 +02:00
Fireball
5bf7f60bf6
Parallax Zoom: Add default zoom option to the editor
...
Safe defaults for map editing: unless opted-in, Parallax Zoom
will default to maximum(parallax{x,y}).
2022-08-06 01:31:42 +01:00
Fireball
a90c86e9a5
Parallax-aware zoom
...
How this works: parallax values configure perceived distance from camera
when it's moving along x and y axes. Assume that zoom is moving the
camera away and scale layers accordingly, with background layers
(furtherst away) changing the least.
New per-ItemGroup (LayerGroup) setting allows to set the new parallax
value independently from the other two. This can be used to do tricks
like on Time Shop zoom correctly or make it feel like the camera is
changing the field of view at the same time as moving in space.
2022-08-05 00:40:58 +01:00
Robert Müller
1d6dca8c24
Fix accesses to vector with index -1 by adding static button IDs
2022-07-31 13:13:53 +02:00
Robert Müller
344e50f76f
Remove dead code
2022-07-31 13:10:03 +02:00
Chairn
a69dc599a9
Huge variable naming format
...
Fix pointer and pointer array variable naming
Huge renaming to match our rules
Used regex: (?!(return|delete)\b)\b\w+ (m_|ms_|g_|gs_|s_)[^a]\w+\[
(?!(return|delete)\b)\b\w+ (?!(m_|ms_|g_|gs_|s_))[^a]\w+\[
Further format static variables
Format almost all pointer names accordingly
Used regex: (?!(return)\b)\b\w+
\*(?!(m_p|p|s_p|m_ap|s_ap|g_p|g_ap|ap|gs_ap|ms_ap|gs_p|ms_p))\w+\b[^:\(p]
clang-format
Fix CI fail
Fix misnamed non pointer as pointer and non array as array
Used regex: (?!(return|delete)\b)\b\w+ (m_|ms_|g_|gs_|s_)p\w+\b
(?!return\b)\b\w+ (ms_|m_|g_|gs_|s_)a\w+\b[^\[]
clang-format
Revert to SCREAMING_SNAKE_CASE and reinstate dead code
2022-07-08 18:01:29 +02:00
Chairn
c9345e7d32
More vector naming format
2022-06-15 19:37:37 +02:00
ChillerDragon
3667061b68
Use nullptr in generated and editor
...
-Wzero-as-null-pointer-constant
2022-06-13 18:28:13 +02:00
Robert Müller
ffff4435c4
Remove ui_scale
:
...
- remove config variable `ui_scale`
- remove `CUI::Scale`
- remove `CUI::SetScale`
- remove `CUI::DoLabelScaled`
- remove `CUIRect::Scale`
- use `CUI::DoLabel` instead of `CUI::DoLabelScaled`
- remove usages of `CUI::Scale()` and `CUIRect::Scale()`, or use 1.0f instead
2022-06-12 10:40:19 +02:00
Chairn
01edaec628
Format vector variables names ( fixes #5209 )
2022-06-11 21:38:49 +02:00
Robert Müller
91d2ba1865
Organize game-client includes
2022-05-29 21:24:43 +02:00
bors[bot]
ccf0622984
Merge #5252
...
5252: Use std::vector instead of array, remove base/tl/array.h, algorithm.h, allocator.h, range.h r=def- a=Robyt3
Replaces all usages of `array` with `std::vector`.
I adjusted variable names of variables I changed to use the `v` prefix. Not so in the editor however, as there are already many changes due to clang-tidy enforcing the use of for-each loops.
This allows us to remove all remaining `base/tl` headers except `threading.h`.
Clang-tidy now finds `clang-analyzer-cplusplus.NewDelete` (Use of memory after it is freed), which is also fixed here, though it appears to be a false-positive.
This last remaining usages of `goto` are also removed.
## Checklist
- [X] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck ) (optional)
Co-authored-by: Robert Müller <robytemueller@gmail.com>
2022-05-28 10:56:21 +00:00
Robert Müller
0c69495522
Use std::vector instead of array in editor
2022-05-27 16:36:39 +02:00
Robert Müller
b9c52f7e31
Use SetActiveItem(nullptr) instead of SetActiveItem(0)
2022-05-27 11:59:14 +02:00
Robert Müller
2b02bd449b
Prevent lock of UI
...
Co-authored-by: oy <tom_adams@web.de>
2022-05-27 11:53:05 +02:00
Dennis Felsing
843acf6a5a
Use std::size instead of sizeof(a) / sizeof(a[0])
2022-03-30 18:55:04 +02:00
Jupeyy
14ac5cf297
lazy load editor textures
...
improve entities texture flags
2022-03-20 18:03:33 +01:00
def
8134f9fa55
Enable -Wshadow=local
...
> Warn when a local variable shadows another local variable or parameter.
Found one actual bug in graphics_threaded.cpp
Should reduce confusion in the future when reading source code
2022-03-20 13:24:34 +01:00
Jupeyy
95fe457abb
Auto font size
2022-03-11 17:34:48 +01:00
Ravie
2745c1a694
Knife tool
2022-02-26 18:49:06 +01:00
def
94272f82c7
Add more readability checks
2022-01-22 17:45:25 +01:00
ChillerDragon
b770bc6988
Use ETextAlignment enum for UI
...
Replaces the magic numbers -1/0/1 for left/center/right
Based on the work done in upstream:
@cinaera added alignment enums
04ee8b20a1
@TsFreddie renamed them
67651e8122
2022-01-21 16:26:19 +01:00
Wohoo
68a8bbadbc
clang-format fix
2022-01-08 12:30:51 +01:00
Wohoo
2017464282
Livefreeze implementation with CHARACTERFLAG_NO_MOVEMENTS flag.
...
Freeze and Unfreeze tiles added to switch layer too.
2022-01-07 16:53:40 +01:00
def
8625487292
Support enter and escape in editor when confirming save
2021-12-23 11:50:45 +01:00
Robert Müller
2fe5464938
remove delegate functions in CMenus, fix variable names
2021-12-03 20:26:26 +01:00
Robert Müller
d948a1e41f
fix variable name
2021-12-03 20:26:21 +01:00
Robert Müller
053981ee4c
refactor UI scrollbars
2021-11-26 23:03:45 +01:00
def
b4b9016cf4
Fix enter behavior when creating new folder in editor
...
As reported by louis:
> pressing enter while creating a new folder in the editor (while using
> "save as") does not create the folder but instead enters the selected
> folder in the background
2021-11-22 18:12:32 +01:00
oy
9e17281573
invalidate texture when unloading a texture.
...
Closes https://github.com/teeworlds/teeworlds/issues/1450
(cherry picked from commit 23a1b80f60
)
2021-09-13 13:23:00 +02:00
def
165857a5a8
Fix variable names manually
2020-11-02 22:40:40 +01:00
def
b1f0fd8969
Enable modernize-loop-convert clang-tidy check
...
and run clang-format afterwards
https://clang.llvm.org/extra/clang-tidy/checks/modernize-loop-convert.html
2020-11-02 22:40:24 +01:00
def
343e48248e
Editor: Fix selection of None value in auto rules ( fixes #3013 )
...
by starting the indexing at 0
2020-10-18 00:33:04 +02:00
def
5c1b8cd221
Fix clang-analyzer-deadcode.DeadStores
...
/media/ddnet/src/game/client/components/statboard.cpp:288:3: warning: Value stored to 'tw' is never read [clang-analyzer-deadcode.DeadStores]
2020-10-14 15:45:47 +02:00
Edgar
5391ff8cc9
fix auto rules scrollbar bugs
2020-09-27 17:20:41 +02:00
def
3be8a592e5
Run clang-format
...
Purely automatic change. In case of conflict with this change, apply the
other change and rerun the formatting to restore it:
$ python scripts/fix_style.py
2020-09-26 21:50:15 +02:00
bors[bot]
7000987ff5
Merge #2884
...
2884: Add scrollbar to auto rules list, fixes #2514 r=def- a=edg-l
![image](https://user-images.githubusercontent.com/15859336/93710826-afde7e80-fb49-11ea-9754-c44c79d5ff94.png )
It doesn't show a scrollbar when there aren't more than 5 rules.
Co-authored-by: Edgar <git@edgarluque.com>
2020-09-24 17:01:19 +00:00
Edgar
76f3dbfe64
fix scrolling triggering zoom
2020-09-24 18:52:31 +02:00
Edgar
af29d8da99
remove unnecessary condition
2020-09-24 18:09:35 +02:00
Jupeyy
84cad658d6
Add new renderer(as streamed vertices) for editor
2020-09-23 16:45:32 +02:00
bors[bot]
4875b0993a
Merge #2907
...
2907: properly set sound envelope offsets for sound sources r=def- a=Patiga
before, `m_SoundEnvOffset` was always set to the same value as `m_PosEnvOffset`, due to wrong behavior in the ui.
Co-authored-by: patiga <patigatus21@gmail.com>
2020-09-22 14:17:21 +00:00
patiga
b437526925
run fix_style script
2020-09-22 15:42:20 +02:00
patiga
2ef344ea1a
set the correct variable
2020-09-22 14:50:04 +02:00
Learath
bbdcb7035d
Style
2020-09-22 15:47:21 +03:00
Learath
586043fc64
Use fixed point conversion consistently
2020-09-22 15:29:16 +03:00
Edgar
9cdaba88dc
fix style
2020-09-20 14:08:27 +02:00
Edgar
ffade19e19
don't show scrollbar if not needed on auto rules
2020-09-20 14:01:28 +02:00
Edgar
2587328aa4
add scrollbar to auto rules list, fixes #2514
2020-09-20 13:52:38 +02:00
Fireball
bb2be60a08
Ask for confirmation before placing border tiles ( fixes #2823 )
2020-09-20 01:42:07 +01:00
Jupeyy
a1eb5dc114
Max images(for editor, clamp for client and warning for mapconvert) ( fixes #2148 )
2020-09-19 21:22:21 +02:00
def
433881824a
Only make Esc key leave editor when no popup is open
2020-09-15 21:57:09 +02:00
Andrii
5ef0270cd2
Fix map details layout
2020-09-02 18:28:28 +03:00
def
b718282def
Add warning for editor as well
2020-08-31 15:08:04 +02:00
def
c99d791f4b
Add warning in editor for image widths
2020-06-21 01:14:36 +02:00
Andrii
e1828b88ab
fix more format failures
2020-05-21 00:44:41 +02:00
Andrii
4f62389eda
follow naming convention
2020-05-21 00:44:41 +02:00
Andrii
1ae3d5e69c
add key binding description to find empty slot button
2020-05-21 00:44:41 +02:00
Andrii
e132fac612
hide Entities popup after item selected
2020-05-21 00:44:41 +02:00
Andrii
29f093841c
add switch empty slot finder button
2020-05-21 00:44:41 +02:00
Andrii
192d118c85
add binding for teleFindEmpty button
2020-05-21 00:44:41 +02:00
Andrii
1c870a3e1b
fix some tele number picker issues
2020-05-21 00:44:41 +02:00
Andrii
0f1af41911
add binding for tele/switch/speedup/tune button
2020-05-21 00:44:41 +02:00
Learath
d2498f257c
Stateful editing
2020-02-28 18:25:27 +03:00
Learath
f679fbfbc5
Allow editing multiple tile layer props
2020-02-27 16:53:12 +03:00
Learath
2abe4fbcfb
Display envelope name
2020-01-23 20:27:01 +01:00
bors[bot]
33d88f647c
Merge #1974
...
1974: more typesafty in the graphics. introduced the IGraphics::CTextureHandle r=def- a=ChillerDragon
Edited by @ChillerDragon to fit in ddnet
(cherry picked from commit cb95e8dfe8
)
Co-authored-by: Magnus Auvinen <magnus.auvinen@gmail.com>
2019-11-27 17:55:45 +00:00
Magnus Auvinen
6a6a5f00c9
more typesafty in the graphics. introduced the IGraphics::CTextureHandle
...
Edited by @ChillerDragon to fit in ddnet
(cherry picked from commit cb95e8dfe8
)
2019-11-22 18:08:37 +01:00
ChillerDragon
227a223c32
Fix a few names in popups
2019-11-22 12:28:34 +01:00
Learath
15058330fa
Don't inherit from vector, more cleanup
2019-04-27 00:47:34 +03:00
Learath
93d14a1eca
Inconvenience for windows
2019-04-26 22:36:49 +03:00
Learath
65a17599e1
Add ColorHSVA, phase out more vec3's
2019-04-26 15:06:32 +03:00
Dennis Felsing
cde07b420b
Implement changes suggested by -Wuseless-cast
...
But don't enable it yet because I'm not sure what the best way is.
2019-04-11 19:54:43 +02:00
Bojidar Marinov
6ca6fce0b2
Allow editing texture UV offsets in Quad properties.
...
Manual cherrypick of de82ad7a26
, original code by @cinaera
2019-03-29 13:38:21 +02:00
12pm
2daafdaad5
Disable unused tiles only for DDNet entities
2019-02-08 04:04:41 +01:00
Dennis Felsing
f82ab4cb21
Fix editor crash (reported in #1425 )
2019-01-09 08:38:49 +01:00
Bojidar Marinov
823e4ee0f3
Save automapper config as external-typed mapitem
2018-10-09 13:17:05 +03:00
Bojidar Marinov
c52a3c970e
Add option to automatically run the automapper
...
Also, put automapping config selection seperatelly from the automapper button.
Also, add seed parameter to the automapper.
2018-10-09 12:56:48 +03:00
Tim Schumacher
ab6f344daa
Fix current selection highlighting
2018-10-02 23:39:22 +02:00
Tim Schumacher
fd52bc7a26
List all game layer entities images in directory
2018-10-02 23:08:17 +02:00
Tim Schumacher
bee694a8cb
Forgot to remove debug
2018-10-01 23:10:46 +02:00
Tim Schumacher
2e36ad67bb
Allow choosing game layer entities for different gametypes, closes #1283
2018-10-01 23:05:36 +02:00
Aerll
f79bf5d03b
selecting multiple quads
2018-08-13 11:11:56 +02:00
Bojidar Marinov
aa091bb8f7
Allow multiple layers to be selected and edited at the same time.
2018-07-25 23:57:58 +03:00
yangfl
1620fc9b0f
Fix typo
2018-02-07 16:10:40 +08:00
Learath2
09552a6d9f
Get rid of trailing whitespaces
2017-02-21 19:11:43 +03:00
BannZay
c6e7ad5e45
map details button name fix
2016-11-27 20:55:05 +02:00
BannZay
c658411f15
Load Current Map button added
2016-08-23 14:29:53 +03:00
Andrew
e6eb607cc8
PROPTYPE_ANGLE_SCROLL mixed
2016-06-02 17:53:52 +03:00
def
475df14134
Fix editor popups a bit
2016-05-14 15:16:52 +02:00
Tim Schumacher
afd0e5a3eb
rename some auto game tile placers
2016-05-05 18:23:04 +02:00
gamertyp
7a3f96431a
Re-ordered the Gametiles-menu
2016-05-04 22:30:16 +02:00