philip.atha Posted March 26, 2015 Share Posted March 26, 2015 The plugin sample explains pretty clearly how to add new UIs via the plugin tab in the Tools menu, but is there a way I can launch my plugin from the editor toolbar panel without modifying the source code? Link to comment
silent Posted March 26, 2015 Share Posted March 26, 2015 Hi Philip, What do you mean from Toolbar? Are you using Unigine 1.0? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
philip.atha Posted March 27, 2015 Author Share Posted March 27, 2015 Yes, this is in regards to the editor toolbar. See image: Link to comment
unclebob Posted March 27, 2015 Share Posted March 27, 2015 Hey, Philip! You can have a look at <sdkroot>/data/core/editor/editor_panel.h file, it contains all panel UI. Basically, what you need to do is call panel_gb.addChild and pass your custom widgets from the plugin. Don't forget to remove your widgets once the plugin is unloaded! Link to comment
philip.atha Posted March 31, 2015 Author Share Posted March 31, 2015 Very cool, got it to work, although can I append my WidgetIcon object to a particular index within the toolbar? Say for example I want to explicitly append past the Quit icon. It appears to always be placing it below the main toolbar, even if I specify GUI_ALIGN_RIGHT | GUI_ALIGN_EXPAND. //Get the editor toolbar Gui gui = engine.getGui(); panel_gb = Panel::panel_gb; //Create a VBox separator to put our icon within my_vb = new WidgetVBox(gui,1,1); //Create the icon and add it to the toolbar my_i = new WidgetIcon(gui, "editor_my_icon.png"); my_i.setCallback(GUI_RELEASED, "MYEditor::my_pressed"); my_vb.addChild(my_i); //Now add the group to the toolbar panel_gb.addChild(my_vb); Link to comment
unclebob Posted April 1, 2015 Share Posted April 1, 2015 I guess I know the reason. That's because panel_gb has WidgetHBox as its first and only one child, so you need to get that hbox and add your stuff to it. Link to comment
Recommended Posts