Page 1 of 79 1231151 ... LastLast
Results 1 to 10 of 782

Thread: [0.24.1] Toolbar 1.7.5 - Common API for draggable/resizable buttons toolbar

  1. #1

    [0.24.1] Toolbar 1.7.5 - Common API for draggable/resizable buttons toolbar

    Hi, there are quite a few plugins now that add various GUI buttons to the game. Right now, every plugin author has to implement button behaviour themselves. Also, there is no consistent button style between different plugins' buttons.

    I have written a plugin that is targeted towards those plugins. Specifically, it provides an API for third-party plugins to provide GUI buttons to a toolbar. Those buttons then can invoke an arbitrary action specified by the plugin's author, such as opening a new window. The ultimate goal of this plugin is the separation of specifying a button's contents (such as text or image) and its action from the actual display style and position of the button. The player should be free to position buttons anywhere they please.


    Download Toolbar Plugin 1.7.5







    Source code: https://github.com/blizzy78/ksp_toolbar

    (The Toolbar Plugin is licensed under the BSD 2-clause license.)


    Older video demonstrating some of the features:




    Mod spotlight from HAWX Gaming:




    Feature List

    • A draggable and resizable toolbar holds all buttons
    • Buttons have a texture (icon)
    • Custom button order can be maintained
    • Unlimited number of toolbars per game scene
    • Custom button folders can be created to improve organization
    • Toolbar position is saved between KSP restarts
    • Toolbar will auto-clamp to screen area so that it cannot be dragged off-screen
    • Toolbar may auto-hide itself if positioned at screen edge
    • Clicking a button invokes an arbitrary action specified by plugin author
    • Every button looks the same, no need for plugin author to provide any styles


    Please note that this is not a regular plugin in the usual sense. You can install it, but it won't actually do anything on its own unless being told to do so by other plugins.

    However, if you're a player and would like your favorite plugin to use the Toolbar Plugin, please tell that plugin's author to look into it.


    Plugins Currently Using the Toolbar


    Are you a plugin author and would like to use the Toolbar Plugin? Please head over to the development thread which has all the info you need.


    Frequently Asked Questions

    Your download link is dead!?

    It is not. It works just fine. Clear your browser's cache and try again.

    How do I reposition the toolbar on my screen?

    Click on the little triangle button on the toolbar, then select "Unlock Position and Size" from the menu. You can now drag the toolbar around. When done, click on the triangle button again, then select "Lock Position and Size."

    How do I change the layout of the toolbar? I want there to be two rows of buttons, or two columns, or ...

    Click on the little triangle button on the toolbar, then select "Unlock Position and Size" from the menu. You can now resize the toolbar by clicking and dragging in the lower-right corner of it. When done, click on the triangle button again, then select "Lock Position and Size."

    How do I change the order of the buttons?

    Click on the little triangle button on the toolbar, then select "Unlock Button Order" from the menu. You can now drag the buttons around. When done, click on the triangle button again, then select "Lock Button Order."

    Does the toolbar remember position, layout, button order, and button visibility dependent on current game scene?

    Yes, all those settings are saved dependent on the current game scene.

    Is there a way to automatically hide the toolbar when I don't need it?

    First, drag the toolbar to the screen edge. Then, click the triangle button and select "Activate Auto-Hide at Screen Edge" from the menu. The toolbar should now auto-hide itself when the mouse pointer is not hovering above it. To disable this behaviour, click the triangle button again, then select "Deactivate Auto-Hide at Screen Edge."

    I've installed a new plugin, how do I make its buttons visible?

    Click on the little triangle button on the toolbar, then select "Configure Visible Buttons" from the menu. Activate or deactivate buttons as desired. Click "Close" to close the configuration window.

    How do I create a new button folder? How do I put buttons into a folder?

    Click the triangle button, then select "Create New Folder" from the menu.

    To put buttons into the folder, click the triangle button, then select "Unlock Button Order" from the menu. Then drag any regular button onto the folder button (not into the folder, should it be visible.) To exit the button drag mode, click the triangle button, then select "Lock Button Order."

    How do I delete a button folder?

    Right-click on the button folder, then select "Delete Folder" from the menu.

    Folders are not enough, I need more toolbars. How do I add them?

    Click the triangle button, then select "Create New Toolbar" to add a new toolbar.

    How do I delete a toolbar?

    Click the triangle button on the toolbar in question, then select "Delete Toolbar". Note that you cannot delete the last toolbar.

    How do I change a folder button's tool tip text?

    Right-click on the button folder, then select "Edit Folder Settings" from the menu.

    I like the KSP GUI skin better than Unity's default, is there a way to make the buttons look like that?

    Click the triangle button, then select "Use KSP Skin" from the menu. To revert back to Unity's default skin, click the triangle button again, then select "Use Unity 'Smoke' Skin."

    Is there a way to hide the toolbar's border?

    Click the triangle button, then select "Hide Border" from the menu. To show the border again, click the triangle button again, then select "Show Border."

    My toolbar is all messed up, how do I reset it completely?

    To reset to defaults completely, exit KSP, delete the GameData\toolbar-settings.dat file from your installation, then start KSP again.


    Change Log

    The plugin makes a check against http://blizzy.de/toolbar/version.txt to see if a new version is available. No information is sent.

    Code:
    1.7.5, 2014-07-25
    - Updated for KSP 0.24.1
    
    1.7.4, 2014-07-17
    - Updated for KSP 0.24.0
    
    1.7.3, 2014-06-26
    - Improved positioning of folders and "drawables." This also fixes a bug that
      occurred if a folder/drawable was blocking both the nav ball and the altimeter
      at the same time.
    
    1.7.2, 2014-06-22
    - Folders and "drawables" (which are provided by third-party plugins) are now
      prevented from blocking the nav ball and altimeter.
    - Folders and "drawables" will now open in the same spot as they opened the
      last time (as long as they fit on screen.) This should be helpful for third-
      party plugin developers that provide "drawables" that may change their size
      while being displayed.
    
    1.7.1, 2014-04-02
    - Updated for KSP 0.23.5.
    
    1.7.0, 2014-03-03
    - Fixed a bug that could prevent the saving of settings in certain situations.
    - Plugin authors: Added new API to allow to display "drawables." These are any
      GUI widgets that you wish to display that are tied to a particular button.
      For example, drawables can be used to display a popup menu (see the
      PopupMenuDrawable class and the example source code), or an informational
      small window when hovering over a button. Drawables will always be positioned
      near the parent toolbar (much like button folders.)
      This new API is available for users of the official Toolbar wrapper as well.
    
    1.6.1, 2014-02-28
    - You can now choose different icons for folder buttons.
    
    1.6.0, 2014-02-15
    - Added support for multiple toolbars. You can add new toolbars by selecting
      "Create New Toolbar" from the triangle drop-down menu. Each toolbar has its
      own separate set of settings, folders, and visible buttons.
    - The map view during flight is now considered a separate game scene. This
      means that it is now possible to configure different toolbars for the
      regular flight scene and the flight map scene.
    
    1.5.3, 2014-02-13
    - Fixed a bug where buttons marked as "important" could prevent the toolbar
      from auto-hiding itself, even though those buttons have not been configured
      to be visible.
    
    1.5.2, 2014-02-08
    - Removed the popup dialog that notifies about new buttons that became
      available. Instead, the toolbar will always show the configuration button as
      long as no other buttons are configured to be visible.
    - Fixed a bug where the toolbar would lose the configured visibility of some
      buttons.
    - Fixed a bug where a newly-created folder would not respect the "show border"
      setting of the main toolbar.
    - Plugin authors: Added an official Toolbar Plugin wrapper that can be used to
      provide Toolbar Plugin support without creating a hard dependency. Check the
      development forum thread at http://bit.ly/1b1ZXda for details.
    
    1.5.1, 2014-02-07
    - Fixed a bug where the new buttons notification would pop up more often
      than intended.
    - Fixed a bug where folders would not display their contents.
    - The update notification button can now be dismissed (hidden) by right-
      clicking it.
    
    1.5.0, 2014-02-07
    - You can now configure the visibility of each button. For example, you can
      now hide a button if you don't need it. Button visibility is saved in
      relation to game scene.
      Note: This change will cause a one-time reset of the toolbar, such that
      no buttons are visible at first. Toolbar location will be preserved.
    
    1.4.5, 2014-02-04
    - Fixed another bug where the toolbar would get completely invisible under
      certain circumstances.
    - Various other minor improvements and bug fixes.
    
    1.4.4, 2014-01-27
    - Fixed a bug where the toolbar would get completely invisible under certain
      circumstances.
    
    1.4.3, 2014-01-25
    - Various minor improvements and bug fixes.
    
    1.4.2, 2014-01-13
    - The plugin will now display a confirmation dialog before deleting a folder.
    - The plugin will now check for incorrect installations and display a
      warning if necessary.
    
    1.4.1, 2014-01-05
    - Fixed a bug that could sometimes cause buttons to render with Unity's
      default skin instead of the KSP skin.
    
    1.4.0, 2014-01-01
    - You can now add custom folders to the toolbar, which can hold any number
      of regular buttons for improved organization.
    
    1.3.0, 2013-12-26
    - You can now reorder the buttons on the toolbar. Button order is saved in
      relation to game scene (for example, you can have a different button order
      in the flight scene and the tracking station scene.)
    - Plugin authors: Added new property IButton.EffectivelyVisible. See the
      documentation of that property for details.
    
    1.2.2, 2013-12-23
    - You may now chose to use the KSP skin for buttons instead of Unity's
      default 'Smoke' skin.
    - The toolbar border can now be hidden.
    - Improved the positioning/sizing of the toolbar after startup with respect
      to the size that has been chosen previously by the player.
    
    1.2.1, 2013-12-20
    - Increased the size of the triangle button that opens the toolbar-specific
      drop-down menu.
    - Fixed a bug that could make the toolbar completely invisible under
      certain circumstances.
    - The toolbar should now no longer be visible during loading screens.
    - Plugin authors: Added new events IButton.OnMouseEnter/OnMouseLeave.
      See the documentation of those events for details.
    
    1.2.0, 2013-12-17
    - Toolbar position and size are stored in relation to the current scene now.
      For example, you can place it at different positions in the vehicle assembly
      building, the spaceplane hangar, and the actual flight scene.
    - Plugin authors: There is a new property IButton.Important now. See the
      documentation of that property for details.
    
    1.1.0, 2013-12-08
    - Added a new toolbar-specific drop-down menu where players can configure
      the toolbar.
    - Repositioning and resizing the toolbar should now be considerably easier.
    - Added the ability to auto-hide the toolbar when it is positioned at the
      screen edge.
    - Plugin authors: No API changes were made in this version.
    
    1.0.0, 2013-12-06
    - Initial public release.
    Last edited by blizzy78; Yesterday at 17:39.
    Flattr me if you like
    anything I did or wrote:
    Toolbar - flexible buttons toolbar
    Voice Commander - control crafts using natural speech
    Achievements - earn achievements while playing
    Precise Node - precisely edit your maneuver nodes
    Ambient Light Adjustment - who needs lights in space?!
    Internet Relay Chat (IRC) - chat while playing
    Interactive in-game tutorial plugins: Docking / Rendezvous / Moon Travel
    Online engine cluster calculator

  2. #2
    Nice to see this finally released!

    Does this only apply to the flight screen or can it also be accessed from the VAB/SPH?
    "It's the nectar of winners. Nothing like strong, black coffee." - Ted

    RealChute Parachute Systems - Realistic parachutes!
    Stock Rebalance Project - Engines, probes, etc, rebalanced logically!
    Kerbal NRAP - Test weights for rocket building
    KSPX - All the missing "stock" parts
    AdvancedAnimator - ModuleAnimateGeneric fixed!
    Forum FAQ - If you need help getting around the forums!



    I'm not Squad, I'm just a mod, and I'm also a player. Use your brain and judge if I'm acting as a moderator before thinking I'm making an official statement.

  3. #3
    It works in any scene. Third-party plugins can specify in which scene(s) a particular button should be visible. The API is quite flexible in that regard.
    Flattr me if you like
    anything I did or wrote:
    Toolbar - flexible buttons toolbar
    Voice Commander - control crafts using natural speech
    Achievements - earn achievements while playing
    Precise Node - precisely edit your maneuver nodes
    Ambient Light Adjustment - who needs lights in space?!
    Internet Relay Chat (IRC) - chat while playing
    Interactive in-game tutorial plugins: Docking / Rendezvous / Moon Travel
    Online engine cluster calculator

  4. #4
    Quote Originally Posted by blizzy78 View Post
    It works in any scene. Third-party plugins can specify in which scene(s) a particular button should be visible. The API is quite flexible in that regard.
    Very good, I'll see into using this for the editor window of RealChute
    "It's the nectar of winners. Nothing like strong, black coffee." - Ted

    RealChute Parachute Systems - Realistic parachutes!
    Stock Rebalance Project - Engines, probes, etc, rebalanced logically!
    Kerbal NRAP - Test weights for rocket building
    KSPX - All the missing "stock" parts
    AdvancedAnimator - ModuleAnimateGeneric fixed!
    Forum FAQ - If you need help getting around the forums!



    I'm not Squad, I'm just a mod, and I'm also a player. Use your brain and judge if I'm acting as a moderator before thinking I'm making an official statement.

  5. #5
    The Right Stuff diomedea's Avatar
    Join Date
    Nov 2013
    Location
    second to the right, then straight on till morning
    Posts
    893
    @ blizzy78. as of now, the download link for the "user" version of your plugin seems to be very well hidden (can't see it anywhere on the first post or else in this thread).
    Of course I could find it in the development thread, instead.
    And, again, thank you for this: absolutely needed.
    I like KSP forum: it gives me the chance to discuss with very bright and competent people.
    I am a player, who likes to get things done correctly. In those few circumstances I will have to act as a moderator, I will use text in this color.

  6. #6
    Right, I didn't post a link in this thread because it doesn't really make sense. Instead I was trying to show off what exists and can potentially be used by third-party plugins.
    Flattr me if you like
    anything I did or wrote:
    Toolbar - flexible buttons toolbar
    Voice Commander - control crafts using natural speech
    Achievements - earn achievements while playing
    Precise Node - precisely edit your maneuver nodes
    Ambient Light Adjustment - who needs lights in space?!
    Internet Relay Chat (IRC) - chat while playing
    Interactive in-game tutorial plugins: Docking / Rendezvous / Moon Travel
    Online engine cluster calculator

  7. #7
    The Right Stuff diomedea's Avatar
    Join Date
    Nov 2013
    Location
    second to the right, then straight on till morning
    Posts
    893
    Well, yes, you're right: doesn't really make sense. I was thinking along the lines of ModuleManager and seeing the DL link for that is readily available to users (even if most mods have it included in their package).
    I like KSP forum: it gives me the chance to discuss with very bright and competent people.
    I am a player, who likes to get things done correctly. In those few circumstances I will have to act as a moderator, I will use text in this color.

  8. #8
    Capsule Communicator
    Join Date
    Jul 2011
    Location
    South London
    Posts
    2,512
    It would certainly be worthwhile linking to updates (if any are needed) so users can update the toolbar .dll independent of other plugin authors' release schedules.

  9. #9
    The Right Stuff diomedea's Avatar
    Join Date
    Nov 2013
    Location
    second to the right, then straight on till morning
    Posts
    893
    @ blizzy78: tried your plugin (installed with SteamGauges new release) and must say it is not very easy for me. I can see the toolbar resizing rect by holding LMB and dragging, but the active area to start with resizing is pretty narrow, I most often can't click on it. Would be nice to have that active area highlighted.
    Could not find any way to drag the toolbar. Can you provide instructions?
    I like KSP forum: it gives me the chance to discuss with very bright and competent people.
    I am a player, who likes to get things done correctly. In those few circumstances I will have to act as a moderator, I will use text in this color.

  10. #10
    Quote Originally Posted by diomedea View Post
    I can see the toolbar resizing rect by holding LMB and dragging, but the active area to start with resizing is pretty narrow, I most often can't click on it. Would be nice to have that active area highlighted.
    Could not find any way to drag the toolbar. Can you provide instructions?
    To drag, you need to click and drag anywhere in the toolbar's rectangle except for buttons and the resizing area. That is, dragging at any edge should work.

    I agree that the areas are extremely narrow. I have plans to make it easier for players to position/resize the toolbar by adding a toolbar-specific dropdown-menu with options. It will look like this: (note the little arrow button in the toolbar)



    This will also allow players to reorder buttons in a later version.
    Last edited by blizzy78; 7th December 2013 at 17:26. Reason: replaced example screenshot with actual in-development screenshot
    Flattr me if you like
    anything I did or wrote:
    Toolbar - flexible buttons toolbar
    Voice Commander - control crafts using natural speech
    Achievements - earn achievements while playing
    Precise Node - precisely edit your maneuver nodes
    Ambient Light Adjustment - who needs lights in space?!
    Internet Relay Chat (IRC) - chat while playing
    Interactive in-game tutorial plugins: Docking / Rendezvous / Moon Travel
    Online engine cluster calculator

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •