ThemeAppDev
description: 更改桌面及所有UI的图形风格,背景音乐等。
Theme app for Paraworld
| Title |
Theme app for Paraworld |
| Author(s) |
WangTian? , original template by LiXizhi |
| Date |
2008/1/9 |
| File |
script/kids/3DMapSystemUI/Theme/app_main.lua |
Description
replace "MyCompany.Apps" with whatever your name
db registration insert script
INSERT INTO apps VALUES (NULL, 'Theme_GUID', 'Theme', '1.0.0', 'http://www.paraengine.com/apps/Theme_v1.zip', 'YourCompany', 'enUS', 'script/kids/3DMapSystemUI/Theme/IP.xml', '', 'script/kids/3DMapSystemUI/Theme/app_main.lua', 'MyCompany.Apps.Theme.MSGProc', 1);
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Theme/app_main.lua");
Member Functions
MyCompany.Apps.Theme.OnConnection
requires
create class
commonlib.setfield("MyCompany.Apps.Theme", {});
event handlers
OnConnection? method is the obvious point to place your UI (menus, mainbars, tool buttons) through which the user will communicate to the app.
This method is also the place to put your validation code if you are licensing the add-in. You would normally do this before putting up the UI.
If the user is not a valid user, you would not want to put the UI into the IDE.
- param app : the object representing the current application in the IDE.
- param connectMode : type of Map3DSystem? .App.ConnectMode.
syntax
function MyCompany.Apps.Theme.OnConnection(app, connectMode)
parameters
| app |
the object representing the current application in the IDE. |
| connectMode |
|
MyCompany.Apps.Theme.OnDisconnection
Receives notification that the Add-in is being unloaded.
syntax
function MyCompany.Apps.Theme.OnDisconnection(app, disconnectMode)
parameters
MyCompany.Apps.Theme.OnQueryStatus
This is called when the command's availability is updated
When the user clicks a command (menu or mainbar button), the
QueryStatus? event is fired.
The
QueryStatus? event returns the current status of the specified named command, whether it is enabled, disabled,
or hidden in the
CommandStatus? parameter, which is passed to the msg by reference (or returned in the event handler).
- param commandName : The name of the command to determine state for. Usually in the string format "Category.SubCate.Name".
- param statusWanted : what status of the command is queried. it is of type Map3DSystem? .App.CommandStatusWanted
- return __ : returns according to statusWanted. it may return an integer by adding values in Map3DSystem? .App.CommandStatus.
syntax
function MyCompany.Apps.Theme.OnQueryStatus(app, commandName, statusWanted)
parameters
| app |
|
| commandName |
The name of the command to determine state for. Usually in the string format "Category.SubCate.Name". |
| statusWanted |
|
| return |
returns according to statusWanted. it may return an integer by adding values in Map3DSystem? .App.CommandStatus. |
MyCompany.Apps.Theme.OnExec
This is called when the command is invoked.The Exec is fired after the
QueryStatus? event is fired, assuming that the return to the statusOption parameter of
QueryStatus? is supported and enabled.
This is the event where you place the actual code for handling the response to the user click on the command.
- param commandName : The name of the command to determine state for. Usually in the string format "Category.SubCate.Name".
syntax
function MyCompany.Apps.Theme.OnExec(app, commandName, params)
parameters
| app |
|
| commandName |
The name of the command to determine state for. Usually in the string format "Category.SubCate.Name". |
| params |
|
MyCompany.Apps.Theme.OnRenderBox
Change and render the 3D world with mcml data that is usually retrieved from the current user's profile page for this application.
syntax
function MyCompany.Apps.Theme.OnRenderBox(mcmlData)
parameters
MyCompany.Apps.Theme.Navigate
called when the user wants to nagivate to the 3D world location relavent to this application
syntax
function MyCompany.Apps.Theme.Navigate()
MyCompany.Apps.Theme.GotoHomepage
called when user clicks to check out the homepage of this application. Homepage usually includes:
developer info, support, developer worlds information, app global news, app updates, all community user rating, active users, trade, currency transfer, etc.
syntax
function MyCompany.Apps.Theme.GotoHomepage()
MyCompany.Apps.Theme.DoQuickAction
called when user clicks the quick action for this application.
syntax
function MyCompany.Apps.Theme.DoQuickAction()
MyCompany.Apps.Theme.MSGProc
client world database function helpers.
all related messages
APPS can be invoked in many ways:
Through app Manager
mainbar or menu command or buttons
Command Line
3D World installed apps
syntax
function MyCompany.Apps.Theme.MSGProc(window, msg)
parameters