Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

[Free] Voltage - UI Framework for Editor scripting

Discussion in 'Immediate Mode GUI (IMGUI)' started by whileBreak, Feb 9, 2018.

  1. whileBreak

    whileBreak

    Joined:
    Aug 28, 2014
    Posts:
    289
    Like bootstrap for Unity!
    AssetStore - Discord - API Reference (WIP) - Quickstart Guide

    If you have found that the default UI layout for editor scripting is making it harder for you to build your tools or editors, then this is the asset for you.


    • Styles Editor: for easily managing all your styles on one window, now you wont have to trouble yourself coding your styles. You can edit them and see the changes on real time and use them on your code.
    • Nested Areas: easy to comprehend nested areas, combine all the different areas to control and organize your interface.
    • Split Area: if you where wondering how to provide your windows or editors with a split screen, now it will only take you one line of code.
    • Weighted Areas: for fitting elements in a simple way.
    • Stream Areas: for when you need a stream of tight fitted elements.
    • Foldout Areas: foldouts made easy with Voltage.
    • Tab Areas: a simple implementation of tabs.
    • List: A simple to implement nested list for you to use on whatever way you want. With right mouse click for deleting, duplicating.
    • Fields: All the classic drawers implemented, and the possibility to expand and add your own custom elements for you to use.





    Power your tools with Voltage and save your time for something else!
     
    Last edited: Mar 20, 2018
    Mauri, Elzean and Fajlworks like this.
  2. whileBreak

    whileBreak

    Joined:
    Aug 28, 2014
    Posts:
    289
    EDIT: Update 0.9.2 is now Live
    Next update will come with new features:
    - Toggle: classic on/off check toggle for true/false values (can't believe I forgot to add it)
    - Switch: the modern version of toggle on/off slider for true/false values.
    - Popup: the previous release had EnumPopups but now you can make your own labels via code for more control
    - Flags: same as Popup, previously only EnumFlags where supported
    - List changes: List will be changed for better control.
    - [New] VoltageBuilder: to help you separate your windows and editors into multiple scrits (See DemoBuilder and DemoWindow for implementation examples).
    Fixes:
    - Style Editor: currently is not working as intended, fixes will be performed.
    - Scroll Area: fixed an error with mousePosition on EventCalls that prevented from tracking the correct Position inside a ScrollArea.

    If you have any requests for new features or fixes please post them here. If you have any questions on how to use this asset don't doubt on contacting me via PM or email, or better yet post your questions on this thread, or make a new one so everyone can benefit.
     
    Last edited: Feb 12, 2018
    Delarn likes this.
  3. shawn

    shawn

    Unity Technologies

    Joined:
    Aug 4, 2007
    Posts:
    552
    Nice! Always happy to see people extending/adding functionality in the editor UI framework and then sharing it with the community. :)
     
    Delarn likes this.
  4. whileBreak

    whileBreak

    Joined:
    Aug 28, 2014
    Posts:
    289
    Thanks!, happy to give back
     
  5. AhrenM

    AhrenM

    Joined:
    Aug 30, 2014
    Posts:
    74
    Moving my comments over here as there is no value in giving my necro'd thread more air ;-)

    Shweet. Turns out I had a similar approach (I had to go look my code up) so we're thinking the same things. If there is anything from the editor designer code base you want to rip for a 'window editor' go ahead. The canvas implementation is probably not the best, but there was some good code in there for dynamically building properties panels via reflection. Might be a useful reference???

    Will definitely check out Voltage and because I've not said it here, props for getting the asset live!

    A
     
    Delarn and whileBreak like this.
  6. whileBreak

    whileBreak

    Joined:
    Aug 28, 2014
    Posts:
    289
    Thanks! same to you, feel free to disect my code if it's useful for your asset.
     
    Delarn likes this.
  7. whileBreak

    whileBreak

    Joined:
    Aug 28, 2014
    Posts:
    289
    Update 0.9.3 is now Live
    - VoltageBuilder no longer inherits from MonoBehaviour. Now you can create them with the new keyword.
    - Minimum Unity version changed to 5.4
     
  8. whileBreak

    whileBreak

    Joined:
    Aug 28, 2014
    Posts:
    289
    Version 0.9.4 is now Live
    MAYOR CHANGES!
    1. VoltageInternalConstruction added to the framework. This internal class will be present across all base classes of Voltage (VoltageWindow, VoltageEditor, VoltageHelper).
    2. Constructor: From now on to code your UI you need to access the Constructor property. All AreaStart(), Field(), Label(),etc. will need to be accessed with Constructor.AreaStart(), Constructor.Field(), Constructor.Label(), Constructor.Etc().
    3. VoltageStyles: VoltageStyles is now deprecated and was replaces by Styles and StyleBundle. Use the new tool Style Converter to update your old style file without loosing anything.
    Before:
    Code (CSharp):
    1. VoltageGUI ()
    2. {
    3.     WeightAreaStart();
    4.         Field(myField);
    5.         Label("Label");
    6.     EndArea();
    7. }
    Now:
    Code (CSharp):
    1. protected override void VoltageGUI ()
    2. {
    3.     Constructor.WeightAreaStart();
    4.     Constructor.Field(myField);
    5.     Constructor.Label("Label");
    6.     Constructor.EndArea();
    7. }
    New Features
    • VoltageInternalConstructor: Is now used to manage Stored and Wild elements more comprehensively on VoltageWindow, VoltageEditor and VoltageHelper.
    Use Constructor.StartStoredConstructor(myArea) to change focus to myArea and start constructing its Stored Layout. Use Constructor.EndStoredConstructor to finalize.
    Code (CSharp):
    1.  
    2. WeightArea myWeightArea;
    3.  
    4. protected override void VoltageInit ()
    5. {
    6.     myWeightArea = new WeightArea();
    7.  
    8.     //StartConstructing your area
    9.     Constructor.StartStoredConstructor(myWeightArea);
    10.         Constructor.Field(myField);
    11.         Constructor.Label("Label");
    12.         Constructor.StreamAreaStart();
    13.             Constructor.Field(myField);
    14.             Constructor.Label("Label");
    15.         Constructor.EndArea();
    16.     Constructor.EndStoredConstructor();
    17.  
    18.     // Start constructing more areas!
    19.     Constructor.StartStoredConstructor(otherArea);
    20.        // Area content
    21.     Constructor.EndStoredConstructor();
    22. }
    23. protected override void VoltageGUI ()
    24. {
    25.     // Show your area with no allocation overheat!
    26.     Constructor.AreaStart(myWeightArea);
    27. }
    • Styles: used to manage your bundles. Previous VoltageStyles.GetStyle should be replaced by Styles.GetStyle(styleID). Now you can access other StyleBundles on "Assets/Splime/Voltage Style Bundles/" folder using Styles.GetStyle(bundleName,styleID).
    • StyleBundle: manage different styles and organize them within different bundles. Create a new bundle on the right click "Create" menu on the Project Manager. Place your bundles under "Splime/Voltage Style Bundles" to be able to edit them through the Voltage Style Editor.
    • Style Editor: added functionality to edit multiple StyleBundles.
    Changes
    • VoltageBuilder: changed name to VoltageHelper.
    • VoltageHelper: now can call other VoltageHelpers thanks to the Constructor.
    Fixes
    • WeightArea: fixed EventCall and DrawCall for stored Elements
    • StreamArea: fixed EventCall for stored Elements
    • SplitArea: fixed issue with tracking mouse position when inside other areas.
    As always special thanks goes to @Delarn and @GengarGames777
     
    Last edited: Feb 21, 2018
  9. Delarn

    Delarn

    Joined:
    Jan 16, 2018
    Posts:
    31
    whileBreak likes this.
  10. whileBreak

    whileBreak

    Joined:
    Aug 28, 2014
    Posts:
    289
    Update 0.9.5 is now Live

    New Features
    • Style Editor: "Duplicate" and "New" option added to list's right click menu. New Bundle and Reload buttons added.
    • VoltageList: added DeleteItem and RenameItem public methods for more control.
    Changes
    • Button style: Changed a bit.
    Fixes
    • Styles: Style Bundles will now load when requested instead of just when the Style Editor is opened.
    • Tab Area: Now EventCalls will be passed to child areas and elements. Before it preveted child elements using Votage event system to respond to mouse and keyboard events.
    • Password: Will now properly select basic style.
    • Split Area: Will now calculate its size properly.
    • Switch: Will now calculate its size properly.
    • Toggle: Will now calculate its size properly.
     
  11. whileBreak

    whileBreak

    Joined:
    Aug 28, 2014
    Posts:
    289
    I'm currently working on the API Reference document. It's not finished yet but you might find it helpful.
     
  12. whileBreak

    whileBreak

    Joined:
    Aug 28, 2014
    Posts:
    289
    The Voltage Quickstart Guide is being written at the moment. For now you will find a quick explanation about how areas work and how to use them. More will come so stay Tuned
     
  13. IC_

    IC_

    Joined:
    Jan 27, 2016
    Posts:
    48
    Hi. Thanks for the great asset! Do you still support it? Don't you publish source code on github? I found an issue - when you creating a VoltageText and write into it something Text property still gets empty (Also if you unfocus your VoltageWindow you see that text gets disappeared and if focusing again it appears)