types.filenameΒΆ

type result types.filename ( table desc , string mode , string title , string filter , string directory , string extension , string category )

Creates a filename type, allowing to choose a file. Ex: types.filename {mode="open",title="Open a file",filter="All files (*.*)|*.*",directory="c:/",extension="*.png",category="maps"}

Arguments:

  • desc A table of the type specificities. Acceptable indices are mode, title, filter, directory, extension and category. All these specifications are optional and should not be filled if default setting is advisable.
  • mode The file open mode, can be "open" or "save", default is "open".
  • title The file dialog title, default is "Open a file".
  • filter The file filters, a '|' separated list of displayed names and matching wildcard filters, such as "All Formats|*.jpg;*.png|JPEG (*.jpg)|*.jpg|PNG (*.png)|*.png|All Files (*.*)|*.*". Default is "All Files (*.*)|*.*".
  • directory The default opening directory. Default is the Guerilla installation directory.
  • extension The default selected extension. Default is the first filter item.
  • category The file type category, so last directory can be remembered (if no default directory is provided)

Return:

  • result The created type