I've finished a skinnable version of AppLauncher at lunch today. AppLauncher is handy for modders who want to make a list of buttons to click that launch various command-line programs like spring single-player missions, settings.exe, and so on. It's a .NET 2.0 app that should be useful for really any such purpose. Theoretically it could be ported to Linux, but I haven't tested it and you'd probably have to mangle your command-line commands for the other platform. I've the project source attached, it's MIT license so do whatever you like with it.
See the included AppLauncherConfig.XML file to customize it.
Below is a snipped of the configuration objects code. It's a little confusing if you can't read VB.Net, but all that's really important is the types (ie. Boolean/String/Integer), names (ie. Text, WaitForExit), and comments (starts with '). All the fields become XML Tags except for the ButtonList, which becomes the XML elements of the member. The ButtonXMLList object is a base class of both the ConfigRootXML and the ButtonXML objects, so its members appear in both. If this doesn't make one lick of sense, don't sweat it - read the sample AppLauncherConfig.Xml file and use this code below as reference information about the words you see in there.
Code: Select all
Imports System.Xml.Serialization
Imports System.ComponentModel
'Base class for button and root object. These members exist at both the root and the button level.
Public Class ButtonXMLList
'Path to the image at the header - size 384*128
<XmlAttribute()> _
Public HeaderImageTarget As String
'Path to the image at the bottom - size 384*32
<XmlAttribute()> _
Public FooterImageTarget As String
'Text to write into the footer. Will be rendered in black.
<XmlAttribute()> _
Public FooterText As String
'Path to the image in behind the button list. Width is 384, height is form height - 160
<XmlAttribute()> _
Public ListBackgroundImageTarget As String
'Text on button to leave page of form (or quit if root page) - invisible if image.
<XmlAttribute()> _
Public ExitText As String
'Tool tip text for button to leave page of form (or quit if root page)
<XmlAttribute()> _
Public ExitToolTipText As String
'Path to image on page-exit button - 256*32.
<XmlAttribute()> _
Public ExitIdleImageTarget As String
'Path to image on page-exit button when clicked - 256*32.
<XmlAttribute()> _
Public ExitClickedImageTarget As String
'List of child buttons.
<XmlElement("Button")> _
Public ButtonList As List(Of ButtonXML)
End Class
Code: Select all
Imports System.Xml.Serialization
Imports System.ComponentModel
'Root object of the XML file, listed as AppLauncherConfigRoot in the file.
<XmlRoot("AppLauncherConfigRoot", Namespace:="http://pxtl.livejournal.com")> _
Public Class ConfigRootXML
Inherits ButtonXMLList
'Title bar of the form. Will be used task bar.
<XmlAttribute()> _
Public TitleText As String
'Icon of the form. Will be used in task bar. Should be exe, ico, or dll file.
<XmlAttribute()> _
Public IconTarget As String
'Whether or not the list panel should have a border. Show border if true.
<XmlAttribute()> _
<DefaultValue(True)> _
Public ListPanelBorder As Boolean = True
'Whether or not the form itself should have a border/titlebar/icon. Show border if true. Will not show icon in taskbar if false.
<XmlAttribute()> _
<DefaultValue(True)> _
Public FormBorder As Boolean = True
'Height of form.
<XmlAttribute()> _
Public FormHeight As Integer
End Class
Code: Select all
Imports System.Xml.Serialization
Imports System.ComponentModel
'A button in the AppLauncherConfig xml file.
<XmlType("Button", Namespace:="http://pxtl.livejournal.com")> _
Public Class ButtonXML
Inherits ButtonXMLList
'Text to write on the button. Invisible if image button.
<XmlAttribute()> _
Public Text As String
'The directory to launch the app in.
<XmlAttribute()> _
Public WorkingDirectory As String
'The target app.
<XmlAttribute()> _
Public Target As String
'Tool tip text for the button
<XmlAttribute()> _
Public ToolTipText As String
'Should the applauncher close when the button is clicked, or return to applauncher after the spawned process is closed?
<DefaultValue(False)> _
<XmlAttribute()> _
Public WaitForExit As Boolean
'Image file to show on the button face - 256*32
<XmlAttribute()> _
Public IdleImageTarget As String
'Image file to show on the button face when clicked - 256*32
<XmlAttribute()> _
Public ClickedImageTarget As String
End Class