LoadingByte / GuiLib

A Minecraft library that allows modders to create more advanced Minecraft GUIs.
https://loadingbyte.com/wiki/GuiLib
Other
0 stars 0 forks source link

Color picker #1

Open hexosse opened 7 years ago

hexosse commented 7 years ago

Hello,

it seems like you continue to update this lib that I just discovered. Do you think you could add a color picker control ?

Thanks

LoadingByte commented 7 years ago

Yeah, I did indeed create a fork of GuiLib with the intention of updating it. However, after playing around with the code for some time, it became apparent that the library in its original form has been designed in a quite limiting way. For example, it's impossible to add dropdown menus without employing a dirty hack. And even basic featurs like nested containers, which allow for relative widget coordinates, have been missing and couldn't be quickly added without breaking the whole system. Therfore, I've decided that in order to being able to use this library for creating large and complex GUIs, a major rework would be necessary. As such, the latest development version 1.2.0-SNAPSHOT, which you can find on the develop branch, is not compatible with traditional GuiLib-using code at all. I just wanted to let you know that before we start talking about adding new features, since that requires you to be willing to use the new version.

Sadly and mainly because of the ongoing development of GuiLib during the last months, no documentation for the new API exists as of yet. However, the mod SkinShifter, which allows players to change their skin in-game and broadcast the change in case of a multiplayer game, contains one simple GUI and a custom widget, both of which you can use as reference in order to form your opinion on whether or not you like the new API design. In case you want to try out the mod first, you can download it from here: https://quartercode.com/dl/projects/details?projectId=Unrated%20SkinShifter The GUI code for SkinShifter is available under: https://github.com/UnratedFilmIndustries/SkinShifter/tree/develop/src/main/java/de/unratedfilms/skinshifter/client/gui Other mods that use the new API include MovieFocus ( https://github.com/UnratedFilmIndustries/MovieFocus/tree/develop/src/main/java/de/unratedfilms/moviefocus/fmlmod/gui ) and the way more complex ScriptSpace ( https://github.com/UnratedFilmIndustries/ScriptSpace/tree/develop/src/main/java/de/unratedfilms/scriptspace/client/gui ).

Okay, back to business. Please let me know whether or not you are willing to adapt to the new, heavily overhauled version of GuiLib. In that case, I'm gladly going to add the color picker widget to the core library. I just need to know whether or not you will actually use the API before I sit down and start coding :)

hexosse commented 7 years ago

Thanks for your answer,

As I don't use this library yet, I'm ready to stick to your new version and I'll have a look to your mods to figure how it works.

I need a color picker because I do a complete rework on WorldEditCUI Forge Edition and I would like the color I want instead of beeing stuck on Minecraft color.

This would be great if you could actually do this work.

LoadingByte commented 7 years ago

That's quite the coincidence. Like most people, we at Unrated Film Industries love WorldEditCUI, but hate having to install LiteLoader for it to work. Your mod popped up after I did my research on CUI, so I totally missed it. We'll definitely ditch LiteLoader in favor of your version, since one mod less is always better when it comes to Minecraft modding.

I just noticed that your mod is already up to date with Minecraft 1.11. GuiLib doesn't really use many interfaces provided by Minecraft, so there's a good chance it'll still work on 1.11 even though it has been designed for 1.7. Still, I'm gonna check it soon and upgrade GuiLib if necessary. That has been on my agenda for a long time anyway, and has to be done eventually since we want to switch our UFI building servers over to 1.11 in the near future.

Oh, and of course, I'm also gonna add the color picker. That shouldn't be that huge of a task.

hexosse commented 7 years ago

That's cool,

I'm currently working on a new overaly lib for WorldEdit CUI. So when I'll have finished it I'll be able to include GuiLib.

I know that mumfrey did a color picker for liteloader, maybe it could help : GuiColourPicker.java

LoadingByte commented 7 years ago

Thank's for the link to mumfrey's color picker. It'll probably be less work if I refer to that, giving credit to mumfrey of course.

I just wanted to let you know that I'm visiting my family during the current mid-semester break for the next two weeks. I still have spare time that I partially use for developing things, and GuiLib is my top priority now, but it may take a little bit longer than usual. I hope you're not set back too much by the delay :)

hexosse commented 7 years ago

Hey LoadingByte,

Do you have sone time to spend on the color picker ?

LoadingByte commented 7 years ago

Oh, sorry. I've got so caught up in loads of other stuff that I totally forgot the color picker was a thing. Sorry for that :/

However, I do still remember the steps needed in order to implement the picker, starting with the upgrade to the latest Minecraft version, that being 1.11 AFAIK. The change shouldn't be that hard, I'll try implementing it this afternoon.

I've also seen your PR, and I'm definitely gonna take a look at it, maybe even today. Thank's for that!

I hope I haven't caused you too much of a hassle. Normally, I don't just forget things like this.

Btw, what's your timezone? I'm in +1, just curios about you.

hexosse commented 7 years ago

I've already done the 1.11.2 update Just making sure the code is working as expected and I'll do another PR

hexosse commented 7 years ago

I've done the update to 1.11.2 Do I have to propose a PR in the develop branch or do you want to create another branch for this ?

LoadingByte commented 7 years ago

Yes, please create another branch so that we can separate the upgrade in case anything goes wrong.

LoadingByte commented 7 years ago

I've just noticed that you can't create your own branches through PRs. Then it would be best to just put it on the develop branch and don't care about extra branches. This is a small project after all.

hexosse commented 7 years ago

Or just create a temporary branch not to mess up the develop branch ? My branch is called develop-1.11.2

LoadingByte commented 7 years ago

Yeah, let's do it -- should be easy. Give me a minute.

LoadingByte commented 7 years ago

I've created the feature branch "upgrade-1.11.2". Doing pretty much what it says.

LoadingByte commented 7 years ago

Okay; I've set up the build system for 1.11.2 and will try cherry-picking the commits that actually implement the upgrade from your PR this afternoon. Let's hope it works.

hexosse commented 7 years ago

Waiting for it :)

LoadingByte commented 7 years ago

Sorry for all the delay, but I'm still testing GuiLib to make sure the upgraded version does actually work.

LoadingByte commented 7 years ago

The upgraded version of GuiLib seems to work in my testing scenarios. I've finished the feature branch and merged it into develop. Automatic builds for 1.11.2 are now available and can directly be referenced through the Maven repository.

I'll finally start working on the color picker next.

hexosse commented 7 years ago

hey @LoadingByte,

Did you find some time to work on the color picker? That's the last thing I need to release my new WorldEdit CUI mod. Thanks

LoadingByte commented 7 years ago

Yeah, I actually did. As you might have seen, I needed to refactor the whole revalidation system so that the new color picker integrates nicely into the existing widget tree. I also decided to partially upgrade the ScriptSpace mod, which in fact showed some severe bugs in the 1.11.2 version of GuiLib -- and of course, I also had to fix those. Currently, I'm finalizing the major color picker popup. Expect the commit to go live in the next day or so.

hexosse commented 7 years ago

Great, I'm impatient to have it ready. 😄

LoadingByte commented 7 years ago

The color picker widget is now available in the develop branch. This issue should close automatically once we release and thus merge into master.

I've tested it out quite thoroughly, but maybe I have still overlooked some bugs. Could you please do your own little bit of testing in order to ensure that it works as stable as it should?

hexosse commented 7 years ago

Cool,

I'm gonna have a look to it right away.

hexosse commented 7 years ago

It works great. Thanks.