aboutsummaryrefslogtreecommitdiff
path: root/src/testmod/java
AgeCommit message (Collapse)Author
2024-06-12Changelog and minor changesisXander
2024-06-11codec config and rewritten kotlin dslisXander
2024-05-291.21 compatisXander
2024-04-14Add Kotlin DSLisXander
2024-04-14Fix gifs not being preloaded + add testmod samplesisXander
2024-04-12Color Picker For Color Controllers (#140)Superkat32
* Initial work on color picker - gradient rendering FEAT: Color picker rendering progress. The selected color, HSL, and RGB gradients all render FEAT: Added new method for rendering a rainbow in the AbstractWidget class FEAT: Added a new method for rendering a sideways gradient in the AbstractWidget class TEST: Added mouse-only detection for enabling/disabling the color picker. It needs some work to allow for controller support(e.g. a button instead of the current mouseX/mouseY detection) TEST: Started work on the RGB slider detection. Needs a lot of work, and probably needs to be moved as well TEST: Added an extra color option in the "aaaaaaaaaaaa..." category BUG: The color picker has some "z-fighting" issues with options behind it BUG: The color picker needs to be in its own widget, not the way it is right now Everything is still heavy WIP, I just needed a checkpoint/backup for my work thus far * Official color picker element REFACTOR: Moved almost all of the color picker code/rendering outside of the ColorControllerElement and into a new ColorPickerElement REFACTOR: Renamed a few variables * Slider x calculation FEAT: Added a method which determines the slider's x pos based upon the pending value's hue BUG: If the color is completely black or white, the slider automatically goes to the beginning, as if the color was completely red BUG: The color picker "z-fighting" with the option behind it is still an issue * Some "z-fighting" fixing FIX: Fixed majority of the z-fighting with the color picker BUG: The option behind the color picker still gets selected. For example, the string controller behind the color picker can be typed in after clicking the color picker * Sound effect changes FEAT: Made the down button sound only play when clicking the color preview, which enables the color picker FIX: Fixed a bug where the down button sound would play upon clicking the color option(doesn't occur with other string related controllers) * Back to work! - Some refactors I don't remember the point of REFACTOR: I seemed to have refactored a few things. I did this a month ago, and don't remember anything. It probably doesn't matter, because I have plans for a huge refactor anyways in the near futre * Beginning of the end (Huge improvements, technical challenge overcome) FEAT: Began work on the hue slider's hue choosing mechanisms. It took slightly longer than I feel like it should've to figure this out, but I'm happy with its current implementation, and the ideas I have to improve it. REFACTOR: Huge refactor on the color picker and how it is rendered. Firstly, the values are now almost not-hardcoded at all, being dynamic to the screen's gui size. REFACTOR: Moved the whole color picker to its own class REFACTOR: Removed the test color variable in the "aaaaaaaaa..." category BUG: Color picker's x/xLimit seems to be flipped incorrectly BUG: HUGE lag spike while choosing the value's hue(I'm unsure how I'm going to fix this) TODO: Possible better implementation of the color picker as a whole to be clicked on not using the temporary workaround This is more of a checkpoint for me than anything. I've spent multiple hours each night working on this, and losing this progress would be terrible. * Bug fixes, some gradient refactoring, small commented out code cleanup FIX: Apparently fixed the huge lag spike when changing the hue... sometimes. It seems to have something to do with hotswapping, which shouldn't affect anybody outside of dev. env.(will do more testing later) FIX: Fixed the hue slider gradient being incorrectly displayed REFACTOR: Updated the param. usage in gradient related methods. For some reason, I had them sorta pretty janky when being used. While the code for the actual methods seem more confusing, using said methods is now less confusing. Will probably come back to this later REFACTOR: Deleted small bits of commented out code * Mouse click checkpoint WIP: Some code for the color picker clicking stuff. Hopefully to be improved soon, but this prototype actually fully works(just implemented in a way I'm not currently happy with) * Mouse click checkpoint 2 REFACTOR: Cleaned up some of the prototype mouse click code BUG: Dragging the color picker doesn't work I'm saving this incase I want to revert later. I'm very confident there is a better way than this, however. Which is why I'm going to continue testing new ideas until I find something better. * Color picker widget correct mouse clicking FEAT: Made it so that the color picker element from a color controller gets added to the YACL Screen's children, which handles rendering and mouse click events FIX: Finally, at last, fixed the color picker mouse clicking z-fighting BUG: Changing the color from the color picker, then typing in the color controller crashes the game This took many hours. I spent a long time trying to fix the color picker being removed crashing the game. I thought there were 5 different reasons for as to why it was crashing before finally finding out the true reason. A huge cleanup and possibly making the ColorPickerElement extend the AbstractWidget class instead of the StringElement class might be better. * Mouse clicking cleanup REFACTOR: Removed commented out code which previously handled the mouse clicking for the color picker BUG: Attempting to scroll through the YACL screen while hovering over the color picker ceases all scrolling * Even more cleanup REFACTOR: Cleaned up the ColorPickerElement class, making it only have methods and variables it needs/will need REFACTOR: Optmizied imports for ColorController class and updated some FIXMEs REFACTOR: Removed old, unused test method in YACLScreen class * Color picker - clicking does cool things now FEAT: Made it so that clicking on the hue slider of the color picker will now result with the controller's hue changing REFACTOR: Made it so that the hue slider thumb now properly moves only when it should REFACTOR: Clicking on the saturation/light gradient no longer changes the hue(will have proper support for sat/light gradient soon) * Initial work on color picker redesign REFACTOR: Updated the background for the color picker, now looking like an inventory container background TODO: I'm most likely going to touch up on most of the main rendering code, as it is a mess * Color picker visual redesign REFACTOR: Completely redesigned the color picker's looks, having an inventory container like background now. REFACTOR: I think I increased the hue slider thumb's height by 2 pixels to adjust for the new redesign to stay satisfying FIX: Fixed the colorPickerDim.y and colorPickerDim.yLimit being flipped(that was easier and harder than I thought it would be both at the same time) FIX: Cleaned up a bunch of messy rendering code. Turns out, it worked, but wasn't as easy to change as I thought. Should be somewhat better now, I might come back and clean it up some more though * Saturation/Light Picking + Bug fixes + Better mini preview outline FEAT: Made it so that you can now choose the saturation and light values of a color! Holding down the mouse button allows you to leave the dedicated box for easier color picking. Doing the same with the hue slider doesn't affect the saturation/light picking either REFACTOR: If a color is very bright, the mini color preview outline will change to a light grey upon hovering instead of plain white. This is to indicate to new users who may have a very bright color as an option that it can still be clicked on. FIX: Fixed a bug where choosing a color that was too dark would result in the saturation being reset FIX: Fixed a bug where having too dark of a color would mess up the hue slider TEST: Tried making the background of the color picker a texture. I was unsuccessful this time, but I'm going to try again soon. * Typing bug fix and temporary float color picker fix FIX: Fixed a bug where typing in the color controller while the color picker is visible would result in the color picker desyncing TEMPFIX: Added a temporary workaround to the color picker floating when the color controller wasn't visible anymore. A better fix will be added in the future. The current workaround probably isn't great for performance. * Color picker texture background FEAT: Color picker background texture FEAT: Transparent square texture REFACTOR: Made the background of the color picker use a texture instead of manual rendering REFACTOR: Removed code for manual rendering of the color picker background, as it has been replaced REFACTOR: Removed unused code from the YACLScreen which I didn't mean to commit in the first place CHORE: Optimized imports for ColorController * Some comments I guess? FEAT: Added some comments a couple weeks ago. I'm going to look into the popupscreen now. * Popup Color Picker Screen FEAT: Started work on testing the Color Picker as a popup screen Oh, oh my! I've managed to solve more problems in 3 hours than I was able to in 3 weeks with the popup screen-like function! * General improvements to the Popup Color Picker Screen FIX: Fixed the color picker not always appearing on first click after closing FIX: Fixed the color picker scrolling when it shouldn't be FIX: Fixed the color picker's color controller's color preview's outline(goodness) not highlighting while the color picker was visible * Color Picker Test category, beginning of alpha in color picker, move color picker if there isn't room above the controller, and another scrolling bug fix TEST: Added a new Color Picker test category FEAT: Made it so that if there isn't enough room for a color picker to be easily usable above a color controller, the color picker will appear beneath the color controller FEAT: Started work on alpha-related stuff for the color picker FIX: Fixed a bug where there were about 2 pixels worth of area where scrolling would result in the color picker "desyncing" from the color controller * Finished Alpha slider FEAT: Finished the alpha slider if the color picker's color controller has it enabled FEAT: Added some extra color options to the test config to showcase other features of the color picker * Cleanup and bug fixes FIX: Fixed a bug where the "fillSidewaysGradient" method was just completely broken and made zero sense. REFACTOR: Improved(hopefully) the "drawRainbowGradient" method's code REFACTOR: Cleaned up some unused methods in the ColorPickerElement REFACTOR: Changed the transparent texture's sizing to 7x7, so that is doesn't clip vertically (still clips a little bit horizontally) REFACTOR: Removed some commented out code in some other classes from previous testing * More cleanup REFACTOR: Did some additional cleanup in the ColorController.java class to remove really old code that was added before hte ColorPickerElement class was moved outside the ColorController class * Optimize imports REFACTOR: Optimize imports Forgot I told IntelliJ not to do that automatically, oops * Color Picker Changes 1 FIX: Fixed a bug where you could type while the color picker was active without first clicking anywhere REFACTOR: Removed unused accessWideners REFACTOR: Changed the Color Picker Popup title to a translatable string REFACTOR: Cleanup in ColorController.java, including using the protected screen variable and using the Dimension#isPointInside method REFACTOR: Cleanup in ColorPickerElement.java including: - Remove full paths for ResourceLocations - Not capturing the YACLScreen - Using "control.allowAlpha" instead of storing the boolean - No longer saving the ColorController - All variables related to the color picker's dimensions are now private final - Changed the order of the rendered items to more closely respect their z-level - Names of some methods * Extracted PopupColorPickerScreen.java to PopupControllerScreen REFACTOR: Generalized all popup related stuff from color picker to controller FIX: Actually fixed keyboard/typed character actions on the color picker without first clicking anywhere * Color preview outline fading FEAT: Added color preview outline fading to the color controller. The color preview outline will slowly flash from white to black indicating to a user to press it to enable the color picker. It has a boolean ready to be changed to a config option for when that gets added. * Popup Controller Future Proofing 1 FIX: Made changes based on feedback to ensure that all popup controller widget related items can easily be used for the dropdown controller, and any future controllers that may need it. * Color picker y is now controlled by the color controller REFACTOR: Made it so that the color picker y is now set by the color controller REFACTOR: The color picker now gets removed if the color controller is partially offscreen REFACTOR: Removed all code related to the manual scrolling of the color picker/popup widget * Fix option widget list being given FIX: Removed the option widget list parameter for the PopupControllerScreen, because it isn't used anymore * ColorPickerWidget REFACTOR: Renamed ColorPickerElement to ColorPickerWidget FIX: Small changes when YaclScreen#clearPopupControllerWidget is called. * Attempt 2 at fixing weird clearing popup controller loop FIX: (Hopefully) fixed a bug where the YaclScreen#clearPopupController method would get called twice, instead of just once. * Color picker indicator automatically disables upon discovery FEAT: Added a boolean to the YACLConfig which determines if a color controller's color preview's outline(color picker indicator) should flash or not. This boolean is on by default, and automatically disables itself upon the color picker's first opening. * Moving color picker beneath controller better detection implementation + config fix REFACTOR: Improved the color picker's implementation detecting if it should be beneath the controller or not(moved order of operations) FIX: Fixed the config option for flashing the color picker indicator not being a serial entry * Add multi-version support --------- Co-authored-by: isXander <xander@isxander.dev>
2024-04-11Extremely fragile and broken multiversion build with stonecutterisxander
2023-04-25Architectury! (#61)Xander
2023-04-21prioritise tooltip rendering above & filter empty tooltipsisXander
2023-04-04📦 New builder API for GsonConfigInstance + deprecation of old constructorsisXander
2023-01-19mojmapisXander
2022-12-20fix category buttons sometimes not being registered as clickedisXander
2022-12-20minor fixes/improvementsisXander
new LabelOption to create labels easier add 'List is empty' entry to lists that are empty fix option list widget background not being wide enough
2022-12-11[Feature] Lists (#40)Xander
2022-12-11generify testmod so people can use it as an exampleisXander
2022-12-03number fields + StringControllerElement improvementsisXander
when highlighted text, arrow keys go to each side of the selection switch to InputUtil instead of GLFW bump yarn
2022-11-27replacement of ConfigInstance#buildConfig in YetAnotherConfigLib.javaisXander
move some things to main that can be and fix testmod
2022-11-27split sourcesetsisXander
2022-11-25pre2 mapping changes + bug fixisXander
Fix tick box name text length limiting
2022-11-22bump to pre1isXander
2022-11-22Merge remote-tracking branch 'origin/1.19' into 1.19.3isXander
2022-11-22annotate test config with ConfigEntryXander
2022-11-1722w46aisXander
2022-11-13changelog & remove YACLConfigManager.java as it was actually pretty useless, ↵isXander
document GsonConfigInstance as well
2022-11-12REAL config libraryisXander
2022-10-19fix label styles appearing at first position before they are renderedisXander
2022-09-30labels now support style eventsxander
2022-09-18instant application propertyisXander
2022-09-181.3.0isXander
option tooltips now consume the pending value PlaceholderCategory: a category that when selected, just opens a screen
2022-09-15available property + fix category tooltips not showingxander
2022-09-111.1.0xander
better search - now searches every category rather than the current one option flags - flags are pieces of code ran when certain options' changes are applied (makes required restart redundant) fix scaling problems - make GUI a lot better at scaling bump gradle wrapper
2022-09-10improve expand minimize button in option groupsxander
2022-09-05require restart attributexander
2022-09-05wrap labels and group namesxander
2022-09-04ColorController, javadoc and further improvements to StringControllerxander
2022-09-04collapsible groups, string controllerxander
2022-09-03re-organising testmodxander
2022-09-03render current category as hovered not disabledxander
2022-09-03pass through type class to option for controllers to usexander
2022-09-02implement keyboard-operation for all controllersxander
fix crash when focusing on option list with tab add tooltip to groups check that pending values actually applied on save, if not, error in log and the save button displays an error when trying to escape with unsaved changes, save button text goes green and bold YACLConstants file to change certain behaviours, could evolve into its own settings! update icon
2022-09-02button options now consume YACLScreenxander
2022-09-02allow slider dragging to continue outside of boundsxander
increase thumb-height by 2px
2022-09-02fix group validation & icon & wiki test stuffxander
2022-09-01category tooltipsxander
fix slider scrolling
2022-09-01make tickbox separate controller from on off textxander
2022-09-01javadoc!xander
added LongSliderController renamed Control -> Controller add minecraft simple option binding constructor
2022-09-01make YACL builder not require title to constructxander
2022-09-01GUI Implementationxander
Added groups Added button "option" Added test mod