Skyline Editor related tips n tricks!

Plugin tutorials

Plugin tutorials

Postby SpiderMack » 14 Nov 2017, 10:28

Hi,

Well it's advanced topic as not all users will make plugins, but that's great it's possible in Skyline and it looks so easy.

Is there some docs ? I just tested we can create a new plugin in Skyline menu or edit it's Lua script.
But i didn't find how to create it's interface and how it is tied to the plugin script and how interaction works.

Is there some tutorials about plugins ?
User avatar
SpiderMack
Skyline Expert
 
Posts: 441
Joined: 02 Dec 2016, 09:15
Skill: Concept artist
Skill: 3D Modeller
Skill: Level Designer
Skill: Scripter

Re: Plugin tutorials

Postby Shando » 14 Nov 2017, 12:32

Hi SpiderMack,

Not 100% sure if there is a tutorial for creating Plugins, but basically, the UI is created in Qt and then Skyline has heaps of functions (all starting with "qt.") for accessing the various buttons etc.

The basic idea is to create the UI in Qt (I use Qt Creator) and then put the ".ui" file, the ".qrc" file (if required) and the ".lua" file in a folder which is then placed in the "Skyline\Editor Plugins" folder. The main caveats to this are:

1) the folder and all relevant files MUST have the same name
2) the ".lua" file MUST have a "main ( )" function, which runs the Plugin - one gotcha is that Plugins run on Skyline boot, so be careful what goes in this function as it will run automatically and there isn't currently a way to turn Plugins on and off!
3) the ".lua" file MUST have "sky.include ( "SkyQt.lua" )" at the top of the file

Your best bet is to take a look at the samples provided with Skyline as most of them are relatively simple :)

At my last count, there was well over 70 functions for interacting with Qt:

Code: Select all
qt.addComboItem ( thisEditor, thisCombo, text, icon, pos )
qt.clear ( thisEditor, thisWidget )   
qt.closeEditor ( thisEditor, thisEditor2 )   
qt.deselectAllItems ( thisEditor, thisWidget )   
int = qt.getChecked ( thisEditor, thisWidget )   
string = qt.getComboItemText ( thisEditor, thisCombo, row )   
int = qt.getCurrentIndex ( thisEditor, thisCombo )   
string = qt.getHTMLText ( thisEditor, thisWidget )   
int = qt.getListItemCount ( thisEditor, thisList )   
string = qt.getListItemText ( thisEditor, thisList, row )   
int = qt.getListSelectedItem ( thisEditor, thisList, row )   
int = qt.getNumTableColumns ( thisEditor, thisTable )   
int = qt.getNumTableRows ( thisEditor, thisTable )   
string = qt.getOpen_FileDialog ( thisEditor, headerText, directory, fileType(s) ) 
string = qt.getSave_FileDialog ( thisEditor, headerText, directory, fileType(s) ) 
table = qt.getSelectedItems ( thisEditor, thisWidget )   
int = qt.getSelectionMode ( thisEditor, thisWidget )   
string = qt.getTableItemText ( thisEditor, thisTable, row,column)
int = qt.getTableSelectedItem ( thisEditor, thisTable, row, column, ) 
string = qt.getText ( thisEditor, thisLabel / thisTextEdit / thisPlainTextEdit )   
string = qt.getTreeItemText ( thisEditor, thisTree, row, column ) 
int = qt.getTreeSelectedItem ( thisEditor, thisTree, row )   
int / float = qt.getValue ( thisEditor, thisSpinBox etc. )   
qt.hideWidget ( thisEditor, thisWidget )   
int = qt.insertListItem ( thisEditor, thisList, row )   
int = qt.insertTableColumn ( thisEditor, thisTable, column )   
int = qt.insertTableRow ( thisEditor, thisTable, row )   
int = qt.insertTreeItem ( thisEditor, thisTree, row )   
qt.openEditor ( thisEditor, thisEditor2, mode )   
qt.removeComboItem ( thisEditor, thisCombo, row )   
qt.removeListItem ( thisEditor, thisList, row )   
qt.removeTableColumn ( thisEditor, thisTable, column )   
qt.removeTableRow ( thisEditor, thisTable, row )   
qt.removeTreeItem ( thisEditor, thisTree, row )   
qt.setChecked ( thisEditor, thisWidget )   
qt.setComboItemText ( thisEditor, thisCombo, text, row ) 
qt.setCurrentIndex ( thisEditor, thisWidget, row )   
qt.setDisabled ( thisEditor, thisWidget )   
qt.setEnabled ( thisEditor, thisWidget )   
qt.setFocus ( thisEditor, thisWidget )   
qt.setIconSize ( thisEditor, thisWidget, sizeX, sizeY ) 
qt.setItemWidgetChecked ( thisEditor, thisWidget, state )   
qt.setItemWidgetImage ( thisEditor, thisWidget, image (as String) )   
qt.setItemWidgetSize ( thisEditor, thisWidget, sizeX, sizeY ) 
qt.setItemWidgetText ( thisEditor, thisWidget, text )   
qt.setListItemIcon ( thisEditor, thisList, row, image (as String) ) 
qt.setListItemText ( thisEditor, thisList, row, text ) 
qt.setListItemTextAlign ( thisEditor, thisList, row, alignment ) 
qt.setListItemWidget ( thisEditor, thisList, widgetInfo, callback, row )
qt.setListSelectedItem ( thisEditor, thisList, row, selected ) 
qt.setMaximumValue ( thisEditor, thisSpinBox etc. value )   
qt.setMaxSize ( thisEditor, thisWidget, sizeX, sizeY ) 
qt.setMinimumValue ( thisEditor, thisSpinBox etc. value )   
qt.setMinSize ( thisEditor, thisWidget, sizeX, sizeY ) 
qt.setPixmap ( thisEditor, thisLabel / thisTextEdit / thisPlainTextEdit image (as String) )   
qt.setSelectionMode ( thisEditor, thisWidget, mode )   
qt.setTableItemIcon ( thisEditor, thisTable, row, column, image (as String) )
qt.setTableItemText ( thisEditor, thisTable, row, column, text )
qt.setTableItemTextAlign ( thisEditor, thisTable, row, column, alignment )
qt.setTableItemWidget ( thisEditor, thisTable, widgetInfo, callback, row, column )
qt.setTableSelectedItem ( thisEditor, thisTable, row, column, selected )
qt.setText ( thisEditor, thisLabel / thisTextEdit / thisPlainTextEdit, text )   
qt.setTreeCollapseAll ( thisEditor, thisTree )   
qt.setTreeExpandAll ( thisEditor, thisTree )   
qt.setTreeItemExpanded ( thisEditor, thisTree, column )   
qt.setTreeItemIcon ( thisEditor, thisTree, column, image (as String) ) 
qt.setTreeItemText ( thisEditor, thisTree, column, row, text )
qt.setTreeItemTextAlign ( thisEditor, thisTree, column, row, alignment )
int = qt.setTreeItemWidget ( thisEditor, thisTree, widgetInfo, column, row )
qt.setTreeSelectedItem ( thisEditor, column, row,selected)
qt.setValue ( thisEditor, thisSpinBox etc. value )   
qt.showWidget ( thisEditor, thisWidget )   


HTH

Shando
Ryzen 7 4800H 16GB GTX1650 Win 11 64
Love, Hope, Strength http://www.lovehopestrength.co.uk
User avatar
Shando
Skyline Moderator
Skyline Moderator
 
Posts: 560
Joined: 06 Mar 2013, 22:35
Location: Moffat Beach, Queensland
Skill: Programmer
Skill: Scripter
Skill: Level Designer

Re: Plugin tutorials

Postby SolarPortal » 14 Nov 2017, 16:03

Its on the documentation list lol :P Lots to write up still :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer


Return to Skyline Editor

Who is online

Users browsing this forum: No registered users and 1 guest

cron