WooshiiDev / Unity-Folder-Icons

Lightweight Unity Utility adding coloured folders and icons to your project window
MIT License
126 stars 14 forks source link

Feature Request - Custom Labels #2

Open BlueDev5 opened 2 years ago

BlueDev5 commented 2 years ago

well i am working on customisable labels but i've an issue that is, the labels only align in a specific zoom level so if I change the zoom level they will start misaligning. Screenshot from 2021-10-08 20-18-00 Screenshot from 2021-10-08 20-18-28 Screenshot from 2021-10-08 20-18-42

BlueDev5 commented 2 years ago

Maybe having the current zoom level of project window might help

BlueDev5 commented 2 years ago

finally got the alignment and custom color Screenshot from 2021-10-09 10-25-55 now i think i'll add selection background

WooshiiDev commented 2 years ago

Hey there, Folder Icons was made specifically for Icons only.

When handling text and highlighting there's a lot more that is required and each new feature will require further Rect calculations. Also have to take into account the sidebar too.

I'd be happy to add them though.

BlueDev5 commented 2 years ago

Hey i too was trying to get this and it seems to work (currrently only for noremal view not for side or tree view) With Large Zoom amount Big zoom With Low Zoom Amount Low Zoom

WooshiiDev commented 2 years ago

If you're going ahead to implement this yourself, it would be nice to know a set of requirements you want and a list of what you're adding.

If you'd like to do a PR on this too I'll be happy to look over it too.

WooshiiDev commented 2 years ago

I've noticed you've not made a fork of this to apply your own changes, so I'd recommend on doing so. If you do not want to make a fork we can discuss things about adding custom labels.

BlueDev5 commented 2 years ago

If you're going ahead to implement this yourself, it would be nice to know a set of requirements you want and a list of what you're adding.

So my plan is to tweak the look of the custom folders so that they fit nicely with the default project view Here's the list of things i'll change/add

  1. Custom colors for labels
  2. Custom selection color with that round fading image you can see in my last reply in blue color on the editor folder
  3. And i also changed that blue rect for selection that you had with color tint(available as an overload for GUI.DrawTexure, to give that native project view effect)
BlueDev5 commented 2 years ago

I've noticed you've not made a fork of this to apply your own changes, so I'd recommend on doing so. If you do not want to make a fork we can discuss things about adding custom labels.

I have not created a fork yet because currently the side view and tree view are messed up, but I'll create one after finishing them

btw if by requirements you mean, the dependecies then that is none I don't have any file/folder/asset that my custom labels need.

BlueDev5 commented 2 years ago

Side View: TreeView

Tree View: TreePane

Project View: Project View

Done With Label, tomorrow I'll refactor the code and I'll create fork in the 2-3 days. Also I'll Move the Folder Icon asset in the assets folder for easy access.

WooshiiDev commented 2 years ago

Also I'll Move the Folder Icon asset in the assets folder for easy access.

I'm not sure what you're referring to; if you mean the settings scriptable, its it's better to keep it all self contained within the FolderIcons folder.

Few questions when it comes to the behaviour:

Looking great though, cheers for taking the time to do this 🙂 👏

BlueDev5 commented 2 years ago

Well yeah i Was reffering to the settings scriptable but if you say I won't move it.

Settings: settings

no the selection Color is not global but if you say i might consider adding an option for global selection color. Also the fade is not optional for now but I was thinking about making it optional.

WooshiiDev commented 2 years ago

That looks perfectly fine! I've got some changes coming along the way to clean up the inspector but that's later down the line 🙂

Yeah the only things I'd recommend are:

BlueDev5 commented 2 years ago
  • Add an optional global colour and have it on by default

Yes I'll get it done And btw it was kinda confusing that what you meant by 2 colours for Selection? There's 1 color for both light and dark mode(for all colors).

WooshiiDev commented 2 years ago

Since you currently have a fade for the selection colour, having a colour for the left and right of the selection would allow more customization.

If someone would like a fade, they can just set the colour alpha to zero.

BlueDev5 commented 2 years ago

Ok I actually don't have much experience with gradients but i'll try to do it. And also i Added an enum for easily swithcing selection type between None, SolidColor, Fade To Left, Fade To Right. project Window fade

WooshiiDev commented 2 years ago

How is the fade done currently? If you had a fork I could take a look and help you out 🙂

If it's easier to avoid gradients for now, they can be added later down the line

BlueDev5 commented 2 years ago

If it's easier to avoid gradients for now, they can be added later down the line

Yeah coz currently I am using DrawTexture which does not support gradients and by default no materials allow gradients so i guess We'll add the later.

How is the fade done currently?

I created a few pngs for the fade gradients and put them in the resources folder, and whenever I need them I just Go Resources.Load(). But in the case of allowing gradients with multiple key it's really hard to get them.

BlueDev5 commented 2 years ago

Hey Good News I got gradients done, here's how they look Tree View: Gradient Selection

Project View: Gradient Selection project

BlueDev5 commented 2 years ago

Btw I just changed the Selection Color with Selection Gradient. And then generate a 64 * 1 texture based on the gradient. and draw it as narmal with GUI.DrawTexture

BlueDev5 commented 2 years ago

Also I have a question, do you know how i can hide certain property of an element in reorderable list? Basically being able to hide label selection gradient in all elements of reorderable list on the basis of the useGlobalSelectionGradient.

BlueDev5 commented 2 years ago

Got The global gradients, here are the results; With Global Gradient: Global Gradient

Without Global Gradient: Without Gradient

BlueDev5 commented 2 years ago

Now I think it's pretty much Done just need to refactor and a fork will be live

BlueDev5 commented 2 years ago

I am done with basic refactoring, now I'm creating a fork and before merging you can review the code if you like.

BlueDev5 commented 2 years ago

Done with the fork, it was quite hard as I haven't created a pull request ever in my life (also I'm a newbie to git and github) Now you can merge it after checking the source code and then either I or you can create a tag/release

BlueDev5 commented 2 years ago

After you would merge the pull request I'll like to create a post on reddit and also will try to get your asset featured in one of the videos of a youtube channel, like Code Monkey who creates monthly videos featuring his favourite free and paid assets on unity's asset store.

WooshiiDev commented 2 years ago

Hey there, I've responded on the pull request you did (#3) as there are some changes and issues that current occur.

I've also changed the branch to v0.2 as there are other checks and additions I need to do before releasing the next version.

If any of the things I've mentioned are difficult to add then no worries about it and I can add some issues to fix them before release 🙂

After you would merge the pull request I'll like to create a post on reddit and also will try to get your asset featured in one of the videos of a youtube channel, like Code Monkey who creates monthly videos featuring his favourite free and paid assets on unity's asset store.

I thank you, but there's no need to do this, I normally advertise these myself 🙂

WooshiiDev commented 2 years ago

Keeping this open until the feature has been added to the main branch version.

BlueDev5 commented 2 years ago

Hey So I'm back from hoping distros twice in the last 2 weeks (coz I switched to arch and then realized unity doesn't support arch so had to switch back to mint). I made a small but kinda necessary tweak to the way label selection gradients work. So before the fix the texture use to show the selection was generated everytime the user clicked on the folder which was ineffecient and many times there was a noticible time gap between the click and the texture appearing. But now Whenever you add an icon to the icons list it also caches a texture which is used for drawing on the folder and now it seems to be much faster than before. Haven't pushed it yet.

BlueDev5 commented 2 years ago

Btw I noticed that there's a major thing missing, when Getting the alignment of labels. Things weren't 100% aligning and I wasn't sure that the alignment will not break on someone else's desktop, to overcome this I created a box(which resembeled the surrounding color) before rendering the label so that no one sees what's behind the label. But the issue is that it also hides the foldout option on the Side view gets hidden. So we'll have to manually add one.

BlueDev5 commented 2 years ago

This is what I got at best Screenshot_2022-01-26_18-18-01 As You can see there's a pretty bad looking gap of blue color, as there's nothing hiding the gap(and that's why I added that box). BTW we do have the option to like revamp the whole side view by basically hiding what unity shows and putting our own stuff.