1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 15:17:28 +08:00
Commit Graph

218 Commits

Author SHA1 Message Date
Dan Balasescu
fd93b42630
Merge pull request #17217 from peppy/skin-editor-reload-on-scene-change
Refactor `SkinEditor` to support switching target screens without full reload
2022-03-14 18:02:01 +09:00
Dean Herbert
3c5fda5f23 Add early exist if the target screen is no longer current 2022-03-14 17:24:31 +09:00
Dan Balasescu
3fff7f4b7e Require ScoreProcessor to receive ruleset 2022-03-14 15:51:10 +09:00
Dean Herbert
8d1ee28e67 Add settings modification UI to skin editor 2022-03-13 17:03:25 +09:00
Dean Herbert
7a2a3528ef Merge branch 'skin-editor-reload-on-scene-change' into skin-component-settings 2022-03-13 17:03:23 +09:00
Dean Herbert
f95e753adb Rename double-container variable name 2022-03-13 16:10:06 +09:00
Dean Herbert
d1a9b88fe7
Fix typo in comment
Co-authored-by: Salman Ahmed <frenzibyte@gmail.com>
2022-03-13 16:05:45 +09:00
Dean Herbert
3db42dd772 Allow skin editor to target different target containers for placement purposes 2022-03-11 23:23:32 +09:00
Dean Herbert
9a1ade4f79 Refactor SkinEditor to support switching target screens without full reload 2022-03-11 23:08:40 +09:00
Bartłomiej Dach
2354737abe
Merge branch 'master' into scaling-container-better-custom-override 2022-03-03 22:32:23 +01:00
Dean Herbert
b5684aaa76 Scale -> Rect to read better 2022-03-02 20:33:28 +09:00
Dean Herbert
29ed419d53 Change how custom scales are applied to ScalingContainer to allow for better transitions 2022-03-02 20:13:01 +09:00
Dean Herbert
ff7db4f405 Replace jank buttons with menu in skin editor 2022-03-02 20:08:17 +09:00
Dean Herbert
243a1a3cf7 Fix incorrect origin specification for SkinSelectionHandler flips 2022-01-06 14:47:44 +09:00
Dean Herbert
866ae3472b Add global flip hotkeys 2022-01-05 16:48:07 +09:00
Dean Herbert
089b756f93 Invert logic to make reading easier 2021-12-30 16:03:16 +09:00
Dean Herbert
ef49f2ed0e Add extra extra safety against attempting to load a previously expired editor 2021-12-30 16:02:31 +09:00
Dean Herbert
b1a444180f Fix Show then Reset potentially resulting in incorrect load target 2021-12-29 21:46:34 +09:00
Dean Herbert
471eea750a Fix calling SkinEditorOverlay.Show before the overlay is loaded causing an exception
As seen at https://github.com/ppy/osu/runs/4652969942?check_suite_focus=true.
2021-12-29 21:18:17 +09:00
Dean Herbert
1eed2436e6 Clean up unused resolved properties 2021-12-03 18:49:49 +09:00
Jason Won
9e7d559f55 fix aspect locked scaling of skin components 2021-11-04 17:10:41 -04:00
Dean Herbert
6944151486 Apply batch fixing of built-in types using var 2021-10-27 13:04:41 +09:00
Dean Herbert
4fd19cbb0d Use null check instead of assert in Hide() due to public exposure 2021-09-29 18:58:43 +09:00
Dean Herbert
c5b7e97bd9 Fix skin editor potentially crashing during close process
As reported at
https://github.com/ppy/osu/discussions/14850#discussioncomment-1399382.
2021-09-29 18:53:49 +09:00
Dean Herbert
1b13b74740 Fix skin editor potentially leaving game-wide masking in the wrong state
Just going with the simplest way to solve this.

Closes https://github.com/ppy/osu/issues/14769.
2021-09-17 13:48:20 +09:00
smoogipoo
f9d5abff8a Update with keybinding changes 2021-09-16 18:26:12 +09:00
Bartłomiej Dach
b1087d14f3
Merge branch 'master' into skin-editor-button-access 2021-07-22 22:49:44 +02:00
Dean Herbert
21053381c7 Fix skin editor potentially eating GlobalAction.Back when not displayed 2021-07-22 15:59:00 +09:00
Dean Herbert
3fd8de3b91 Fix skin editor's fake overlay potentially getting into a bad state 2021-07-22 15:57:47 +09:00
ekrctb
1bff4373b3 Allow specifying flipping support of selection box different from scaling 2021-07-21 15:59:45 +09:00
Dean Herbert
16a2e63bd4 Use existing localisation 2021-07-20 19:44:02 +09:00
Dean Herbert
59457743e5 Move further to the right to avoid overlap with toolbox listing 2021-07-20 19:43:52 +09:00
Dean Herbert
9c4fbf45e9 Add the ability to enter and exit the skin editor via on-screen buttons 2021-07-20 19:36:12 +09:00
Dean Herbert
6e31c781bb
Merge pull request #13382 from ribbanya/clamp-skin-scale
Fix skin elements flipping when scaled below zero
2021-07-02 20:50:47 +09:00
aitani9
9b0fa6d3fc Make flipping reflect across the axes of the selection box 2021-07-01 15:38:38 -07:00
Dean Herbert
4b3165084d Move scoped functionality into local function 2021-06-22 16:40:56 +09:00
Robin Avery
0c8851f4b7
Extract drawable.ScreenSpaceDrawQuad to a variable 2021-06-11 07:06:22 -04:00
Robin Avery
a6774eb5b5
Inline getOriginPositionFromQuad 2021-06-11 06:59:00 -04:00
Robin Avery
c9b4f9eb71
Make getOriginPositionFromQuad local 2021-06-11 06:55:47 -04:00
Robin Avery
1bc8460902
Rename getTieredComponent to getAnchorFromPosition
Also rename parameter `component` to `xOrY`.
2021-06-11 06:53:40 -04:00
Robin Avery
6e181a6b63
Rename parameters of getTieredComponent 2021-06-11 06:53:04 -04:00
Robin Avery
a76eaeb52d
Make getTieredComponent local 2021-06-11 06:51:12 -04:00
Robin Avery
635300b311
Recalculate closest anchor when origin is changed 2021-06-11 06:28:30 -04:00
Robin Avery
a506f2a776
Revert rename of lambda variables 2021-06-11 06:22:24 -04:00
Robin Avery
2484ccd50c
Ensure scale x or y does not go below zero in SkinSelectionHandler.HandleScale 2021-06-08 11:49:25 -04:00
Robin Avery
10b6b72909
Add guard clause to applyOrigins and rename parameter 2021-06-08 10:29:45 -04:00
Robin Avery
d212918d67
Rename applyCustomAnchors to applyFixedAnchors for consistency with UsesFixedAnchor 2021-06-08 10:14:07 -04:00
Robin Avery
2c88e6df8d
Simplify applyClosestAnchor to one line by moving another guard clause 2021-06-08 10:09:48 -04:00
Robin Avery
f22cc981d1
Move guard clause from checkAndApplyClosestAnchor to applyAnchor 2021-06-08 09:51:39 -04:00
Robin Avery
529a80871b
Rename some methods for clarity
Methods which operate on a collection of `ISkinnableDrawable`s are now
plural; ones which take a single item are singular.

This also allows cutting down the name of `getClosestAnchorForDrawable`
to just `getClosestAnchor`.
2021-06-08 09:44:42 -04:00
Robin Avery
01da73daf2
Refactor updateDrawableAnchorIfUsingClosest 2021-06-08 09:25:49 -04:00
Robin Avery
6b127f50f2
Inline updateDrawableAnchorIfUsingClosest 2021-06-08 09:14:04 -04:00
Robin Avery
dc50ae40b9
Rename OverridesClosestAnchor to UsesFixedAnchor 2021-06-08 08:28:42 -04:00
Robin Avery
65f594f860
Rename applyAnchor to applyCustomAnchor 2021-06-07 05:08:18 -04:00
Robin Avery
6c9594ee35
Simplify and rearrange SkinSelectionHandler
The file has been restructured and reworded such that there are as few
differences as possible from b36b40cb34.
2021-06-07 02:40:15 -04:00
Robin Avery
29fa4fdf57
Refactor unacceptable syntax 2021-06-07 01:08:39 -04:00
Robin Avery
133d72a8c0
Rename UsingClosestAnchor
It is now "OverridesClosestAnchor". The logic is inverted accordingly.
2021-06-07 00:14:36 -04:00
Robin Avery
f28916e30f
Remove all UsingClosestAnchor() extension logic
It is replaced with ISkinnableDrawable.UsingClosestAnchor.
2021-06-07 00:04:53 -04:00
Robin Avery
6a456e53f4
Rename overly long method 2021-06-06 13:28:17 -04:00
Robin Avery
888882ac63
Remove first-person comment 2021-06-06 13:27:13 -04:00
Robin Avery
da1c38d5a9
Uninvert logic of SkinnableInfo.UsingClosestAnchor
Also rename "IsUsingClosestAnchor" to simply "UsingClosestAnchor".
2021-06-06 10:13:35 -04:00
Robin Avery
63346f6b75
Refactor getTieredComponent 2021-06-06 09:40:58 -04:00
Robin Avery
c9f5808bf2
Move lookup logic to DrawableExtensions
This is now a global lookup to be shared by serialization and editor.
2021-06-06 06:58:21 -04:00
Robin Avery
4aee76456f
Replace localised strings with static English 2021-06-06 05:34:32 -04:00
Robin Avery
c452715bf1 Allow skin elements to find closest anchor
- Resolves ppy/osu#13252
- Add localisation strings for the context menu instead of using enum
2021-06-06 01:32:04 -04:00
Dean Herbert
b36b40cb34 Remove unnecessary double specification 2021-05-26 15:20:47 +09:00
kamp
65649e5a62 Prevent skin editor crash when scaling 0 area drawables
Some skinnable drawables can have 0 width or height in certain
cases, leading to division by 0 and a crash when the position is
updated.
2021-05-24 21:36:42 +02:00
Dean Herbert
45c6a9ca91 Merge branch 'refactor-selection-rotate-logic' into fix-flip-logic-discrepancy 2021-05-22 21:17:58 +09:00
Dean Herbert
7d88a19d7f Remove unnecessary field storage of origin reference 2021-05-22 21:03:40 +09:00
Dean Herbert
34a5b22b79 Merge branch 'master' into refactor-selection-rotate-logic 2021-05-22 20:52:28 +09:00
Dean Herbert
485728ca4e
Merge pull request #12866 from peppy/refactor-selection-scale-logic
Add proper scaling support to skin editor
2021-05-22 20:07:03 +09:00
Dean Herbert
bb2fae55ce Merge branch 'master' into refactor-selection-rotate-logic 2021-05-21 19:19:54 +09:00
Dean Herbert
0d575f5728 Remove incorrect (and unintended) modulus logic 2021-05-21 15:06:53 +09:00
Dean Herbert
f9d51656b6 Fix scaling of rotated items not behaving in an understandable way 2021-05-21 15:02:36 +09:00
Dan Balasescu
7845d07dd5
Merge pull request #12886 from peppy/fix-skin-editor-context-menu-sticking
Fix skin editor context menus not dismissing when clicking away
2021-05-20 21:03:35 +09:00
Dean Herbert
1848bd902d Fix skin editor context menus not dismissing when clicking away 2021-05-20 19:51:07 +09:00
Dean Herbert
df5970fab4 Create base implementations of the two most common TernaryStateMenuItems 2021-05-20 19:34:53 +09:00
Dean Herbert
20f1ef4318 Extract common implementation of updating drawable position from screen space pos 2021-05-20 18:35:13 +09:00
Dean Herbert
6f75c59760 Fix flip logic not using the full selection quad 2021-05-20 18:31:51 +09:00
Dean Herbert
95c78b9185 Split out common selection quad logic 2021-05-20 18:24:25 +09:00
Dean Herbert
27e81d6504 Implement proper rotation algorithm for skin editor 2021-05-20 18:21:16 +09:00
Dean Herbert
eb5db8ff03 Disable border display on skin editor to avoid crashes
This wasn't being displayed correctly anyway, so rather than fixing
let's just remove it for now.

Closes #12868.
2021-05-20 02:01:46 +09:00
Dean Herbert
a55879e511 Fix oversights in scale algorithm 2021-05-20 01:47:31 +09:00
Dean Herbert
14af86d6c5 Use the same code path for all scaling 2021-05-19 21:46:41 +09:00
Dean Herbert
6a3c58b9ad Implement proper scaling algorithms 2021-05-19 19:58:55 +09:00
Dean Herbert
d661e98fa6 Move common functionality out of OsuSelectionHandler and implement flip support 2021-05-18 18:34:06 +09:00
Dean Herbert
c80e736712 Change SkinBlueprint to use the origin point as the selection point
Not sure how this feels, but it makes using the same point throughout
the editor possible, which I think is the correct way forward for now.
2021-05-18 18:33:06 +09:00
Dan Balasescu
ea4dfd3374
Merge pull request #12842 from peppy/song-progress-skinnable
Add layout customisation support for `SongProgress`
2021-05-17 20:15:01 +09:00
Dean Herbert
42d2711dc6 Use ShouldBeConsideredForInput instead of ReceivePositionalInputAtSubTree 2021-05-17 19:29:59 +09:00
Dean Herbert
60f3e628bc Fix song progress being interactable inside toolbox button 2021-05-17 19:05:22 +09:00
smoogipoo
0d7a349500 Exclude interfaces from skinnable types 2021-05-17 18:16:09 +09:00
Bartłomiej Dach
3d3c5028e6 Trim unnecessary array copy 2021-05-14 22:33:26 +02:00
Dean Herbert
d09da02673 Fix deleting skin elements not saving out to skin
Closes https://github.com/ppy/osu/issues/12786.
2021-05-14 16:03:22 +09:00
Dean Herbert
46e7d9e0ed Randomise the values displayed in the skinning toolbox
To stop the spam of "WYSI" comments everywhere. I guess I underestimated
the negative effect this would have.
2021-05-14 12:15:58 +09:00
Bartłomiej Dach
6a64a705b8 Merge branch 'master' into skin-blueprint-aspect-lock 2021-05-13 17:53:00 +02:00
Bartłomiej Dach
25b1443c50 Remove dead branch and mark implementation as temporary
The previous implementation was checking if the `x0` or `x2` anchors
were selected to decide on which way to transfer the drawable's scale,
but that check actually ends up being always true for corner anchors. To
visualise, this is how the corner anchors correspond to `Anchor` flags:

    x0  x1  x2
    |   |   |
y0 -O---O---O-
    |   |   |
y1 -O---+---O-
    |   |   |
y2 -O---O---O-
    |   |   |

The Os indicate where the reference anchors are on a selection box.
The first conditional eliminates the middle ones, which makes sense.
But after excluding them from further deliberations (marking via X):

    x0  x1  x2
    |   |   |
y0 -O---X---O-
    |   |   |
y1 -X---+---X-
    |   |   |
y2 -O---X---O-
    |   |   |

The remaining anchors always have `x0` or `x2` set. So to avoid
confusion, just always transfer one way for now. At some point this
should be torn out in favour of an actual implementation of the desired
behaviour.
2021-05-13 17:50:12 +02:00
Dean Herbert
0fa90a80d4
Merge branch 'master' into skin-blueprint-aspect-lock 2021-05-13 23:38:53 +09:00
Dean Herbert
3ecbb9ec4b
Merge branch 'master' into skin-blueprint-anchor-origin 2021-05-13 23:38:04 +09:00
Dean Herbert
98830dadda
Merge pull request #12762 from peppy/skin-blueprint-visual-improvements
Improve the visual appearance of skin editor blueprints
2021-05-13 23:37:21 +09:00
Dean Herbert
cef39eb4fa
Merge pull request #12766 from peppy/stable-anchor-origin
Keep component positions stable when changing anchor/origin
2021-05-13 23:36:40 +09:00