

Features:
*word wrapping
*vertical scrolling
*easily customizable (background color, size, etc ...) and modification-friendly
*support for "welcome" page that is displayed only the first time user starts the widget
*can be used for fullscreen help as well as in-game windowed unit guide
*there are 6 tags:
<title>
<image> - "floating" is supported
<link> - equivalent to <a href>
<heading> - equivalent to <h1>, <h2> ... you can set the size
<li>
<include> - includes another page eg.:navigation at the bottom
How-to:
Help API widget provides you with four call-outs:
Script.LuaUI.setPageOptions(options) - allows you to change the font size, colors, widget position and many other things
Script.LuaUI.displayPage(page) - displays the page
Script.LuaUI.isHelpVisible() - true if a page is displayed
Script.LuaUI.setWelcomePage(page) - this page will be shown only once
See gui_example_help.lua (it's disabled by default) to see the help in action.
Unit-guide:
For unit guide you should put something like this into drawScreen()
Code: Select all
if onlyOneUnitIsSelected() then
drawButtonThatWillShowHelpForThatUnit()
end
I lack any talent at designing. That's why the buttons and the window look so bad. There's a simple drawFrame() method which draw everything exept the page content. I need someone to modify that method to make the widget look better.
This is just a beta version. Do not include this into your mod yet!
Report bugs please.
However remember that the syntax is very strict so triple-check your syntax before posting.
Changelog:
beta 1 -> beta 2:
No need to use help.lua anymore. You can now use provided API to display your help pages
Download:
http://www.unknown-files.net/3583/ingame_help_widget/