Commit graph

1010 commits

Author SHA1 Message Date
def 6f2c82c0d4 SUBSTRACT -> SUBTRACT 2021-02-01 14:55:26 +01:00
bors[bot] 124c4b1acf
Merge #3463
3463: Dynamically size scoreboard title r=heinrich5991 a=def-

![screenshot_2020-12-31_10-01-53](https://user-images.githubusercontent.com/2335377/103403147-80c7a800-4b4f-11eb-90d3-90d032439cf3.png)
![screenshot_2020-12-31_10-13-23](https://user-images.githubusercontent.com/2335377/103403580-ed8f7200-4b50-11eb-9798-01fd4e283405.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 if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] 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: def <dennis@felsin9.de>
2021-01-10 15:46:11 +00:00
Alexander Akulich c2f276cee1 Port CConfig API from the upstream (0.7.5)
The old (g_Config) API is kept to not break the stuff.

See commits:
    de5859b371
    78076761eb
2021-01-10 17:10:19 +03:00
Tim Schumacher 56bfab6f1c Make dragging quads in the editor more sensitive to small mouse deltas
Closes #963
2021-01-02 13:49:16 +01:00
def 992683c772 Dynamically size scoreboard title 2020-12-31 10:13:53 +01:00
bors[bot] e9b174a00f
Merge #3389
3389: Alternative alternative fix for malloc of size 0 r=def- a=heinrich5991

Has a short diff to the original code before a4f13ed4a8.
Supersedes #3353. Thanks for the idea, @timakro.

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] 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: heinrich5991 <heinrich5991@gmail.com>
2020-12-22 11:23:40 +00:00
Learath2 bd1c847300 Allow reordering in the settings editor 2020-12-14 12:06:11 +01:00
heinrich5991 e805e42a94 Alternative alternative fix for malloc of size 0
Has a short diff to the original code before a4f13ed4a8.
Supersedes #3353. Thanks for the idea, @timakro.
2020-12-08 12:29:10 +01:00
Jupeyy c0dbd4a6f5 Fix leak, initialize UI Element Rect 2020-11-25 13:11:34 +01:00
Jupeyy c989cd67f9 Check skin/sprite images for correctness 2020-11-18 07:59:15 +01:00
Jupeyy e2be287827 numeric robustness 2020-11-15 07:40:24 +01:00
Jupeyy 51a31774f8 Don't trigger text alignment for editboxes 2020-11-15 07:15:38 +01:00
bors[bot] 848bbf543d
Merge #3268
3268: Fix ScaleFontSize with too long strings r=Jupeyy a=def-

Thanks to PopCorn181 for report
![screenshot_2020-11-08_00-03-19](https://user-images.githubusercontent.com/2335377/98453118-d1c1ae00-2155-11eb-97cf-cd5a455c00d3.png)

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [x] Tested the change ingame
- [x] 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
- [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: def <dennis@felsin9.de>
2020-11-07 23:07:38 +00:00
def 7c0e2212e2 Fix ScaleFontSize with too long strings
Thanks to PopCorn181 for report
2020-11-08 00:02:35 +01:00
def 21d76ed31d NOLINT bugprone-parent-virtual-call where clang-tidy is stupid
/media/ddnet/src/game/editor/layer_game.cpp:42:35: warning: qualified name 'm_pEditor->m_Map.m_pFrontLayer->CLayerTiles::SetTile' refers to a member overridden in subclass; did you mean 'CLayerTiles'? [bugprone-parent-virtual-call]
                m_pEditor->m_Map.m_pFrontLayer->CLayerTiles::SetTile(x, y, through_cut);
                                                ^~~~~~~~~~~~~
                                                CLayerTiles::
/media/ddnet/src/game/editor/layer_game.cpp:42:35: note: FIX-IT applied suggested code changes
2020-11-05 08:25:34 +01:00
def bf8ae71b7d Fix and NOLINT bugprone-sizeof-expression 2020-11-05 08:25:34 +01:00
bors[bot] 4abf699726
Merge #3117
3117: Enable further clang-tidy checks to modernize the code r=heinrich5991 a=def-

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-auto.html

And fix the code:

    cmake -GNinja -DWEBSOCKETS=OFF -DMYSQL=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVIDEORECORDER=ON -DAUTOUPDATE=OFF -DANTIBOT=OFF -DUPNP=OFF -DPREFER_BUNDLED_LIBS=OFF -DINFORM_UPDATE=OFF -DCMAKE_CXX_CLANG_TIDY="clang-tidy;--fix-errors" -DCMAKE_C_CLANG_TIDY="clang-tidy;--fix-errors" .
    ninja -j 1

Manually fixed sizeof(auto) in a few occurences (i.e. server.cpp:1359)

First steps for #3088

Co-authored-by: def <dennis@felsin9.de>
2020-11-02 21:56:04 +00:00
bors[bot] d1cc109933
Merge #3228
3228: Add m_PosEnv (of sound sources) as index that must be offset when appending a map r=heinrich5991 a=Patiga

If you append a map to another, all indices of it must be offset. This doesn't happen with the position envelope index of sound sources, meaning it would (if the original maps had at least one envelope) point to the wrong envelope.

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] 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: Patiga <dev@patiga.eu>
2020-11-02 21:40:50 +00: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
Patiga 143074349e Add m_PosEnv as index that must be offset when appended 2020-11-01 23:04:33 +01:00
bors[bot] 9a257a76e1
Merge #3195
3195: Use str_truncate more often r=heinrich5991 a=def-

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] 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: Dennis Felsing <dennis@felsin9.de>
2020-10-26 12:08:34 +00:00
Dennis Felsing 9c8c36456b Use str_truncate more often 2020-10-26 12:56:21 +01:00
bors[bot] 331c9f695c
Merge #3124
3124: Remove option to make map sounds external r=def- a=Patiga

![2020-10-17-180507_401x333_scrot](https://user-images.githubusercontent.com/44099679/96347669-8dd21080-10a3-11eb-8b24-abdab7f41020.png)
Right now it is impossible to have a working external sound. External
sounds render unusable the moment the map is saved and given to another
player. For the mapper it seems like everything is working since the
mapper has the sound file. For anyone else it simply won't work. Since
1. there is no use for it and
2. it adds unnecessary complexity and confusion, 
I propose removing it entirely.

None of the ddnet maps use external sounds, only 25 maps from the map archive have external sounds

Please have a look over the changed ui code.

Co-authored-by: Patiga <dev@patiga.eu>
2020-10-26 09:50:06 +00:00
Jupeyy 19ce3fa20e Disable text alignment for editboxes 2020-10-25 22:19:19 +01:00
def 64c7f2b731 Allow zooming in further in Editor
As requested by Cøke
2020-10-22 16:59:31 +02: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
Patiga 8d7b00275f Remove obselete line 2020-10-17 20:16:26 +02:00
Patiga 14539a8046 Remove option to make map sounds external
Right now it is impossible to have a working external sound. External
sounds render unusable the moment the map is saved and given to another
player. For the mapper it seems like everything is working since the
mapper has the sound file. For anyone else it simply won't work. Since
1. there is no use for it and 2. it adds unnecessary complexity and
confusion, I propose removing it entirely.
2020-10-17 17:45:56 +02:00
bors[bot] 996270af18
Merge #3120
3120: Embed map sounds by default r=heinrich5991 a=Patiga

Not one ddnet map has a external map sound since there are none which would work that way

Co-authored-by: Patiga <dev@patiga.eu>
2020-10-17 13:16:55 +00:00
Patiga 17e531374c Embed sounds by default 2020-10-17 14:05:06 +02:00
def 6443e708b5 Fix clang-analyzer-core.CallAndMessage
/media/ddnet/src/game/editor/auto_map.cpp:94:17: warning: Called C++ object pointer is null [clang-analyzer-core.CallAndMessage]
                                int RunID = pCurrentConf->m_aRuns.add(NewRun);
                                            ^
2020-10-14 15:45:47 +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
def a4f13ed4a8 Fix clang-analyzer-optin.portability.UnixAPI
and mark some false positives

/media/ddnet/src/engine/client/backend_sdl.cpp:329:30: warning: Call to 'malloc' has an allocation size of 0 bytes [clang-analyzer-optin.portability.UnixAPI]
2020-10-14 15:45:43 +02:00
def 911cb5cb9b CAutoMapper: Delete pUpdateLayer
/media/ddnet/src/game/editor/auto_map.cpp:433:1: warning: Potential leak of memory pointed to by 'pUpdateLayer' [clang-analyzer-cplusplus.NewDeleteLeaks]
}
^
2020-10-14 14:54:33 +02:00
Patiga a252097e9a Fix comments 2020-10-13 09:53:33 +02:00
Patiga 06e90505b1 Use the same value as vanilla 2020-10-13 09:50:03 +02:00
Learath2 d8c9a71e18 Remove usages of qsort 2020-10-10 01:18:42 +02:00
bors[bot] f93c8e4fdb
Merge #2987
2987: Modulize skins, particles, emoticons and game r=def- a=Jupeyy

fixes #2203 

Puh, something i always wanted todo.
Need to error read, bcs alot of copy paste.

Modulizes all images, so that all images are mipmap indepedent, without texeloffset problems

I also added the ninja bar analyzer for #2921


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2020-10-09 15:20:48 +00:00
bors[bot] ce9ba5ec09
Merge #3018
3018: Editor: Improve usability of server settings r=Jupeyy a=def-

- Add Mod button
- Show Del button only when it makes sense
- Update command input text when clicking on an existing command
- Make command clearable

As requested by Cøke

Co-authored-by: def <dennis@felsin9.de>
2020-10-09 14:48:59 +00:00
def ea8bee4d34 Focus command field when something changed 2020-10-09 16:40:59 +02:00
bors[bot] cf6ace1744
Merge #3022
3022: Text alignment r=def- a=Jupeyy

i think the round borders create a bit of optical illusion, e.g. the "V" in edtior is only 1 pixel of, but looks like its completly left xd

i checked at few resolutions with gimp and only saw around 1 pixel margin of error, but go ahead and test yourself :D

Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2020-10-09 14:31:25 +00:00
Jupeyy 8d6148b20b Modulize skins, particles, emoticons and game 2020-10-09 09:07:19 +02:00
Jupeyy 52911e4302 Use std::sort instead of bubble_sort 2020-10-08 08:00:01 +02:00
Jupeyy 5ebabe2ece Text alignment 2020-10-07 04:44:35 +02:00
bors[bot] 4a30ef1e9a
Merge #3020
3020: Fix all Multiplication type alerts by CodeQL r=heinrich5991 a=def-

> Multiplication result converted to larger type

> A multiplication result that is converted to a larger type can be a
> sign that the result can overflow the type converted from.

Example: https://github.com/ddnet/ddnet/security/code-scanning/17?query=ref%3Arefs%2Fheads%2Fmaster

Co-authored-by: def <dennis@felsin9.de>
2020-10-07 00:56:19 +00:00
bors[bot] 1f7d544349
Merge #3010 #3014
3010: Use hours in score hud and record r=Learath2 a=def-



3014: Scale auto mapper text size (partially fixes #3013) r=Learath2 a=def-



Co-authored-by: def <dennis@felsin9.de>
2020-10-06 11:22:06 +00:00
bors[bot] 79b5852e17
Merge #3021
3021: only load + save auto mappers for tile layers, not physics layers r=def- a=Patiga

If I'm not mistaken, loading a map without auto mappers, then saving would've caused uninitialized values to be written to the auto mappers of physics layers.

Co-authored-by: patiga <dev@patiga.eu>
2020-10-06 07:37:26 +00:00
patiga 95fadea794 Fix style properly 2020-10-05 20:09:19 +02:00
patiga 09a9ca9699 Conform to style 2020-10-05 19:59:48 +02:00
patiga d123d928b4 only load + save auto mappers for tile layers, not physics layers 2020-10-05 19:44:26 +02:00
def 62dc12aacb Fix all Multiplication type alerts by CodeQL
> Multiplication result converted to larger type

> A multiplication result that is converted to a larger type can be a
> sign that the result can overflow the type converted from.

Example: https://github.com/ddnet/ddnet/security/code-scanning/17?query=ref%3Arefs%2Fheads%2Fmaster
2020-10-05 19:03:54 +02:00
def 032ae67814 Editor: Improve usability of server settings
- Add Mod button
- Show Del button only when it makes sense
- Update command input text when clicking on an existing command
- Make command clearable

As requested by Cøke
2020-10-05 17:16:48 +02:00
Jupeyy 50b20fb1cd Make animations more consistent with high float values 2020-10-05 02:32:50 +02:00
def c25aede8ea Scale auto mapper text size (partially fixes #3013) 2020-10-04 22:39:43 +02:00
Learath2 db9a762f58 Fix multiple layer editing. Close #2981 2020-10-03 18:35:45 +02:00
patiga fc9e1bc325 initialize physics layer pointer, layer item version 2020-10-02 17:45:28 +02:00
Learath 88c054261a Fix multiple layer selection for groups 2020-09-29 13:31:22 +03:00
Edgar 5391ff8cc9
fix auto rules scrollbar bugs 2020-09-27 17:20:41 +02:00
bors[bot] 6bb8cda483
Merge #2926
2926: clang-format entire repo r=heinrich5991 a=def-



Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2020-09-26 22:10:58 +00: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
Jupeyy c69c765507 Only auto dilate for transparent images 2020-09-26 18:57:19 +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 fb3b40917a
fix style script 2020-09-24 18:53:11 +02: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
bors[bot] 06b519398b
Merge #2906
2906: Use fixed point conversion consistently r=def- a=Learath2

This fixes the issue with the Tex UV coords being complete garbage

Co-authored-by: Learath <learath2@gmail.com>
2020-09-22 13:13:16 +00: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
bors[bot] d9e748ee91
Merge #2888
2888: Fix dilate alpha threshold & auto apply dilate on embedded texture in editor r=def- a=Jupeyy

editor dilate can be turned off.
about the threshold:

old:
![Screenshot_20200920_175749](https://user-images.githubusercontent.com/6654924/93716689-8d605b80-fb71-11ea-8049-848c8bd3a7f2.png)

new:
![Screenshot_20200920_175846](https://user-images.githubusercontent.com/6654924/93716692-8e918880-fb71-11ea-8108-9be5378cd932.png)


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2020-09-22 12:38:53 +00:00
Learath 586043fc64 Use fixed point conversion consistently 2020-09-22 15:29:16 +03:00
def ddb88c6f3b Editor: Select game layer by default
Since it's the most important layer
2020-09-21 19:36:28 +02:00
Jupeyy 0ec7f1e1dc Fix dilate threshold & automatically apply dilate on embedded textures in the editor 2020-09-21 19:17:38 +02: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
bors[bot] 21e080596a
Merge #2836 #2841 #2845
2836: Only make Esc key leave editor when no popup is open r=Jupeyy a=def-



2841: Fix ingame browser tab change (fixes #2839) r=Jupeyy a=def-



2845: Fix spacing in kick-vote menu (center tees and text) r=Learath2 a=def-

Old: ![screenshot-20200917@090205](https://user-images.githubusercontent.com/2335377/93431529-882ab480-f8c4-11ea-8e56-dfe903a5ae06.png)
New: ![screenshot-20200917@090226](https://user-images.githubusercontent.com/2335377/93431538-8cef6880-f8c4-11ea-8946-449e7aa6dea7.png)


Co-authored-by: def <dennis@felsin9.de>
2020-09-17 14:00:09 +00:00
def 433881824a Only make Esc key leave editor when no popup is open 2020-09-15 21:57:09 +02:00
Jupeyy dc3580d976 0.7 cursor 2020-09-15 16:18:12 +02:00
def a67a8e36aa clang-format: fix style 2020-09-14 16:00:51 +02:00
Vlad be90f3f48b Replaced tile names. 2020-09-13 23:00:49 +03:00
heinrich5991 ffab6292ad
Merge branch 'master' into pr-start 2020-09-11 14:25:50 +02:00
heinrich5991 aa46ca6bf9 Fix some style issues via scripts/fix_style.py, size_t 2020-09-11 00:47:38 +02:00
Jupeyy 3b403f76a9 Fix editor speedup brush 2020-09-11 00:34:43 +02:00
def 2cdc7d0faf Adapt 0.7 start menu
- Working Local Server button (needs fixing for Windows)
- Highlight buttons if server is running, new news is out and editor has
  unsaved changes
2020-09-10 20:13:01 +02:00
def a496583a93 Fix proof circle position in editor
As reported by Ravie on Discord. Tee is not drawn exactly in center.
2020-09-04 23:57:21 +02:00
bors[bot] ca30afdd66
Merge #2710
2710: Fix layers right click on item opens menu for previously selected (left clicked) item r=heinrich5991 a=BannZay

```
Im 'corneumToday at 16:55
when i have a layer selected and rightclick on another one to change its properties, it doesnt switch to that layer. that hasnt always been this way and its throwing me off lately
especially because it still opens the menu for the other layer
```

Co-authored-by: Andrii <bannzay3@gmail.com>
2020-09-02 15:59:48 +00:00
Andrii 5ef0270cd2 Fix map details layout 2020-09-02 18:28:28 +03:00
Andrii e156cd570c keep layers selection on group right click 2020-09-02 18:11:57 +03:00
Andrii 392f58ae2f select layer under mouse pointer on right click 2020-09-02 18:11:24 +03:00
bors[bot] ea7b2671bc
Merge #2691 #2701 #2702 #2705
2691: Also check for divisibility by 16 of height (fixes #2687) r=heinrich5991 a=def-



2701: Set search field active when opening file dialog in editor r=heinrich5991 a=def-



2702: Remove fallback for Teeworlds' settings.cfg (partially fixes #2698) r=heinrich5991 a=def-



2705: Clarify kill and /kill r=heinrich5991 a=def-



Co-authored-by: def <dennis@felsin9.de>
2020-09-01 14:25:09 +00:00
def c0f8ad50dc Set search field active when opening file dialog 2020-09-01 09:48:51 +02:00
def 19d9741438 Rename m_aFileDialogActivate to m_FileDialogActivate 2020-09-01 09:48:13 +02:00
def b718282def Add warning for editor as well 2020-08-31 15:08:04 +02:00
def 7032249b26 Fix leak when loading map in editor (fixes #2573) 2020-08-17 00:09:07 +02:00
def a8aeaa4cb6 Editor: Fix Left/right arrow keys when editing text
as reported by Silex
2020-08-11 12:21:33 +02:00
def 285701695b Prevent crash by keeping m_SelectedImage/Sound in correct range 2020-08-10 17:41:58 +02:00
def 29332ea72e Editor: Add ctrl+n for new map, ctrl+a to append map, add hints 2020-08-10 09:28:36 +02:00
def 1ad43a76dd Editor: Support up/down for images/sounds 2020-08-08 12:22:37 +02:00
def 4c9d03c063 Editor: Left/Right switch between layers/images/sounds 2020-08-08 12:09:15 +02:00
def c66201dd22 Editor: Get rid of some debugging output 2020-08-08 12:09:03 +02:00
def 8174dfa779 Editor: Support up/down keys to switch layers
Also with shift to add layers

As suggested by Lady Saavik
2020-08-08 12:06:17 +02:00
def 02f6e7081a Right click: Don't remove selection of layers 2020-08-08 10:33:18 +02:00
Fireball ab9b96ddb2 Backported fix for Text() incorrect parameter type (int -> float)
The original fix was done by @oy for 0.7.4.
2020-07-15 20:49:14 +01:00
Fireball b1c17c3248 Backported fix for TextWidth() parameter mix-up
Fixes #2511 (Stack-buffer-overflows in some UIs).
The original fix was done by @oy for 0.7.4.
2020-07-15 20:48:29 +01:00
bors[bot] de328c1360
Merge #2301
2301: map_convert_07: Check image width for divisibility by 16 r=heinrich5991 a=def-

As noticed on Sunny Land.

> [5:31 PM] redix: in theory it should be enough if width and height are divisible by 16

Now running this over our maps and fixing them manually.

Co-authored-by: def <dennis@felsin9.de>
2020-06-23 23:30:34 +00:00
def 6cfc6adc83 Make ctrl-s/ctrl-l etc work everywhere in editor (fixes #2302)
instead of just in the layers view
2020-06-21 01:44:01 +02:00
def c99d791f4b Add warning in editor for image widths 2020-06-21 01:14:36 +02:00
def cf7dad8125 Get rid of the clamp that breaks most editor value selection 2020-05-30 09:09:01 +02:00
def 6887b0ff3b Fix image/sound selection in editor
Follow-up to https://github.com/ddnet/ddnet/pull/2186

Thanks to Cøke for notifying me
2020-05-28 10:09:29 +02:00
def fd67259b77 Silence GCC warning
src/game/editor/auto_map.h:47:9: warning: ‘*((void*)& NewConf +16)’ may be used uninitialized in this function [-Wmaybe-uninitialized]

I don't think it's an actual problem
2020-05-23 18:11:35 +02:00
Zwelf 32085a091d Remove unused declaration 2020-05-22 16:38:20 +02:00
Andrii e78b8ac6d8 fix format issues 2020-05-21 00:44:52 +02:00
Andrii ed0b15859a follow naming convention 2020-05-21 00:44:52 +02:00
Andrii 0505a0b577 code formatting 2020-05-21 00:44:52 +02:00
Andrii ab79036873 Set camera position on LoadCurrentMap 2020-05-21 00:44:52 +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 df6e7ef454 add condition for animations 2020-05-21 00:44:41 +02:00
Andrii b24f12cec8 fix previously made mistake 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 1a5f0ed6a2 use shift instead of alt for load current map 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
Andrii d3df450715 add more conditions to menu rendering 2020-05-21 00:44:41 +02:00
Andrii c9afec083d add toggle grid key binding 2020-05-21 00:44:41 +02:00
Andrii f71c886e34 minor refactor 2020-05-21 00:44:41 +02:00
Andrii 63f185fe94 add LoadCurrentMap key binding 2020-05-21 00:44:41 +02:00
patiga 3f8bebd7af boundary check on curve type label in editor, avoids client crash 2020-05-19 16:52:30 +02:00
patiga 4bbd019423 fix whitespaces 2020-05-18 00:33:35 +02:00
patiga 359257f73a write automapper version, was not initialized 2020-05-17 23:28:10 +02:00
def b480492ded Don't count freshly loaded map as modified (fixes #2178)
The reason is that we increased the sensitivity of the modified flag to
include adding layers and groups, and simply loading the map already
adds those, so every loaded map was considered modified.
2020-05-16 08:17:50 +02:00
Learath d2498f257c Stateful editing 2020-02-28 18:25:27 +03:00
Learath f2103881c8 Add shift by, fix id overlap 2020-02-28 15:33:32 +03:00
Learath a50e59d4f6 Allow editing colors, add warning 2020-02-27 18:02:36 +03:00
Learath f679fbfbc5 Allow editing multiple tile layer props 2020-02-27 16:53:12 +03:00
bors[bot] 8ab8834ccb
Merge #2048
2048: Display envelope name in popups r=12pm a=Learath2

A dropdown would've worked better, but we don't have one

Co-authored-by: Learath <learath2@gmail.com>
2020-01-23 20:54:49 +00:00
Learath e567fde9d7 Names aren't unique, thinner popup 2020-01-23 21:24:48 +01:00
Learath a2eee9a8db Truncate properly 2020-01-23 20:48:42 +01:00
Learath 2abe4fbcfb Display envelope name 2020-01-23 20:27:01 +01:00
12pm 9dcfcc8f10 Modify envelope index when appending maps
fixes #2044
2020-01-23 18:30:55 +01:00
ChillerDragon 949aa124e9 Overkill optimize editor code runs 200 fps faster 2020-01-19 17:48:07 +01:00
12pm 82ac6091eb Fix rotating rotatable tiles in switch layer 2020-01-17 18:22:41 +01:00
Corantin H a73525361b Fix del key removing commands while in editbox 2020-01-16 15:01:45 +01:00
ChillerDragon 928e5407eb Style 'void foo() {' -> 'void foo()\n{' 2019-12-21 14:35:09 +01:00
Aerll 9f4721b74b
Fix: automapper skips tiles when it shouldn't
In case of something like: INDEX 0 OR 1 all tiles need to be automapped.
2019-12-05 15:28:35 +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
bors[bot] d589f266dc
Merge #1973
1973: Rename rifle to laser r=def- a=ChillerDragon

This makes it easier to copy code from/to 0.7
23df3c609e

For the user only the rcon command to give/remove ``laser``/``unlaser`` changes.

Co-authored-by: ChillerDragon <chillerdragon@gmail.com>
2019-11-27 17:36:03 +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 96c9b1ab73 Rename rifle to laser
This makes it easier to copy code from/to 0.7
23df3c609e
2019-11-22 15:37:18 +01:00
ChillerDragon 227a223c32 Fix a few names in popups 2019-11-22 12:28:34 +01:00
Learath ba12250892 Constrain ValueSelector to integer multiples of Step 2019-09-22 14:21:17 +03:00
Learath 37d9e4fa26 Add a saner way to select angles. Close #1916 2019-09-20 23:57:35 +03:00
Learath 918003911c Fix bug handling speedup brushes 2019-09-20 21:52:28 +03:00
heinrich5991 1e2b8a4a3e Replace str_comp_num with str_startswith 2019-07-31 21:20:03 +02:00
12pm 5f7a09dfe3 Correctly embed replacing images 2019-07-17 03:00:09 +02:00
ChillerDragon 6172a9dca0 Use the float type explicitly 2019-07-08 23:08:42 +02:00
heinrich5991 b90dd43118 Fix -Wdeprecated-copy from GCC9 2019-06-26 11:53:39 +02:00
fokkonaut 18e704017c Add missing letter to explanations 2019-06-02 18:01:28 +02:00
bors[bot] a2f44299e0 Merge #1678
1678: Handle colors in console r=def- a=Learath2

DEPENDS: #1654 

A better way to fix #1581 possibly deprecates #1597 

Co-authored-by: Learath <learath2@gmail.com>
2019-04-30 19:39:56 +00:00
12pm 3f76e17830 Fix FillSelection with no selected brush
As reported by BannZay on Discord
2019-04-30 14:24:13 +02:00
Learath 6c371a9a57 Even more refactoring 2019-04-27 01:11:15 +03: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 ab8b807c5d Shorten strings correctly (fixes #1652)
Using a string to format itself is undefined behaviour.
2019-04-25 08:19:31 +02:00
trml 0b3f3b03b5 Rewrite of prediction code, with additional prediction 2019-04-21 16:12:20 +02:00
12pm 7901cc26ad More reasonable layer size limits 2019-04-17 21:48:23 +02:00
12pm 50236ca45c Add editor copy & paste 2019-04-17 21:47:52 +02:00
def 9f3df78cae Fix typo 2019-04-16 20:37:12 +02:00
def f1cf222e95 Editor: Don't enter directory name in filename in save menu 2019-04-13 13:21:05 +02:00
def 598c8cf1c6 Editor: Left align "New folder" button in save menu 2019-04-13 13:21:00 +02:00
def 87f588d8a3 Editor: Don't jump to first entry in file list when editing
Fixes saving a new map when a subdirectory already exists
2019-04-13 13:20:56 +02:00
bors[bot] 826a7781ae Merge #1621
1621: Actually enable -Wuseless-cast r=heinrich5991 a=def-

It's not supported in C and we only checked using a C compiler.

Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2019-04-12 00:08:19 +00:00
12pm a1dd2e45a5 Fix non destructive drawing with hookthrough shortcut
Fixes #1623
2019-04-11 21:43:22 +02: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
def 94f3d97ddf Remove unmaintained Android code (fixes #1575) 2019-04-10 19:40:50 +02:00
def 11127f9344 Release fixes 2019-04-10 17:57:56 +02:00
Dennis Felsing 2d69935a6b Add explanations for TILE_THROUGH_CUT/ALL/DIR 2019-04-10 15:48:23 +02:00
Dennis Felsing bdb579330d Improve game tile explanations a bit
As suggested by Bojidar and jao
2019-04-09 14:23:40 +02:00
def 05fe69751d Add jao's explanations for telegun 2019-04-08 22:36:47 +02:00
def eda16acbca Explain game tiles and entities in editor (fixes #1600)
- Explanations by Lady Saavik taken from https://ddnet.tw/explain/
- CCW/CW were mixed up in enum names, fixed
- Make sure that the texts fits, otherwise reduce font size
- Still need explanations for Portal tiles
2019-04-08 19:39:56 +02:00
def 9df30dc235 Localize mentions 2019-04-06 15:18:40 +02:00
12pm 98bfeb3e72 Notify about chat mentions in editor 2019-04-06 11:32:50 +02:00
12pm 4efc0e3b82 Make world offset calculation more accurate
Noticed that after some time groups with a parallax different than 100 were incorrectly rendered in the editor
2019-04-03 01:05:38 +02:00
bors[bot] 5c919b6aab Merge #1549
1549: Allow editing texture UV offsets in Quad properties r=def- a=bojidar-bg

Partial manual cherrypick of de82ad7a26.

Co-authored-by: Bojidar Marinov <bojidar.marinov.bg@gmail.com>
2019-03-29 13:11:18 +00: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 427171bb17 Merge "Add Quad/Sound" + shortcut to add them at mouse position, add quads true to size 2019-03-28 13:41:07 +01:00
12pm 0abbba4c5d Add non-destructive brush drawing
New brush draw mode that doesn't override existing tiles. Empty brush still acts as an eraser. Button and ctrl+d shortcut to toggle it.
2019-03-26 19:19:25 +01:00
bors[bot] 958778b441 Merge #1531
1531: Don't rotate static game tiles and fix switch rotation r=def- a=12pm

Should be handy for mapping.
Can be disabled by activating unused tiles (don't think it's worth a separate toggle and if you want to do it, you're doing something unusal)

Co-authored-by: 12pm <30786226+12pm@users.noreply.github.com>
2019-03-24 19:43:27 +00:00
12pm 4ca69a39de Default layer names to the selected image/sound
And don't paste default names into the edit field
2019-03-24 03:22:29 +01:00
12pm dff702bd2c Don't rotate static game tiles and fix switch rotation
Should be handy for mapping.
Can be disabled by activating unused tiles (don't think it's worth a separate toggle and if you want to do it, you're doing something unusal)
2019-03-23 01:11:32 +01:00
def 1e4890c499 More error checking in system.c (fixes #1317) 2019-03-19 23:16:29 +01:00
Dennis Felsing 1fec65572b
Merge pull request #1500 from 12pm/extraeditor-fix
Fix editor render glitch
2019-03-18 07:58:12 +01:00
12pm 90e2b355ae Fix editor render glitch 2019-03-18 02:34:24 +01:00
12pm 8fb77f1a26 Fit sound name in select button too 2019-03-18 01:14:32 +01:00
12pm ffe50b3b25 Don't change active edit box corners to default 2019-03-12 22:25:01 +01:00
bors[bot] 6a791fe8de Merge #1486
1486: Fit image name in select button r=def- a=12pm

Adjusts font size a bit and truncates text if it overflows

Co-authored-by: 12pm <30786226+12pm@users.noreply.github.com>
2019-03-12 20:12:09 +00:00
12pm 0dd0de5ad4 Fit image name in select button
Adjusts font size a bit and truncates text if it overflows
2019-03-12 19:35:22 +01:00
def 6f9cfd5af1 Increase MAX_PATH_LENGTH to support our own downloadedmaps names 2019-03-12 18:43:03 +01:00
Dennis Felsing 984df7f49d
Merge pull request #1481 from 12pm/game-tiles
Add auto game tiles to all possible layers, increase layer size if needed
2019-03-12 16:54:04 +01:00
12pm 7c227c563d Add auto game tiles to all possible layers, increase layer size if needed 2019-03-12 02:35:29 +01:00
Dennis Felsing f0cce859ef
Merge pull request #1476 from ddnet/remove-save
Remove save group/layer button (fixes #1475)
2019-03-11 22:58:40 +01:00
Dennis Felsing 40591c2f8b Remove save group/layer button (fixes #1475) 2019-03-11 22:58:18 +01:00
Bojidar Marinov e944817472
Fix automapper not removing the Opaque flag before checking if flags match 2019-03-11 14:35:24 +02:00
Bojidar Marinov 1ca48a38ac
Fixup #1454, inadvertedly broke game layer picker 2019-02-13 21:11:13 +02:00
Bojidar Marinov 352157ddbe
Fix crash when painting tiles from a non-switch to a switch layer
Fixes #1452.
2019-02-11 10:41:26 +02:00
12pm 2daafdaad5 Disable unused tiles only for DDNet entities 2019-02-08 04:04:41 +01:00
def e8e2cd9f49 Revert "Reset brush when changing active layer (fixes #485)"
Made it impossible to copy layer content to another layer and then use
autofiller on that: https://forum.ddnet.tw/viewtopic.php?f=16&t=6450

This reverts commit df6e3a541f.
2019-01-11 17:57:37 +01:00
Dennis Felsing b0709bbe5f
Merge pull request #1426 from ddnet/mouse-editor
Hacky mouse editor fix (fixes #1367)
2019-01-11 12:16:23 +01:00
def df6e3a541f Reset brush when changing active layer (fixes #485) 2019-01-11 12:15:19 +01:00
def 8c4a26fa63 Fix editor fullscreen mode (fixes #1303)
By initializing ToolBar
2019-01-11 10:48:23 +01:00
def 9b88d8f418 Hacky mouse editor fix (fixes #1367) 2019-01-11 10:02:15 +01:00
def 16f6e23aaa Nicer fix for crash 2019-01-10 15:44:04 +01:00
def 1c85c962ef Fix automap crash (reported in #1425) 2019-01-10 15:38:04 +01:00
Dennis Felsing f82ab4cb21 Fix editor crash (reported in #1425) 2019-01-09 08:38:49 +01:00
Learath2 c601df8b28 Switch around the colors for used/unused envelopes 2018-11-16 14:51:36 +01:00
Dennis Felsing 045533cef7
Merge pull request #1321 from bojidar-bg/x-add-auto-automapper
Add option to automatically run the automapper
2018-11-15 09:30:22 +01:00
Ryozuki 674d3f00e0 add support for blue teleport gun 2018-11-03 10:26:20 +01:00
Ryozuki ddf2e6af36 add tele-activator to the switch layer 2018-11-03 10:26:19 +01:00
Learath abd49ddbf7 Restore old behaviour to be safe :( 2018-10-30 18:56:46 +01:00
Learath 0ecda0ced4 Fix crash introduced by 1e2dce0. Close #1362 2018-10-30 18:13:32 +01:00
def aab6fa152a Fix #1357 2018-10-29 22:16:32 +01:00
bors[bot] 1b0b36c6eb Merge #1316 #1341 #1349
1316: code improvement on gameclient.cpp r=def- a=Ryozuki



1341: Mark unused envelopes r=def- a=Learath2

Thought I'd do this one as well while looking at the editor code.

1349: Don't ignore CONNECT packets with data that we don't know r=def- a=heinrich5991

This specifically affects 0.6.5. Just treat them the same way as those
without any data.

Co-authored-by: Ryozuki <edgar@ryobyte.com>
Co-authored-by: Learath <learath2@gmail.com>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2018-10-29 14:31:27 +00:00
Learath 657e869901 Handle Tile and Sound layers 2018-10-14 16:57:30 +03:00
Learath cdce9d84ac Mark unused envelopes. Fix #1139 2018-10-09 13:42:04 +03:00
Bojidar Marinov 823e4ee0f3
Save automapper config as external-typed mapitem 2018-10-09 13:17:05 +03:00
Bojidar Marinov 351fee2666 Optimize automatic automap to automap only around changes.
Should work, no flaws found when testing with grass_main
2018-10-09 12:56:48 +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
Learath 4fedd91020 Arrow keys should account for visibility 2018-10-08 19:07:25 +03:00
Learath ad566aa158 Consider the search text when counting elements 2018-10-08 18:43:39 +03:00
Learath 5c4203b747 Reset scroll when search text changes. Fix #1331 2018-10-08 18:43:37 +03:00
Dennis Felsing a09fa562be
Merge pull request #1314 from timakro/pr_editor_entities_gametypes
Allow choosing game layer entities for different gametypes, closes #1283
2018-10-07 23:02:20 +02:00
Dennis Felsing fc7b3732e6
Merge pull request #1315 from Learath2/dd_pr_brushsave
Implement brush saving. Fix #1111
2018-10-04 10:59:00 +02:00
Dennis Felsing 20b31723c9
Merge pull request #1323 from heinrich5991/pr_ddnet_fix_editor_dontembedvanilla
Duh. Fix editor embedding vanilla images and not others
2018-10-03 20:40:48 +02:00
heinrich5991 479dc8ad8f Duh. Fix editor embedding vanilla images and not others
I don't know how I managed to get this wrong.

Fixes #1178.
2018-10-03 20:34:13 +02: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
Learath fef22f34f2 Implement brush saving. Fix #1111 2018-10-02 03:52:01 +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
Dennis Felsing 24bd8f2d56
Merge pull request #1312 from timakro/pr_fix_dragging_quads
Fix #963 dragging quads
2018-10-01 22:39:15 +02:00