LoginAppDev

description: 鎻愪緵鍚勭鏍峰紡鐨勭櫥闄嗕笌璁よ瘉绐楀彛銆傛敮鎸佸畼缃戝拰绗笁鏂硅璇佹柟寮忥紝搴旂敤绋嬪簭寮€鍙戝晢鍜岀敤鎴烽兘鍙互浣跨敤銆

Contents:

Login App for Paraworld. Provides different styles of login windows for apps. Login app can be used by any other official

Title Login App for Paraworld. Provides different styles of login windows for apps. Login app can be used by any other official
Author(s) LiXizhi
Date 2008/1/24
File script/kids/3DMapSystemApp/Login/app_main.lua

Description

db registration insert script INSERT INTO apps VALUES (NULL, 'Login_GUID', 'Login', '1.0.0', 'http://www.paraengine.com/apps/Login_v1.zip', 'YourCompany', 'enUS', 'script/kids/3DMapSystemApp/Login/IP.xml', '', 'script/kids/3DMapSystemApp/Login/app_main.lua', 'Map3DSystem.App.Login.MSGProc', 1);

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/Login/app_main.lua");

Member Functions

Map3DSystem.App.Login.OnConnection

requires create class commonlib.setfield("Map3DSystem.App.Login", {});


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 ConnectMode.

syntax

function Map3DSystem.App.Login.OnConnection(app, connectMode)

parameters

app the object representing the current application in the IDE.
connectMode  

Map3DSystem.App.Login.OnDisconnection

Receives notification that the Add-in is being unloaded.

syntax

function Map3DSystem.App.Login.OnDisconnection(app, disconnectMode)

parameters

app  
disconnectMode  

Map3DSystem.App.Login.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 CommandStatusWanted
  • return __ : returns according to statusWanted. it may return an integer by adding values in CommandStatus.

syntax

function Map3DSystem.App.Login.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 CommandStatus.

Map3DSystem.App.Login.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 Map3DSystem.App.Login.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  

Map3DSystem.App.Login.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 Map3DSystem.App.Login.OnRenderBox(mcmlData)

parameters

mcmlData  

Map3DSystem.App.Login.Navigate

called when the user wants to nagivate to the 3D world location relavent to this application

syntax

function Map3DSystem.App.Login.Navigate()

Map3DSystem.App.Login.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 Map3DSystem.App.Login.GotoHomepage()

Map3DSystem.App.Login.DoQuickAction

called when user clicks the quick action for this application.

syntax

function Map3DSystem.App.Login.DoQuickAction()

Map3DSystem.App.Login.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 Map3DSystem.App.Login.MSGProc(window, msg)

parameters

window  
msg  

Application registration page container

Title Application registration page container
Author(s) LiXizhi
Date 2008/3/21
File script/kids/3DMapSystemApp/Login/AppRegPage.lua

Description

show registration page for those whose status.RequiredComplete is false.

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/Login/AppRegPage.lua");
Map3DSystem.App.Login.AppRegPage.RequiredApps = {
   {name="CCS", title = "select avatar", {RequiredComplete = false, CompleteProgress=0}},
   {name="profiles", title = "edit profile", {RequiredComplete = false, CompleteProgress=0}},
   {name="Map", title = "select land", {RequiredComplete = true, CompleteProgress=1}}
};
local width, height = 640, 512
Map3DSystem.App.Login.AppRegPage:Create("LoginApp.AppRegPage", nil, "_ct", -width/2, -height/2, width, height);

Member Functions

AppRegPage:OnLoad

create class local AppRegPage = Map3DSystem.mcml.PageCtrl:new({url="script/kids/3DMapSystemApp/Login/AppRegPage.html"}); AppRegPage = AppRegPage;

a table describing which apps needs to show registration page RequiredApps = nil; function to be called when user completed or skipped all app registration steps. OnFinishedFunc = nil;

this function is overridable. it is called before page UI is about to be created.

  • param self :.mcmlNode: the root pe:mcml node, one can modify it here before the UI is created, such as filling in default data.

syntax

function AppRegPage:OnLoad()

AppRegPage:RefreshTitle

call this function to refresh the title step.e.g. 1 avatar, 2 profile, 3 land.

  • param currentStep : the currently selected index in RequiredApps
  • param refreshUI : if true, it will refresh UI in title bar, otherwise it will only change the MCML accordingly.

syntax

function AppRegPage:RefreshTitle(currentStep, refreshUI)

parameters

currentStep the currently selected index in RequiredApps
refreshUI  

AppRegPage:OnCreate

this function is overridable. it is called after page UI is created. One can perform any processing steps that are set to occur on each page request. You can access view state information. You can also access controls within the page's control hierarchy. In other words, one can have direct access to UI object created in the page control. Note that some UI are lazy created such as treeview item and tab view items. They may not be available here yet.

syntax

function AppRegPage:OnCreate()

AppRegPage.OnNextApp


page event handlers

When clicks the basic info save button in the MCML page: ProfileAppRegPage.html

syntax

function AppRegPage.OnNextApp(sCtrlName, values)

parameters

sCtrlName  
values  

AppRegPage.OnSkipAll

When clicks the contact info save button in the MCML page: ProfileAppRegPage.html

syntax

function AppRegPage.OnSkipAll(sCtrlName, values)

parameters

sCtrlName  
values  

AutoPatcher

Title AutoPatcher
Author(s) Leio Zhang
Date 2008/7/30
File script/kids/3DMapSystemApp/Login/AutoPatcher.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/Login/AutoPatcher.lua");

AutoPatcherPage.html code-behind script

Title AutoPatcherPage.html code-behind script
Author(s) LiXizhi
Date 2008/7/24
File script/kids/3DMapSystemApp/Login/AutoPatcherPage.lua

Description

using autopatch to update to laset version

Auto Patcher is an mcml application page to auto patch a given list of files to their latest version. One can specify the src patch files url and the destination (local patch file) as below.
   script/kids/3DMapSystemApp/Login/AutoPatcherPage.html?src=http://files.pala5.com/patchfiles.txt&dest=patchfiles.txt

The patchfiles.txt contains a list of patch files and their patch versions. below is an example

version=1.0.0.3, "/"
version=1.0.0.2, "c:/versions/1.0.0.2/"
version=1.0.0.1, "c:/versions/1.0.0.1/"
version=1.0.0.0, "c:/versions/1.0.0.0/"
defaultserver=http://files.pala5.com

files
4 "/patches_1_0_0_3/packages/startup/art_model_char-1.0(3_to_4).patch" "packages/startup/art_model_char-1.0.pkg"
3 "/patches_1_0_0_3/packages/startup/art_model_char-1.0(2_to_3).patch" "packages/startup/art_model_char-1.0.pkg"
2 "/patches_1_0_0_3/packages/startup/art_model_char-1.0(1_to_2).patch" "packages/startup/art_model_char-1.0.pkg"
2 "/patches_1_0_0_3/main(1_to_2).patch" "main.pkg"
2 "/patches_1_0_0_3/paraworld(1_to_2).patch" "paraworld.exe"
1 "" "readme.txt"

  • version mean that it is able to upgrade from any versions from 1.0.0.0 to 1.0.0.3, the second parameter is the src folder where to locate the src files for that version.
  • defaultserver is the root directory of remote patch files.
  • each file line contains file_version_after_patching remote_patch_file_url local_file_to_patch
  • please note that file_version_after_patching is always an integer and there might be multiple patch files for the same dest file with decreasing file version as in the example.
  • if file_version_after_patching is 1, it means that it is the original (initial) version and the patch file is always empty.

generate autopatch files

one can generate patch files from a previous patch file. It will include all file patches from the previous patch plus their newest versions for example, the initial patch file may contain just a list of files that are tracked for patching. such as

version=1.0.0.0, "/"
defaultserver=http://files.pala5.com

files
1 "" "packages/startup/art_model_char-1.0.pkg"
1 "" "main.pkg"
1 "" "paraworld.exe"
1 "" "readme.txt"

version=1.0.0.1, "/"
version=1.0.0.0, "c:/versions/1.0.0.0/"
defaultserver=http://files.pala5.com

files
1 "" "packages/startup/art_model_char-1.0.pkg"
1 "" "main.pkg"
1 "" "paraworld.exe"
1 "" "readme.txt"

patching procedure

When the platform start, it first checks the server version to see if the client is up to date. If not, it will download a patch (index) file to a temp location. If the latest patch file can upgrade from the local patch file, then we will apply the patch. Otherwise we will inform the user to download the major installer.

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/Login/AutoPatcherPage.lua");
script/kids/3DMapSystemApp/Login/AutoPatcherPage.html?src=http://192.168.0.221:8111/testPatch/patchfiles.xml

Member Functions

AutoPatcherPage.singleFileProgressEvent

Creating the patch file(s) Make sure you have the source file (original version) and the target file (version to update to). For example, I have DATA.DTA (currently on user system) and DATA_20.DTA (v2.0 of this data file). Now call GenPat.exe: GENPAT (sourcefile) (targetfile) (patchfile) local GenPat_path = "script/bin/VPatch/GenPat.exe" local VAppend_path = "script/bin/VPatch/VAppend.exe" stand-alone runtime and patch VPATCHPROMPT.EXE (patchfile) (sourcefile) (outputfile) local vpatchprompt_path = "script/bin/VPatch/vpatchprompt.exe"

syntax

function AutoPatcherPage.singleFileProgressEvent(src,percent)

parameters

src  
percent  

AutoPatcherPage.GeneratePatchFiles

generate patch files

  • param patchfile : file path of the patch file
  • param destfolder : to which folder the patch files are generated.

syntax

function AutoPatcherPage.GeneratePatchFiles(patchfile, destfolder)

parameters

patchfile file path of the patch file
destfolder  

AutoPatcherPage.OnClickApplyPatch

on click generate patch

syntax

function AutoPatcherPage.OnClickApplyPatch(btnName, values)

parameters

btnName  
values  

AutoPatcherPage.ApplyPatchFiles

generate patch files

  • param patchfile : file path of the patch file

syntax

function AutoPatcherPage.ApplyPatchFiles(patchfile)

parameters

patchfile file path of the patch file

CG page: displaying paraworld CG movie in a panel or window.

Title CG page: displaying paraworld CG movie in a panel or window.
Author(s) LiXizhi
Date 2008/1/28
File script/kids/3DMapSystemApp/Login/CGPage.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/Login/CGPage.lua");
Map3DSystem.App.Login.CGPage.ShowWnd(app);
Map3DSystem.App.Login.CGPage.Show(bShow, _parent, parentWindow)

Member Functions

Map3DSystem.App.Login.CGPage.ShowWnd

common control library NPL.load("(gl)script/ide/common_control.lua");

commonlib.setfield("Map3DSystem.App.Login.CGPage", {});

local VideoFilePath = "Texture/3DMapSystem/Startup/paraworldCG_320_240.flv";

display the main inventory window for the current user.

syntax

function Map3DSystem.App.Login.CGPage.ShowWnd(_app)

parameters

app  

Map3DSystem.App.Login.CGPage.Show

  • param bShow : boolean to show or hide. if nil, it will toggle current setting.
  • param __ :_parent: parent window inside which the content is displayed. it can be nil.

syntax

function Map3DSystem.App.Login.CGPage.Show(bShow, _parent, parentWindow)

parameters

bShow boolean to show or hide. if nil, it will toggle current setting.
parent  
parentWindow  

Map3DSystem.App.Login.CGPage.OnDestory

destory the control

syntax

function Map3DSystem.App.Login.CGPage.OnDestory()

LoggedInHomePage.html code-behind script

Title LoggedInHomePage.html code-behind script
Author(s) LiXizhi
Date 2008/5/19
File script/kids/3DMapSystemApp/Login/LoggedInHomePage.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/Login/LoggedInHomePage.lua");

Member Functions

LoggedInHomePage.OnInit

create class local LoggedInHomePage = {}; LoggedInHomePage = LoggedInHomePage;

syntax

function LoggedInHomePage.OnInit()

LoggedInHomePage.ClearFeed


page event handlers

category is nil or ""

syntax

function LoggedInHomePage.ClearFeed(category)

parameters

category  

LoginPage.html code-behind script

Title LoginPage.html code-behind script
Author(s) LiXizhi
Date 2008/6/8
File script/kids/3DMapSystemApp/Login/LoginPage.lua

Description

TIP Sample Code


The login and registration procedure.

Title The login and registration procedure.
Author(s) LiXizhi
Date 2008/3/18
File script/kids/3DMapSystemApp/Login/LoginProcedure.lua

Description

The (Login|Registration)->Download user profile->Require application registration status->Show uncompleted registration steps->CallbackFunc(Show profile)

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/Login/LoginProcedure.lua");
Map3DSystem.App.Login.Proc_Authentication(values);

Member Functions

Map3DSystem.App.Login.Proc_Authentication

Authenticate user and proceed to Proc_DownloadProfile(). it will assume the normal login procedures. It starts with authentification and ends with callback function or user profile page.

  • param values : a table containing authentification info {username, password, domain}. username, password should be validated locally before passing them here.
  • param funcCallBack : this is a callback function to be invoked when login complete. If nil, it will display the profile page for the user.
  • param bSkipAppRegistration : whether to skip uncompleted application registration.

syntax

function Map3DSystem.App.Login.Proc_Authentication(values, funcCallBack, bSkipAppRegistration)

parameters

values a table containing authentification info {username, password, domain}. username, password should be validated locally before passing them here.
funcCallBack  
bSkipAppRegistration whether to skip uncompleted application registration.

Map3DSystem.App.Login.Proc_DownloadProfile

Download profile and proceed to Proc_AppReg()

syntax

function Map3DSystem.App.Login.Proc_DownloadProfile()

Map3DSystem.App.Login.Proc_AppReg

Require application registration status->Show uncompleted registration steps In order for an application to have a registration page with this login application. The app must install and implement a command as below: The command name must be "Registration.AppName", such as "Registration.ProfileApp" The command must recognize input {operation="query|show", callbackFunc = nil, browsername, parent} if operation is "query", the command must immediately return a registration status table, containing about the registration complete progress. see below status = { RequiredComplete=true, -- whether required fields have been completed CompleteProgress=0.2, -- the overall completeness in percentage. } if operation is "show", msg.callbackFunc should be called when the returned. msg.browsername and msg.parent maybe used to display the registration page. If none of them are present, an application display its own windows at the center of the screen.

syntax

function Map3DSystem.App.Login.Proc_AppReg()

Map3DSystem.App.Login.Proc_Complete

login procedure completed.

syntax

function Map3DSystem.App.Login.Proc_Complete()

standard Login window

Title standard Login window
Author(s) LiXizhi
Date 2008/1/24
File script/kids/3DMapSystemApp/Login/LoginWnd.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/Login/LoginWnd.lua");
Map3DSystem.App.Login.ShowLoginWnd(app);

Member Functions

LoginWnd.SwitchTabWindow

common control library NPL.load("(gl)script/ide/common_control.lua"); local L = CommonCtrl.Locale("IDE");

NPL.load("(gl)script/kids/3DMapSystemApp/API/ParaworldAPI.lua");

create class local LoginWnd = {}; commonlib.setfield("Map3DSystem.App.Login.LoginWnd", LoginWnd);

predefined addresses CommunitySite = CommonCtrl.Locale("KidsUI")("community.aspx"); RegistrationPage = CommonCtrl.Locale("KidsUI")("Register.aspx")

tab pages LoginWnd.tabpages = {"loginbox_login", "loginbox_alreadylogin", "loginbox_waiting", };

  • param nIndex : 1 or 2 or 3

syntax

function LoginWnd.SwitchTabWindow(nIndex)

parameters

nIndex 1 or 2 or 3

Map3DSystem.App.Login.LoginWnd.Show

  • param bShow : boolean to show or hide. if nil, it will toggle current setting.
  • param __ :_parent: parent window inside which the content is displayed. it can be nil.

syntax

function Map3DSystem.App.Login.LoginWnd.Show(bShow, _parent, parentWindow)

parameters

bShow boolean to show or hide. if nil, it will toggle current setting.
parent  
parentWindow  

LoginWnd.SetLoginCallBack

callback function OnSignedIn = nil;

set the call back function which will be called after user successfully logs in.

syntax

function LoginWnd.SetLoginCallBack(funcPtr)

parameters

funcPtr  

LoginWnd.OnClickGotoCommunitySite

open the community website

syntax

function LoginWnd.OnClickGotoCommunitySite()

LoginWnd.Close

close window

syntax

function LoginWnd.Close()

LoginWnd.OnClickBtnLogin

called when user logs in.

syntax

function LoginWnd.OnClickBtnLogin(sCtrlName)

parameters

sCtrlName  

LoginWnd.AuthUser_Callback

web service call back

syntax

function LoginWnd.AuthUser_Callback(msg, params)

parameters

msg  
params  

LoginWnd.CheckVersion

check whether the client needs to be updated.

syntax

function LoginWnd.CheckVersion()

LoginWnd.OnClickRegister

open our community web site's registration page

syntax

function LoginWnd.OnClickRegister()

Map3DSystem.App.Login.ShowLoginWnd

display the main Login window for the current user.

syntax

function Map3DSystem.App.Login.ShowLoginWnd(_app)

parameters

app  

The ParaWorld Start Page

Title The ParaWorld Start Page
Author(s) LiXizhi
Date 2008/1/28
File script/kids/3DMapSystemApp/Login/ParaworldStartPage.lua

Description

it contains a user customizable mini scene and a MCML browser window. The browser window will show StartPage.html by default if the command line contains "startpage", it will be used as startup page

Switch front page url.

one can call below to navigate the front page to a different url.
   Map3DSystem.App.Login.GotoPage(url, cachePolicy)

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/Login/ParaworldStartPage.lua");
Map3DSystem.App.Login.ParaworldStartPage.ShowWnd(app);
Map3DSystem.App.Login.ParaworldStartPage.Show(bShow, _parent, parentWindow)
Map3DSystem.App.Login.GotoPage(url, cachePolicy)

Member Functions

Map3DSystem.App.Login.ParaworldStartPage.ShowWnd

 common control library
NPL.load("(gl)script/ide/common_control.lua");

commonlib.setfield("Map3DSystem.App.Login.ParaworldStartPage", {});

 attributes: 
Map3DSystem.App.Login.StartPageUrl = "%WIKI%/Main/ParaWorldStartPageMCML";
Map3DSystem.App.Login.StartPageUrl = "script/kids/3DMapSystemApp/Login/StartPage.html";
Map3DSystem.App.Login.RegPageUrl = "%WIKI%/Main/ParaWorldNewUserRegPageMCML";
Map3DSystem.App.Login.RegPageUrl = "script/kids/3DMapSystemApp/Login/NewUserRegPage.html";
 login app browser name. 
Map3DSystem.App.Login.browsername = "LoginWnd.ActiveDesktopMCML";
------------------------------------------
 app config

--  "ShowAddressBar": whether to show address bar, default to false. 
  "StartPageMCML": url of start page default to Map3DSystem.App.Login.StartPageUrl
  "InitScene": a table of {Text = "缂虹渷鑳屾櫙",FilePath = "worlds/login_world", bRenderNPC = true, bRenderPlayer = nil,} default to Map3DSystem.App.Login.DefaultBGScenes[1]
  "RecentlyOpenedScenes": a list of table of {Text = "缂虹渷鑳屾櫙",FilePath = "worlds/login_world", bRenderNPC = true, bRenderPlayer = nil,} 
------------------------------------------

 private: the last bgInfo 
Map3DSystem.App.Login.ParaworldStartPage.LastBGInfo = nil;

 system bg files. 
local DefaultBGScenes = {
   {
      -- Display Name
      Text = L"瀹樻柟缂虹渷鑳屾櫙",
      -- world path, either zip file or disk folder is supported. *.jpg, *.png, *.dds, *.bmp, *.avi, *.wmv,*.swf, is also supported.
      FilePath = "worlds/MyWorlds/LoginWorld", 
      -- render to render NPC
      bRenderNPC = true, 
      -- whether to render the current player at zero position. 
      bRenderPlayer = true,
   },
   {
      -- Display Name
      Text = L"鏂版墜鏉戣儗鏅?,
      -- world path, either zip file or disk folder is supported. *.jpg, *.png, *.dds, *.bmp, *.avi, *.wmv,*.swf, is also supported.
      FilePath = L"worlds/Official/鏂版墜涔嬭矾", 
      -- render to render NPC
      bRenderNPC = true, 
      -- whether to render the current player at zero position. 
      bRenderPlayer = true,
   },
   --{
      ---- Display Name
      --Text = "瀹樻柟鏂伴椈",
      ---- world path, either zip file or disk folder is supported. *.jpg, *.png, *.dds, *.bmp, *.avi, *.wmv,*.swf, is also supported.
      --FilePath = "Texture/productcover_cn.png", 
      ---- render to render NPC
      --bRenderNPC = true, 
      ---- whether to render the current player at zero position. 
      --bRenderPlayer = nil,
   --},
}
; DefaultBGScenes = DefaultBGScenes;

show the desktop window

syntax

function Map3DSystem.App.Login.ParaworldStartPage.ShowWnd(_app)

parameters

app  

Map3DSystem.App.Login.ParaworldStartPage.Show

  • param bShow : boolean to show or hide. if nil, it will toggle current setting.
  • param __ :_parent: parent window inside which the content is displayed. it can be nil.
  • param url : if nil, it will show the default startup page. otherwise the url is shown.

syntax

function Map3DSystem.App.Login.ParaworldStartPage.Show(bShow, _parent, parentWindow, url)

parameters

bShow boolean to show or hide. if nil, it will toggle current setting.
parent  
parentWindow  
url if nil, it will show the default startup page. otherwise the url is shown.

Map3DSystem.App.Login.ParaworldStartPage.OnClickSwitchBG

user clicked to change bg

syntax

function Map3DSystem.App.Login.ParaworldStartPage.OnClickSwitchBG(treeNode)

parameters

treeNode  

Map3DSystem.App.Login.ParaworldStartPage.OnClickBGFromFile

allow the user to open a bg from a world, image file, etc.

syntax

function Map3DSystem.App.Login.ParaworldStartPage.OnClickBGFromFile()

Map3DSystem.App.Login.ParaworldStartPage.SwitchBG

[[ switching to the bg
   * _param_ __bgInfo__ : if nil, an empty bg is used, otherwise {
   -- Display Name
   Text = "甯曟媺宸己鐪佽儗鏅?,
   -- world path, either zip file or disk folder is supported. *.jpg, *.png, *.dds, *.bmp, *.avi, *.wmv,*.swf, is also supported.
   FilePath = "worlds/login_world", 
   -- render to render NPC
   bRenderNPC = true, 
   -- whether to render the current player at zero position. 
   bRenderPlayer = nil,
}
  • return __ : return true if succeed.
]]

syntax

function Map3DSystem.App.Login.ParaworldStartPage.SwitchBG(bgInfo)

parameters

| bgInfo | if nil, an empty bg is used, otherwise { -- Display Name Text = "甯曟媺宸己鐪佽儗鏅?, -- world path, either zip file or disk folder is supported. .jpg, *.png, *.dds, *.bmp, *.avi, *.wmv,.swf, is also supported. FilePath = "worlds/login_world", -- render to render NPC bRenderNPC = true, -- whether to render the current player at zero position. bRenderPlayer = nil, } |

Map3DSystem.App.Login.ParaworldStartPage.ShowBGSelectionMenu

bring up a context menu for selecting which bg to display.

syntax

function Map3DSystem.App.Login.ParaworldStartPage.ShowBGSelectionMenu()

Map3DSystem.App.Login.ParaworldStartPage.OnDestory

destory the control

syntax

function Map3DSystem.App.Login.ParaworldStartPage.OnDestory()

Map3DSystem.App.Login.ParaworldStartPage.OnMCML_UserRegister


MCML page event handlers

User filled out the registration form and submitted

  • param values : username, password, password_confirm, birth_day, birth_month, birth_year, email, gender

syntax

function Map3DSystem.App.Login.ParaworldStartPage.OnMCML_UserRegister(btnName, values, bindingContext)

parameters

btnName  
values username, password, password_confirm, birth_day, birth_month, birth_year, email, gender
bindingContext  

Map3DSystem.App.Login.OnClickNewAccount

user clicks to register a new account.

syntax

function Map3DSystem.App.Login.OnClickNewAccount()

Map3DSystem.App.Login.GotoPage

go to a given page

  • param url : url of the page
  • param cachePolicy : nil or a cache policy. if nil, it defaults to 1 day.

syntax

function Map3DSystem.App.Login.GotoPage(url, cachePolicy)

parameters

url url of the page
cachePolicy  

settings.html code-behind script

Title settings.html code-behind script
Author(s) LiXizhi
Date 2008/4/18
File script/kids/3DMapSystemApp/Login/setting.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/Login/setting.lua");
Map3DSystem.App.Login.SettingPage:Create("LoginApp.SettingPage", nil, "_ct", -width/2, -height/2, width, height);

Member Functions

SettingPage.OnInit

create class local SettingPage = Map3DSystem.mcml.PageCtrl:new({url="script/kids/3DMapSystemApp/Login/SettingPage.html"}); SettingPage = SettingPage;

this function is overridable. it is called before page UI is about to be created.

  • param self :.mcmlNode: the root pe:mcml node, one can modify it here before the UI is created, such as filling in default data.

syntax

function SettingPage.OnInit()

SettingPage.UseCurrentPageBtn


page event handlers

When clicks the button

syntax

function SettingPage.UseCurrentPageBtn(sCtrlName, values)

parameters

sCtrlName  
values  

SettingPage.UseDefaultBtn

When clicks the button

syntax

function SettingPage.UseDefaultBtn(sCtrlName, values)

parameters

sCtrlName  
values  

SettingPage.UseBlankPageBtn

When clicks the button

syntax

function SettingPage.UseBlankPageBtn(sCtrlName, values)

parameters

sCtrlName  
values  

SettingPage.UseDefaultSceneBtn

When clicks the button

syntax

function SettingPage.UseDefaultSceneBtn(sCtrlName, values)

parameters

sCtrlName  
values  

SettingPage.UseBlankSceneBtn

When clicks the button

syntax

function SettingPage.UseBlankSceneBtn(sCtrlName, values)

parameters

sCtrlName  
values  

SettingPage.Open3DBackgroundBtn

allow the user to open a bg from a world, image file, etc.

syntax

function SettingPage.Open3DBackgroundBtn()

SettingPage.SaveCommonBtn

saved the common form.

syntax

function SettingPage.SaveCommonBtn(sCtrlName, values)

parameters

sCtrlName  
values  

SettingPage.SaveConnectionBtn

saved the connection form.

syntax

function SettingPage.SaveConnectionBtn(sCtrlName, values)

parameters

sCtrlName  
values  

TutorialPage.html code-behind script

Title TutorialPage.html code-behind script
Author(s) LiXizhi
Date 2008/6/17
File script/kids/3DMapSystemApp/Login/TutorialPage.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/Login/TutorialPage.lua");

Member Functions

TutorialPage.DS_OfflineTutorial_Func

 template db table
TutorialPage.dsOfflineTutorials = {
   {Title=L"鍩虹绡?, SubTitle=L"鏁欎綘鍩烘湰浜虹墿鎿嶄綔, 浣跨敤宸ュ叿, 鍒涢€?D瀹跺洯, 鎺㈢储3D绀句氦缃戠粶", worldpath=F"worlds/Official/鏂版墜涔嬭矾", preview=F"worlds/Official/鏂版墜涔嬭矾/preview.jpg", },
   {Title=L"鍎跨绡?, SubTitle=L"濡傛灉浣犳湁7-12宀佺殑瀛╁瓙, 鍙互闄粬浠竴璧峰垱浣? 鍏ㄩ潰鎻愰珮鍎跨鐨勬兂鍍忓姏, 鍒涢€犲姏, 棰嗗鍔?寤鸿涓?..)", worldpath="worlds/Official/DisneyLand", preview="worlds/Official/DisneyLand/preview.jpg", },
   {Title=L"寮€鍙戠瘒", SubTitle=L"浠嬬粛PEDN寮€鍙戠綉, 搴旂敤绋嬪簭鏋舵瀯, 鍒涘缓灞炰簬浣犵殑3D浜掕仈缃戜骇涓?(寤鸿涓?..)", worldpath="worlds/Official/NewUserVillage3", preview="worlds/Official/NewUserVillage3/preview.jpg", },
   {Title=L"鎻愰珮绡?, SubTitle=L"鏁欎綘鍒朵綔鏅鸿兘浜虹墿, 鎷嶆憚鐢靛奖, 浠ュ強閮ㄥ垎绀句氦骞冲彴鍔熻兘(寤鸿涓?..)", worldpath="worlds/Official/NewUserVillage2", preview="worlds/Official/NewUserVillage2/preview.jpg", },
}
;

datasource function for pe:gridview

syntax

function TutorialPage.DS_OfflineTutorial_Func(index)

parameters

index  

TutorialPage.DS_OnlineTutorial_Func

 template db table
TutorialPage.dsOnlineTutorials = {
   {Title=L"鏂版墜鏉?, SubTitle=L"鏁欎綘鍩烘湰浜虹墿鎿嶄綔, 浣跨敤宸ュ叿, 鍒涢€?D瀹跺洯, 鎺㈢储3D绀句氦缃戠粶", worldpath=F"worlds/Official/鏂版墜涔嬭矾", preview=F"worlds/Official/鏂版墜涔嬭矾/preview.jpg", },
   {Title=L"鍎跨鏉?, SubTitle=L"濡傛灉浣犳湁7-12宀佺殑瀛╁瓙, 鍙互闄粬浠竴璧峰垱浣? 鍏ㄩ潰鎻愰珮鍎跨鐨勬兂鍍忓姏, 鍒涢€犲姏, 棰嗗鍔?寤鸿涓?..)", worldpath="worlds/Official/DisneyLand", preview="worlds/Official/DisneyLand/preview.jpg", },
   {Title=L"寮€鍙戣€呮潙", SubTitle=L"浠嬬粛PEDN寮€鍙戠綉, 搴旂敤绋嬪簭鏋舵瀯, 鍒涘缓灞炰簬浣犵殑3D浜掕仈缃戜骇涓?寤鸿涓?..)", worldpath="worlds/Official/NewUserVillage3", preview="worlds/Official/NewUserVillage3/preview.jpg", },
   
   {Title=L"楂樼骇绡?, SubTitle=L"鏁欎綘鍒朵綔鏅鸿兘浜虹墿, 鎷嶆憚鐢靛奖, 浠ュ強閮ㄥ垎绀句氦骞冲彴鍔熻兘(寤鸿涓?..)", worldpath="worlds/Official/NewUserVillage1", preview="worlds/Official/NewUserVillage1/preview.jpg", },
   {Title=L"棰佸宀?, SubTitle=L"鍚勭璇勯€夋椿鍔ㄧ殑棰佸鍦扮偣(寤鸿涓?..)", worldpath="worlds/Official/NewUserVillage2", preview="worlds/Official/NewUserVillage2/preview.jpg", },
   {Title=L"鎯呬荆宀?, SubTitle=L"缁撲氦鏂版湅鍙?寤鸿涓?..)", worldpath="worlds/Official/NewUserVillage3", preview="worlds/Official/NewUserVillage3/preview.jpg", },
}
;

datasource function for pe:gridview

syntax

function TutorialPage.DS_OnlineTutorial_Func(index)

parameters

index  
Topic revision: r1 - 2008-02-29 - LiXizhi
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback