1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-10-31 21:00:51 +01:00
Commit graph

550 commits

Author SHA1 Message Date
Ell
48b96a10a4 Added InputHandler mouse and touch position querying that preserves the game's viewport and fixed the graphics device's viewport being ignored for mouse and touch queries
Closes #1
2022-02-06 22:07:33 +01:00
Ell
ad2784a67e Automatically update all elements when changing a ui system's viewport 2022-02-06 21:16:35 +01:00
Ell
ed88862194 Marked BeginDelegate and BeginImpl as obsolete 2022-02-02 18:17:53 +01:00
Ell
c880c3e011 Update elements less aggressively when changing a ui system's style 2022-01-30 16:56:07 +01:00
Ell
a143aef67c Revert scissor rectangle change since it doesn't support panels with complex transformations
Revert "Use a scissor rectangle for panels in favor of a render target, and marked UiSystem.DrawEarly and Element.DrawEarly as obsolete"

This reverts commit 3c4567e4a1.

Revert "cleaned up DrawEarly documentation references"

This reverts commit dc6c472b84.
2022-01-30 16:35:10 +01:00
Ell
dc6c472b84 cleaned up DrawEarly documentation references 2022-01-30 12:20:32 +01:00
Ell
3c4567e4a1 Use a scissor rectangle for panels in favor of a render target, and marked UiSystem.DrawEarly and Element.DrawEarly as obsolete 2022-01-30 01:13:59 +01:00
Ell
f3e6df6862 Made custom values of Element.Style persist when a new ui style is set 2022-01-22 23:34:52 +01:00
Ell
94b6aa0d1b Marked StyleProp equality members as obsolete 2022-01-22 23:20:04 +01:00
Ell
faa400c4e6 Added Element.OnStyleInit event 2022-01-22 23:05:29 +01:00
Ell
dbf370c968 Allow setting a default text alignment for paragraphs in UiStyle 2022-01-22 22:54:47 +01:00
Ell
80a6c6b5e2 Avoid unnecessary panel updates by using an Epsilon comparison when scrolling children 2022-01-09 01:15:05 +01:00
Ell
c28f6d858c Ensure that a panel gets notified of all relevant changes by calling OnChildAreaDirty for all grandchildren 2022-01-09 01:12:16 +01:00
Ell
68fc02b170 Fixed paragraph links having incorrect hover locations when using special text alignments 2022-01-07 20:50:32 +01:00
Ell
6e75e9ebb4 ensure that the paragraph changes occur when new links are added 2022-01-07 17:15:03 +01:00
Ell
b46975391b Only set a paragraph's area dirty when a text change would cause it to change size 2022-01-06 23:26:14 +01:00
Ell
29bbd61f8b reformat and cleanup 2021-12-28 14:56:11 +01:00
Ell
7e49eaef10 Allow for checkboxes and radio buttons to be disabled 2021-12-24 12:10:04 +01:00
Ell
c060d78010 put StringBuilder overloads to use 2021-12-22 13:03:40 +01:00
Ell
dae511e455 Made StyleProp immutable 2021-12-21 11:54:32 +01:00
Ell
c0ce5a07ad Implemented IEquatable on a lot of classes that were missing it 2021-12-21 11:39:29 +01:00
Ell
3541b8d3e1 Automatically set area dirty when changing child padding or paragraph fonts 2021-12-21 00:01:57 +01:00
Ell
79354c444b fixed exception when elements get removed from their ui in Update 2021-12-14 13:42:31 +01:00
Ell
60dfbb1ec5 Added UiMetrics 2021-12-12 12:32:09 +01:00
Ell
55fae16768 Allow overriding SetAreaAndUpdateChildren and switch to using it in some locations 2021-12-11 17:39:49 +01:00
Ell
103d7c7503 Added a SquishingGroup element to MLEM.Ui 2021-12-11 17:26:55 +01:00
Ell
28a928ec2c Revert "Added PreventSiblingSpill to Element"
This reverts commit 3c74cc4845.
2021-12-11 01:04:35 +01:00
Ell
3c74cc4845 Added PreventSiblingSpill to Element 2021-12-11 00:36:50 +01:00
Ell
636522bc3e resolved some documentation warnings 2021-11-30 11:46:06 +01:00
Ell
53b93a34f8 Made TextFormatter string size based on the currently active font and added a formatting code to allow for inline font changes 2021-11-27 22:45:37 +01:00
Ell
84a6e5a29a Fixed some end-of-line inconsistencies when using the Right text alignment 2021-11-22 18:52:52 +01:00
Ell
84e2544dc8 Allow setting a custom effect and depth stencil state for ui drawing 2021-11-22 17:42:08 +01:00
Ell
5b99f29490 Fixed some inconsistencies with element transformations and mouse interaction 2021-11-22 15:13:08 +01:00
Ell
91d34c0a83 Remember the location that a scroll bar scroller was grabbed in when scrolling 2021-11-14 21:32:13 +01:00
Ell
2a7dc119eb Removed ScrollBar ScrollerOffset (which didn't actually work) 2021-11-14 21:04:50 +01:00
Ell
cd48ad6e2a ensure that child padding stays consistent if ScrollerSize gets updated 2021-11-14 20:28:53 +01:00
Ell
9cd72e9b4e Fixed panels that don't auto-hide their scroll bars ignoring their width for child padding 2021-11-14 19:50:24 +01:00
Ell
1fa9204680 added a style property for a panel's scroll bar offset 2021-11-11 16:43:27 +01:00
Ell
dc15a9139f added a bound check for the auto-calculated scroller size 2021-11-08 02:11:05 +01:00
Ell
6d554faaac mark panel children dirty when the scroll bar's max value (the height of the children) changes 2021-11-08 02:06:50 +01:00
Ell
3d0250bf86 Calculate panel scroll bar height based on content height 2021-11-08 02:02:59 +01:00
Ell
ae559adf26 remove "see href" from xml docs since some IDEs can't display that 2021-11-06 23:42:23 +01:00
Ell
8e83cc06a6 Added JsonTypeSafeWrapper and JsonTypeSafeGenericDataHolder 2021-11-06 23:38:21 +01:00
Ell
778d416774 mark panel's relevant children dirty when the render target changes 2021-11-05 23:28:32 +01:00
Ell
543201d178 ensure that relevant panel children are updated when children are changed 2021-11-05 23:22:39 +01:00
Ell
cf48fc372e skip unnecessary relevant children updates for panels 2021-11-01 22:58:37 +01:00
Ell
149669df99 fixed up Element docs and added a return value to UpdateAreaIfDirty 2021-11-01 15:29:59 +01:00
Ell
f2939253b1 Skip unnecessary area updates for elements with dirty parents 2021-11-01 13:39:37 +01:00
Ell
60bd73017c period consistency 2021-11-01 01:21:53 +01:00
Ell
ca89d03ca4 Some more ui style improvements 2021-10-30 15:33:38 +02:00
Ell
3648352540 organized MLEM.Ui properties and fields slightly 2021-10-30 15:01:04 +02:00
Ell
0809cd0218 Added style properties for a lot of hardcoded default element styles 2021-10-29 23:33:15 +02:00
Ell
9ddc1f6975 Made Image ScaleToImage take ui scale into account 2021-10-29 17:11:45 +02:00
Ell
2be39a740e improve handling of arbitrary Epsilon values 2021-10-28 23:26:42 +02:00
Ell
45f970e0f2 added vertical movement to multiline text fields 2021-10-13 17:13:56 +02:00
Ell
5f2eb1845f Fixed text not being pasted into a text field at all if it contains characters that don't match the input rule 2021-10-12 19:58:31 +02:00
Ell
a47318c0a2 improved text field multi line handling 2021-10-12 18:28:06 +02:00
Ell
1d462b0252 fixed some multiline editing issues 2021-10-12 02:46:24 +02:00
Ell
11dd939009 Added a multiline editing mode to TextField 2021-10-12 02:16:09 +02:00
Ell
8f5d3083b5 Allow specifying a maximum amount of characters for a TextField 2021-10-11 23:35:50 +02:00
Ell
f021215066 fixed VerticalSpace height parameter being an integer 2021-10-01 03:42:27 +02:00
Ell
41b924ef34 Fixed rounding errors causing AutoInline elements to be pushed into the next line with some ui scales 2021-09-24 16:35:53 +02:00
Ell
a140e85300 fixed Docs casing in readme path 2021-09-24 04:50:42 +02:00
Ell
a53939837f added package readmes 2021-09-24 04:47:39 +02:00
Ell
1bbb12a1fa clarified auto-size exception in elements 2021-09-09 17:02:29 +02:00
Ell
9890c4895c Fixed tooltips not displaying correctly with auto-hiding paragraphs 2021-09-09 16:53:12 +02:00
Ell
51833d523d Improved CopyExtensions construction speed 2021-08-05 03:59:14 +02:00
Ell
a9a7f2b421 Revert "(attempt to) reduce element sizing incompatibilities for auto-width/height elements"
This reverts commit 094de058c4.
2021-08-05 03:47:03 +02:00
Ell
094de058c4 (attempt to) reduce element sizing incompatibilities for auto-width/height elements 2021-08-05 03:40:47 +02:00
Ell
8fac4a0b69 Allow adding Link children to non-Paragraph elements 2021-07-24 07:36:42 +02:00
Ell
01bec459de disallow creating Paragraphs without fonts 2021-07-22 04:51:41 +02:00
Ell
bb9b322580 Fixed tooltips with custom text scale not snapping to the mouse correctly in their first displayed frame 2021-07-22 04:27:57 +02:00
Ell
527c4af3e4 updated dependencies 2021-07-20 00:55:36 +02:00
Ell
1067055bb5 code cleanup 2021-07-19 23:49:16 +02:00
Ell
abac738123 Removed LINQ Any and All usage in various methods to improve memory usage 2021-07-18 22:18:46 +02:00
Ell
6aa9ec03d4 Added customizable overloads for Keybind, Combination and GenericInput ToString methods 2021-07-13 15:41:42 +02:00
Ell
bb189261d7 Added a masking character to text fields 2021-07-08 18:17:39 +02:00
Ell
d1b229b589 moved sound classes into /Sound 2021-07-05 16:36:48 +02:00
Ell
642608a8a2 Fixed a crash if a paragraph has a link formatting code, but no font 2021-07-03 01:50:37 +02:00
Ell
19893855dc added the changelog to the website 2021-07-01 05:00:59 +02:00
Ell
fe9b3830f8 (finally) added a changelog 2021-06-28 15:38:30 +02:00
Ell
1377941f1a added TreatSizeAsMaximum to ui elements 2021-06-25 16:48:41 +02:00
Ell
14940d39c5 added text alignment options to tokenized strings and paragraphs 2021-06-25 15:23:30 +02:00
Ell
ef83124cfa allow changing the color of panels 2021-06-22 01:14:06 +02:00
Ell
ce920b5219 added an element helper method to create a keybind button 2021-06-21 00:49:09 +02:00
Ell
a5a73af01c improved Keybind constructors 2021-06-20 23:48:02 +02:00
Ell
cca02b5396 organized UiSystem constructor 2021-06-09 00:37:44 +02:00
Ell
a02334a34c turned some non-event events into events and added Disposing event to ui elements 2021-06-09 00:27:50 +02:00
Ell
2cc77f42cd added events for when a root element is added or removed from a ui 2021-06-08 21:36:42 +02:00
Ell
e0a9971bdb added DynamicEnum to MLEM.Data 2021-06-08 13:32:01 +02:00
Ell
20e2d098ef suppress finalize for manually disposed panels 2021-06-08 00:32:07 +02:00
Ell
0dad4860c1 dispose of the panel's render target 2021-06-08 00:29:51 +02:00
Ell
ed02a83879 fixed panels drawing children early within the render target 2021-06-07 23:14:50 +02:00
Ell
289e0e8597 added a simple way to change the action that is executed when a link is pressed inside a paragraph 2021-05-30 17:57:39 +02:00
Ell
d385581c25 added formatted string truncation to tokenized strings and ui paragraphs 2021-05-18 16:47:38 +02:00
Ell
f94d471365 explicitly disallow auto-sizing incompatibilities to make debugging easier 2021-04-27 21:17:06 +02:00
Ell
f60c3b288a also apply auto-sizing if the element has no children at all 2021-04-26 19:21:11 +02:00
Ell
2abc3264a2 simplify auto-size checks 2021-04-26 19:06:54 +02:00
Ell
7792ce99c8 fixed auto-sized elements without children not being updated correctly 2021-04-26 18:55:18 +02:00
Ell
b48ed479a0 streamlined TextInputWrapper into MlemPlatform and included link opening 2021-04-23 00:17:46 +02:00
Ell
1123b815b3 updated some package declarations to clean up warnings 2021-04-22 19:59:35 +02:00
Ell
338cf383f4 removed RequiresOnScreenKeyboard 2021-04-22 19:40:14 +02:00
Ell
cf9bcc7ae4 updated to MonoGame 8 and added support for opening the on-screen keyboard to TextInputWrapper 2021-04-22 19:26:07 +02:00
Ell
8078d41724 simplified GenericFont implementation 2021-04-19 14:02:28 +02:00
Ell
2055c3a6ef convert tests to use graphics 2021-04-02 17:12:27 +02:00
Ell
e7fd026a33 added some UI tests 2021-04-01 19:36:56 +02:00
Ell
82b8c0ab49 fixed a rare stack overflow where scroll bars could get stuck in an auto-hide loop 2021-03-29 08:28:49 +02:00
Ell
b1ff703fe1 reintroduced tolerance for element size equality 2021-03-29 06:56:06 +02:00
Ell
79ba6864e7 fixed stack overflow with nested auto-sized children 2021-03-29 06:41:38 +02:00
Ell
3e20aaf6c5 fixed auto-sized elements doing unnecessarily many area updates 2021-03-29 05:49:09 +02:00
Ell
e6243b831c remove unnecessary references to GraphicsDevice from UiSystem 2021-03-29 02:26:44 +02:00
Ell
28eafffa32 allow setting a custom viewport for ui systems 2021-03-29 02:15:17 +02:00
Ell
602f19a2a8 some minor code style and format improvements 2021-03-24 22:44:39 +01:00
Ell
5f7956a7a3 properly stop a panel's scroll bar from being removed 2021-03-24 22:01:02 +01:00
Ell
be9748e70e fully disallow access to internal children collections 2021-03-24 01:39:41 +01:00
Ell
dcee3c5010 added an option to limit auto-heights in elements 2021-03-24 01:25:39 +01:00
Ell
3d314172d0 avoid recursion in Element.ForceUpdateArea 2021-03-24 01:10:42 +01:00
Ell
3384f48623 fixed up android demo, updated some dependencies and added icons to templates 2021-03-14 01:03:17 +01:00
Ell
d73539e41e added a text scale multiplier to Paragraph 2021-02-28 14:43:07 +01:00
Ell
01b6168259 fixed the input handler querying input when the window is inactive 2021-02-18 18:36:29 +01:00
Ell
7619ac0dcf added an extension method for adding tooltip for elements 2021-02-18 04:16:17 +01:00
Ell
9146d7f2ba disallow removing the scroll bar from a panel 2021-02-07 18:30:56 +01:00
Ell
fc9b93b129 Fixed a NRE with tooltips 2021-01-20 06:41:52 +01:00
Ell
e783f4f769 added a Tooltip constructor that uses TextCallback for the paragraph 2021-01-11 00:09:29 +01:00
Ell
106102adf6 clean up unused using statements 2020-12-14 21:51:27 +01:00
Ell
b963941b5c added methods for adding/removing tooltips easily 2020-12-05 22:42:10 +01:00
Ell
56db897c00 allow tooltips to appear later 2020-12-05 16:42:21 +01:00
Ell
028e322d2f ensure opening links in uis works correctly on .net core 2020-11-25 18:41:53 +01:00
Ell
c4114c73f8 fixed tooltip distance from the mouse changing with scale 2020-11-17 21:05:48 +01:00
Ell
6c3e9116ff return the element added by Dropdown 2020-11-08 18:16:12 +01:00
Ell
fd9ad777c2 some fixes related to the branch name change 2020-11-07 00:58:43 +01:00
Ell
f6c4d83775 fixed panel element detection being incorrect if scrolling overflow is enabled 2020-11-05 01:16:01 +01:00
Ell
1a2fc814aa initialize the tooltip color to white 2020-10-31 17:55:46 +01:00
Ell
e7f2c8eca4 added a separate style property for tooltip text color 2020-10-31 17:42:39 +01:00
Ell
aaeda825e0 fixed some documentation issues 2020-10-06 20:14:57 +02:00
Ell
5bcfcaf3cb fixed Paragraph autoAdjustWidth parameter name 2020-09-30 22:49:09 +02:00
Ell
8b29903444 Replace ImageCode and TextField character ToString usage with ToCachedString for memory performace 2020-09-28 20:43:37 +02:00
Ell
aa064812fc removed obsolete CustomDrawGroup 2020-09-27 16:25:41 +02:00
Ell
333b4b033e Added a fail-safe for elements with conflicting auto-sizing settings so that they don't cause a cryptic stack overflow 2020-09-23 00:41:24 +02:00
Ell
eeedb0ae5c also don't display the tooltip if all o its children are hidden 2020-09-18 18:19:05 +02:00
Ell
fde243ed8b only display the tooltip if there is anything in it 2020-09-18 18:11:46 +02:00
Ell
7e89efec69 added text field input rules for file and path names 2020-09-13 18:05:55 +02:00
Ell
90d7aeb633 added a default text color to UiStyle 2020-09-13 18:00:19 +02:00
Ellpeck
e80eb17b22 fixed incorrect icon link 2020-07-29 14:41:46 +02:00
Ellpeck
00ce8bb229 fixed y offset not affecting elements with AutoInlineIgnoreOverflow anchor 2020-07-25 23:39:37 +02:00
Ellpeck
411d3c1cd9 allow for the transformation matrix to modify mouse positions 2020-07-20 14:18:26 +02:00
Ellpeck
abffa4db57 fixed an element transform issue and added a fancy button to the ui demo 2020-07-20 00:28:31 +02:00
Ellpeck
ec2416719e store all ui controls keybinds in an array 2020-07-16 16:04:18 +02:00
Ellpeck
02cd074a3c cleaned up changes from f1d686f0c0 2020-07-16 15:55:55 +02:00
Ellpeck
f1d686f0c0 move CustomDrawGroup behavior into Element, allowing any element to inherit it 2020-07-15 23:21:52 +02:00