---++!! !CCSAppDev __description__: 缂栬緫浜虹墿鐨勭鏃忋€佺浉璨屻€佽。鐫€鍜岄亾鍏凤紝浠ュ強鐜╁鐨勫寲韬?avatar)绠$悊. %TOC{title="Contents:"}% %STARTINCLUDE% ---++ Character custimization system (avatar info) app for Paraworld | *Title* | Character custimization system (avatar info) app for Paraworld | | *Author(s)* | LiXizhi | | *Date* | 2008/2/14 | | *File* | script/kids/3DMapSystemUI/CCS/app_main.lua | ---+++ Description Editing character appearances. Managing the default avatar appearance for a user ---++ Profile.CCS.AnimationPage Play a predefined animation file or its index. <verbatim> -- ShortCutIndex is the index of the animation, usually 1-9. Map3DSystem.App.Commands.Call("Profile.CCS.AnimationPage", {ShortCutIndex = keyNumber}) </verbatim> ---++ character facing target set the facing of the character to the target <verbatim> Map3DSystem.App.CCS.CharacterFaceTarget(ParaScene.GetPlayer(), x,y,z); </verbatim> db registration insert script INSERT INTO apps VALUES (NULL, 'CCS_GUID', 'CCS', '1.0.0', 'http://www.paraengine.com/apps/CCS_v1.zip', 'YourCompany', 'enUS', 'script/kids/3DMapSystemUI/CCS/IP.xml', '', 'script/kids/3DMapSystemUI/CCS/app_main.lua', 'Map3DSystem.App.CCS.MSGProc', 1); %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/CCS/app_main.lua"); </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.App.CCS.OnConnection requires create class commonlib.setfield("Map3DSystem.App.CCS", {}); ------------------------------------------- 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__ <verbatim>function Map3DSystem.App.CCS.OnConnection(app, connectMode)</verbatim> __parameters__ | *app* | the object representing the current application in the IDE. | | *connectMode* | | ---++++ !Map3DSystem.App.CCS.OnDisconnection Receives notification that the Add-in is being unloaded. __syntax__ <verbatim>function Map3DSystem.App.CCS.OnDisconnection(app, disconnectMode)</verbatim> __parameters__ | *app* | | | *disconnectMode* | | ---++++ !Map3DSystem.App.CCS.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__ <verbatim>function Map3DSystem.App.CCS.OnQueryStatus(app, commandName, statusWanted)</verbatim> __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. | ---++++ !Map3DSystem.App.CCS.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__ <verbatim>function Map3DSystem.App.CCS.OnExec(app, commandName, params)</verbatim> __parameters__ | *app* | | | *commandName* | The name of the command to determine state for. Usually in the string format "Category.SubCate.Name". | | *params* | | ---++++ !Map3DSystem.App.CCS.CharacterFaceCamera * _param_ __let__ : the object to face camera. __syntax__ <verbatim>function Map3DSystem.App.CCS.CharacterFaceCamera(obj)</verbatim> __parameters__ | *obj* | | ---++++ !Map3DSystem.App.CCS.CharacterFaceTarget * _param_ __let__ : the object to face camera. * _param_ __cx__ :,cy,cz: the target position in world space to which the obj will face to. __syntax__ <verbatim>function Map3DSystem.App.CCS.CharacterFaceTarget(obj, cx,cy,cz)</verbatim> __parameters__ | *obj* | | | *cx* | | | *cy* | | | *cz* | | ---++++ !Map3DSystem.App.CCS.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__ <verbatim>function Map3DSystem.App.CCS.OnRenderBox(mcmlData)</verbatim> __parameters__ | *mcmlData* | | ---++++ !Map3DSystem.App.CCS.Navigate called when the user wants to nagivate to the 3D world location relavent to this application __syntax__ <verbatim>function Map3DSystem.App.CCS.Navigate()</verbatim> ---++++ !Map3DSystem.App.CCS.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__ <verbatim>function Map3DSystem.App.CCS.GotoHomepage()</verbatim> ---++++ !Map3DSystem.App.CCS.DoQuickAction called when user clicks the quick action for this application. __syntax__ <verbatim>function Map3DSystem.App.CCS.DoQuickAction()</verbatim> ---++++ !Map3DSystem.App.CCS.OnWorldLoad called whenever a new world is loaded (just before the 3d scene is enabled, yet after world data is loaded). __syntax__ <verbatim>function Map3DSystem.App.CCS.OnWorldLoad()</verbatim> ---++++ !Map3DSystem.App.CCS.OnWorldClosed called whenever a world is being closed. __syntax__ <verbatim>function Map3DSystem.App.CCS.OnWorldClosed()</verbatim> ---++++ !Map3DSystem.App.CCS.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__ <verbatim>function Map3DSystem.App.CCS.MSGProc(window, msg)</verbatim> __parameters__ | *window* | | | *msg* | | ---++ code behind of character animation page | *Title* | code behind of character animation page | | *Author(s)* | LiXizhi | | *Date* | 2008.6.13 | | *File* | script/kids/3DMapSystemUI/CCS/AnimationPage.lua | ---+++ Description play universal animation file. %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/CCS/AnimationPage.lua"); Map3DSystem.App.CCS.AnimationPage.PlayAnimByIndex(index) Map3DSystem.App.CCS.AnimationPage.PlayAnimFile(filepath) </verbatim> ---+++ Member Functions ---++++ !AnimationPage.DS_Anims_Func <verbatim> create class local AnimationPage = {}; commonlib.setfield("Map3DSystem.App.CCS.AnimationPage", AnimationPage); skybox db table AnimationPage.CommonAnims = { {text="榧撴帉", file = "character/Animation/v3/榧撴帉.x", bg = "character/Animation/v3/榧撴帉.x.png"}, {text="鍐嶈", file = "character/Animation/v3/鍐嶈.x", bg = "character/Animation/v3/鍐嶈.x.png"}, {text="璁ㄨ", file = "character/Animation/v3/璁ㄨ.x", bg = "character/Animation/v3/璁ㄨ.x.png"}, {text="绱у紶", file = "character/Animation/v3/绱у紶.x", bg = "character/Animation/v3/绱у紶.x.png"}, {text="娆㈣繋", file = "character/Animation/v3/娆㈣繋.x", bg = "character/Animation/v3/娆㈣繋.x.png"}, {text="娆㈠懠", file = "character/Animation/v3/娆㈠懠.x", bg = "character/Animation/v3/娆㈠懠.x.png"}, {text="鎰ゆ€?, file = "character/Animation/v3/鎰ゆ€?x", bg = "character/Animation/v3/鎰ゆ€?x.png"}, {text="鍝常", file = "character/Animation/v3/鍝常.x", bg = "character/Animation/v3/鍝常.x.png"}, {text="鍨傚ご涓ф皵", file = "character/Animation/v3/鍨傚ご涓ф皵.x", bg = "character/Animation/v3/鍨傚ご涓ф皵.x.png"}, {text="涓嶅彲涓€涓?, file = "character/Animation/v3/涓嶅彲涓€涓?x", bg = "character/Animation/v3/涓嶅彲涓€涓?x.png"}, {text="鐐瑰ご", file = "character/Animation/v3/寰堝叴濂嬬殑鐐瑰ご.x", bg = "character/Animation/v3/寰堝叴濂嬬殑鐐瑰ご.x.png"}, {text="澶辨湜", file = "character/Animation/v3/寰堝け鏈涚殑鎽囧ご.x", bg = "character/Animation/v3/寰堝け鏈涚殑鎽囧ご.x.png"}, }</verbatim>; local function DoEncoding() local _, t; for _,t in ipairs(AnimationPage.CommonAnims) do t.file = commonlib.Encoding.Utf8ToDefault(t.file) t.bg = commonlib.Encoding.Utf8ToDefault(t.bg) end end DoEncoding(); datasource function for pe:gridview __syntax__ <verbatim>function AnimationPage.DS_Anims_Func(index)</verbatim> __parameters__ | *index* | | ---++++ !AnimationPage.OnInit init __syntax__ <verbatim>function AnimationPage.OnInit()</verbatim> ---++++ !AnimationPage.PlayAnimFile ------------------------- common anim tab ------------------------- clicks the common animation file * _return_ ____ : true if played. __syntax__ <verbatim>function AnimationPage.PlayAnimFile(filepath)</verbatim> __parameters__ | *filepath* | | | *return* | true if played. | ---++++ !AnimationPage.PlayAnimByIndex clicks the common animation file by its index * _param_ __index__ : [1,9]. upper limit is the size of AnimationPage.CommonAnims * _return_ ____ : true if played. __syntax__ <verbatim>function AnimationPage.PlayAnimByIndex(index)</verbatim> __parameters__ | *index* | [1,9]. upper limit is the size of AnimationPage.CommonAnims | ---++++ !AnimationPage.OnSelectFolder ------------------------- from file tab ------------------------- User clicks a file __syntax__ <verbatim>function AnimationPage.OnSelectFolder(name, folderPath)</verbatim> __parameters__ | *name* | | | *folderPath* | | ---++++ !AnimationPage.OnSelectAnimFile User clicks a file __syntax__ <verbatim>function AnimationPage.OnSelectAnimFile(name, filepath)</verbatim> __parameters__ | *name* | | | *filepath* | | ---++++ !AnimationPage.OnDoubleClickAnimFile user double clicks a file, it will select it and add it to scene. __syntax__ <verbatim>function AnimationPage.OnDoubleClickAnimFile(name, filepath)</verbatim> __parameters__ | *name* | | | *filepath* | | ---++++ !AnimationPage.OnClickPlayAnimFile play animation file. __syntax__ <verbatim>function AnimationPage.OnClickPlayAnimFile()</verbatim> ---++++ !AnimationPage.SaveOpenAnimFileRecord save open world record, so that next time the page is shown, users can open recent world files. * _param_ __filepath__ : world path __syntax__ <verbatim>function AnimationPage.SaveOpenAnimFileRecord(filepath)</verbatim> __parameters__ | *filepath* | world path | ---++ registration page functions for avatar application | *Title* | registration page functions for avatar application | | *Author(s)* | WangTian | | *Date* | 2008/3/18, revised 2008.3.21 LXZ | | *File* | script/kids/3DMapSystemUI/CCS/AvatarRegPage.lua | ---+++ Description script/kids/3DMapSystemApp/avatar/RegistrationPage.html is the registration page for the avatar application. This NPL file contains all the necessary functions needed during the page interaction. The registration page will display a 3D avatar on the right(using mini scene graph) <pe:avatar>, a list of avaible avatars in the middle(using TreeView) <pe:treeview>, and a brief description of the selected avatar <pe:box>. %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/CCS/AvatarRegPage.lua"); Map3DSystem.App.CCS.AvatarRegPage:Create("CCS.AvatarRegPage", parent, "_fi", 0,0,0,0); </verbatim> ---+++ Member Functions ---++++ !AvatarRegPage.DS_Avatar_Func <verbatim> create class local AvatarRegPage = Map3DSystem.mcml.PageCtrl:new({url="script/kids/3DMapSystemUI/CCS/AvatarRegPage.html"}); Map3DSystem.App.CCS.AvatarRegPage = AvatarRegPage; avatar db table, the name property is [race]/[gender] or normal character model path AvatarRegPage.avatars = { {name = "Human/Male", desc="鐢烽潚骞?, ccsinfo = "0#0#4#2#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#214#0#135#163#0#0#0#0#0#0#0#", bg = "character/v3/Human/snapshots/avatar_human_male_1.png"}, {name = "Human/Female", desc="濂抽潚骞?, ccsinfo = "0#0#0#1#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#216#0#113#155#0#0#0#0#0#0#0#", bg = "character/v3/Human/snapshots/avatar_human_female_1.png"}, {name = "Human/Male", desc="灏忓竻鍝?, ccsinfo = "0#0#1#2#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#231#0#122#177#0#0#0#0#0#0#0#", bg = "character/v3/Human/snapshots/avatar_human_male_2.png"}, {name = "Human/Female", desc="閭诲濂冲", ccsinfo = "0#0#6#4#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#235#0#114#170#0#0#0#0#0#0#0#", bg = "character/v3/Human/snapshots/avatar_human_female_2.png"}, {name = "Human/Male", desc="杩愬姩鐢峰", ccsinfo = "0#0#2#2#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#217#0#119#169#0#0#0#0#0#0#0#", bg = "character/v3/Human/snapshots/avatar_human_male_3.png"}, {name = "Human/Female", desc="娣戝コ", ccsinfo = "0#0#2#3#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#229#0#115#166#0#0#0#0#0#0#0#", bg = "character/v3/Human/snapshots/avatar_human_female_3.png"}, {name = "Human/Male", desc="鍙涢€嗙敺瀛?, ccsinfo = "0#0#2#0#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#252#0#148#178#0#0#0#0#0#0#0#", bg = "character/v3/Human/snapshots/avatar_human_male_4.png"}, {name = "Human/Female", desc="鏃跺皻濂冲", ccsinfo = "0#0#3#1#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#227#0#118#168#0#0#0#0#0#0#0#", bg = "character/v3/Human/snapshots/avatar_human_female_4.png"}, --{name = "character/v1/01human/baru/baru.x", desc="灏忓鐢?, ccsinfo = nil, bg = "character/v1/01human/baru/baru.x.png"}, --{name = "character/v1/01human/boy/boy.x", desc="灏忕敺瀛?, ccsinfo = nil, bg = "character/v1/01human/boy/boy.x.png"}, -- --{name = "character/v1/02animals/01land/pigmen/pig.x", desc="灏忕尓", ccsinfo = nil, bg = "character/v1/02animals/01land/pigmen/pig.x.png"}, --{name = "character/v1/02animals/01land/dog/dog.x", desc="灏忕嫍", ccsinfo = nil, bg = "character/v1/02animals/01land/dog/dog.x.png"}, -- --{name = "character/v1/02animals/01land/snake/snake.x", desc="铔?, ccsinfo = nil, bg = "character/v1/02animals/01land/snake/snake.x.png"}, --{name = "character/v1/02animals/01land/guagua/guagua.x", desc="闈掕洐", ccsinfo = nil, bg = "character/v1/02animals/01land/guagua/guagua.x.png"}, -- --{name = "character/v1/02animals/01land/chengcheng/cheng.x", desc="铚樿洓", ccsinfo = nil, bg = "character/v1/02animals/01land/chengcheng/cheng.x.png"}, --{name = "character/v1/02animals/01land/chevalier/chevalier.x", desc="鐙楅獞澹?, ccsinfo = nil, bg = "character/v1/02animals/01land/chevalier/chevalier.x.png"}, --{name = "angel/male", desc="澶╀娇鏃忓皬濮?, ccsinfo = nil, bg = "character/v1/01human/baru/baru.x.png"}, --{name = "angel/female", desc="澶╀娇鏃忕粎澹?, ccsinfo = nil, bg = "character/v1/01human/boy/boy.x.png"}, --{name = "momo/male", desc="瀣峰鏃忓皬濮?, ccsinfo = nil, bg = "character/v1/01human/baru/baru.x.png"}, --{name = "momo/female", desc="瀣峰鏃忕粎澹?, ccsinfo = nil, bg = "character/v1/01human/boy/boy.x.png"}, }</verbatim>; datasource function for pe:gridview __syntax__ <verbatim>function AvatarRegPage.DS_Avatar_Func(index)</verbatim> __parameters__ | *index* | | ---++++ !AvatarRegPage.TakeAvatarSnapshot function to be called when user completed or skipped all app registration steps. callback function to call after the registration page finish or skip AvatarRegPage.OnFinishedFunc = nil; take screen shot of the character pe:avatar. __syntax__ <verbatim>function AvatarRegPage.TakeAvatarSnapshot()</verbatim> ---++++ !AvatarRegPage.UpdateAvatar User select a character in the gridview list, change the 3d display in pe:avatar window __syntax__ <verbatim>function AvatarRegPage.UpdateAvatar(index)</verbatim> __parameters__ | *index* | | ---++++ !AvatarRegPage.OnAccept Accept the current preview avatar and save to CCSApp profile __syntax__ <verbatim>function AvatarRegPage.OnAccept(btnName, values, bindingContext)</verbatim> __parameters__ | *btnName* | | | *values* | | | *bindingContext* | | ---++++ !AvatarRegPage.OnSkip Skip the avatar registration page __syntax__ <verbatim>function AvatarRegPage.OnSkip(btnName, values, bindingContext)</verbatim> __parameters__ | *btnName* | | | *values* | | | *bindingContext* | | ---++++ !AvatarRegPage:Leave just exit to call back. __syntax__ <verbatim>function AvatarRegPage:Leave()</verbatim> ---++ character customization system UI plug-in for 3D Map System | *Title* | character customization system UI plug-in for 3D Map System | | *Author(s)* | WangTian | | *Date* | 2007/10/29 | | *File* | script/kids/3DMapSystemUI/CCS/CartoonFace.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/CCS/CartoonFace.lua"); local CartoonFace = Map3DSystem.UI.CCS.CartoonFace; </verbatim> ---+++ Member Functions ---++++ !CartoonFace.Show create, init and display the cartoon face UI control * _param_ __parent__ : ParaUIObject which is the parent container __syntax__ <verbatim>function CartoonFace.Show(parent)</verbatim> __parameters__ | *parent* | ParaUIObject which is the parent container | ---++++ !CartoonFace.OnDestroy destroy the control __syntax__ <verbatim>function CartoonFace.OnDestroy()</verbatim> ---++++ !CartoonFace.PageLeft Page Left __syntax__ <verbatim>function CartoonFace.PageLeft()</verbatim> ---++++ !CartoonFace.PageRight Page Right __syntax__ <verbatim>function CartoonFace.PageRight()</verbatim> ---++++ !CartoonFace.GetDirectory get the face directory according to current face component section __syntax__ <verbatim>function CartoonFace.GetDirectory()</verbatim> ---++++ !CartoonFace.ResetFaceComponent reset face component section __syntax__ <verbatim>function CartoonFace.ResetFaceComponent()</verbatim> ---++++ !CartoonFace.OnIconMatrixClick click on cartoon face icon matrix set the cartoon face component according to the click __syntax__ <verbatim>function CartoonFace.OnIconMatrixClick(x, y)</verbatim> __parameters__ | *x* | | | *y* | | ---++ character customization system UI face component for 3D Map System | *Title* | character customization system UI face component for 3D Map System | | *Author(s)* | WangTian | | *Date* | 2007/10/29 | | *File* | script/kids/3DMapSystemUI/CCS/CartoonFaceComponent.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/CCS/CartoonFaceComponent.lua"); </verbatim> ---+++ Member Functions ---++++ !CartoonFaceComponent.SetFaceSection * _param_ __section__ : set the current section of the face component __syntax__ <verbatim>function CartoonFaceComponent.SetFaceSection(Section)</verbatim> __parameters__ | *Section* | | ---++++ !CartoonFaceComponent.GetFaceComponentSection get the current section of the face component __syntax__ <verbatim>function CartoonFaceComponent.GetFaceComponentSection()</verbatim> ---++++ !CartoonFaceComponent.SetFaceComponent Function: set the face component parameters for the specific section __syntax__ <verbatim>function CartoonFaceComponent.SetFaceComponent(SubType, value, donot_refresh)</verbatim> __parameters__ | *SubType* | | | *value* | | | *donot* | | | *refresh* | | ---++ Character Customization System public functions | *Title* | Character Customization System public functions | | *Author(s)* | WangTian | | *Date* | 2007/10/29, refactored 2008.6.12 by LiXizhi | | *File* | script/kids/3DMapSystemUI/CCS/ccs.lua | ---+++ Description Basic ccs functions %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/CCS/ccs.lua"); </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.UI.CCS.GetCCSInfoString get the CCS information string from the obj_param * _param_ __obj__ :_param: object parameter(table) or ParaObject object * _return_ ____ : the ccs info string if CCS character or nil if no CCS information is found __syntax__ <verbatim>function Map3DSystem.UI.CCS.GetCCSInfoString(obj_params)</verbatim> __parameters__ | *obj* | _param: object parameter(table) or ParaObject object | | *params* | | ---++++ !Map3DSystem.UI.CCS.ApplyCCSInfoString apply the ccs information string to the obj_params object * _param_ __obj__ :_param: object parameter(table) or ParaObject object * _param_ __sInfo__ : ccs information string NOTE: obj can be ParaScene object or mini scene graph object __syntax__ <verbatim>function Map3DSystem.UI.CCS.ApplyCCSInfoString(obj_params, sInfo)</verbatim> __parameters__ | *obj* | _param: object parameter(table) or ParaObject object | | *params* | | | *sInfo* | | ---++ character save page | *Title* | character save page | | *Author(s)* | WangTian | | *Date* | 2008/6/12 | | *File* | script/kids/3DMapSystemUI/CCS/CharSavePage.lua | ---+++ Description script/kids/3DMapSystemApp/CCS/CharSavePage.html is the character save page for the CCS application. The character selection page will display a 3D avatar on the right and a list of operation that user can take %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/CCS/CharSavePage.lua"); </verbatim> ---+++ Member Functions ---++++ !CharSavePage.OnInit create class local CharSavePage = {}; commonlib.setfield("Map3DSystem.App.CCS.CharSavePage", CharSavePage); on init show the current avatar in pe:avatar __syntax__ <verbatim>function CharSavePage.OnInit()</verbatim> ---++++ !CharSavePage.TakeAvatarSnapshot take screen shot of the character pe:avatar. __syntax__ <verbatim>function CharSavePage.TakeAvatarSnapshot()</verbatim> ---++++ !CharSavePage.OnRefreshAvatar load the current player to canvas __syntax__ <verbatim>function CharSavePage.OnRefreshAvatar()</verbatim> ---++++ !CharSavePage.OnClickSave save the user avatar information __syntax__ <verbatim>function CharSavePage.OnClickSave()</verbatim> ---++ character selection page | *Title* | character selection page | | *Author(s)* | WangTian | | *Date* | 2008/6/12 | | *File* | script/kids/3DMapSystemUI/CCS/CharSelectionPage.lua | ---+++ Description script/kids/3DMapSystemApp/CCS/CharSelectionPage.html is the character selection page for the CCS application. The character selection page will display a 3D avatar on the right and a list of avaiable characters that use can choose from %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/CCS/CharSelectionPage.lua"); </verbatim> ---+++ Member Functions ---++++ !CharSelectionPage.DS_Avatar_Func <verbatim> create class local CharSelectionPage = {}; commonlib.setfield("Map3DSystem.App.CCS.CharSelectionPage", CharSelectionPage); avatar db table, the name property is [race]/[gender] or normal character model path CharSelectionPage.avatars = { {name = "Human/Male", ext="xml",desc="鐢烽潚骞?, ccsinfo = "0#0#4#2#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#214#0#135#163#0#0#0#0#0#0#0#", bg = "character/v3/Human/snapshots/avatar_human_male_1.png"}, {name = "Human/Female", ext="xml", desc="濂抽潚骞?, ccsinfo = "0#0#0#1#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#216#0#113#155#0#0#0#0#0#0#0#", bg = "character/v3/Human/snapshots/avatar_human_female_1.png"}, {name = "Human/Male", ext="xml", desc="灏忓竻鍝?, ccsinfo = "0#0#1#2#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#231#0#122#177#0#0#0#0#0#0#0#", bg = "character/v3/Human/snapshots/avatar_human_male_2.png"}, {name = "Human/Female", ext="xml", desc="閭诲濂冲", ccsinfo = "0#0#6#4#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#235#0#114#170#0#0#0#0#0#0#0#", bg = "character/v3/Human/snapshots/avatar_human_female_2.png"}, {name = "Human/Male", ext="xml", desc="杩愬姩鐢峰", ccsinfo = "0#0#2#2#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#217#0#119#169#0#0#0#0#0#0#0#", bg = "character/v3/Human/snapshots/avatar_human_male_3.png"}, {name = "Human/Female", ext="xml", desc="娣戝コ", ccsinfo = "0#0#2#3#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#229#0#115#166#0#0#0#0#0#0#0#", bg = "character/v3/Human/snapshots/avatar_human_female_3.png"}, {name = "Human/Male", ext="xml", desc="鍙涢€嗙敺瀛?, ccsinfo = "0#0#2#0#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#252#0#148#178#0#0#0#0#0#0#0#", bg = "character/v3/Human/snapshots/avatar_human_male_4.png"}, {name = "Human/Female", ext="xml", desc="鏃跺皻濂冲", ccsinfo = "0#0#3#1#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#227#0#118#168#0#0#0#0#0#0#0#", bg = "character/v3/Human/snapshots/avatar_human_female_4.png"}, }</verbatim>; datasource function for pe:gridview __syntax__ <verbatim>function CharSelectionPage.DS_Avatar_Func(index)</verbatim> __parameters__ | *index* | | ---++++ !CharSelectionPage.TakeAvatarSnapshot take screen shot of the character pe:avatar. __syntax__ <verbatim>function CharSelectionPage.TakeAvatarSnapshot()</verbatim> ---++++ !CharSelectionPage.UpdateChar User select a character in the gridview list, change the 3d display in pe:avatar window __syntax__ <verbatim>function CharSelectionPage.UpdateChar(index)</verbatim> __parameters__ | *index* | | ---++++ !CharSelectionPage.OnAccept Accept the current preview avatar and save to CCSApp profile __syntax__ <verbatim>function CharSelectionPage.OnAccept(btnName, values, bindingContext)</verbatim> __parameters__ | *btnName* | | | *values* | | | *bindingContext* | | ---++++ !CharSelectionPage:Leave just exit to call back. __syntax__ <verbatim>function CharSelectionPage:Leave()</verbatim> ---++ character customization database for 3D Map System | *Title* | character customization database for 3D Map System | | *Author(s)* | WangTian | | *Date* | 2007/10/29, refactored 2008.6.12 lxz | | *File* | script/kids/3DMapSystemUI/CCS/DB.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/CCS/DB.lua"); local DB = Map3DSystem.UI.CCS.DB </verbatim> ---+++ Member Functions ---++++ !DB.InitBodyParamIDSet ---- common control library NPL.load("(gl)script/sqlite/sqlite3.lua"); local DB = {} commonlib.setfield("Map3DSystem.UI.CCS.DB", DB) DB.BodyParamIDSet = {}; DB.dbfile = "Database/characters.db"; DB.ModelDir = "character/v3/Child/"; DB.Gender= "Male"; DB.ItemObjectPath = "character/v3/Item/ObjectComponents/"; DB.ItemTexturePath = "character/v3/Item/TextureComponents/"; DB.ItemIdLists = {}; DB.ItemIdSlotLists = {}; DB.FaceStyleLists = {}; DB.FaceIconLists = {}; DB.FaceStyleIterators = {}; DB.CurrentCharacterInfo = {}; the following are calculated DB.ModelName = "Child"; DB.ModelPath = "character/v3/Child/Male/ChildMale.x"; character slots DB.CS_HEAD =0; DB.CS_NECK = 1; DB.CS_SHOULDER = 2; DB.CS_BOOTS = 3; DB.CS_BELT = 4; DB.CS_SHIRT = 5; DB.CS_PANTS = 6; DB.CS_CHEST = 7; DB.CS_BRACERS = 8; DB.CS_GLOVES = 9; DB.CS_HAND_RIGHT = 10; DB.CS_HAND_LEFT = 11; DB.CS_CAPE = 12; DB.CS_TABARD = 13; item types DB.IT_HEAD = 1; DB.IT_NECK=2;--鑴栧瓙 DB.IT_SHOULDER=3;-- 鑲? DB.IT_SHIRT=4;-- 涓婅。 DB.IT_CHEST=5;-- 鑳? DB.IT_BELT=6; DB.IT_PANTS=7;-- 瑁ゅ瓙 DB.IT_BOOTS=8; -- 闉嬪瓙 DB.IT_BRACERS=9; DB.IT_GLOVES=10;-- 鎵嬪 DB.IT_RINGS=11; DB.IT_OFFHAND=12; DB.IT_DAGGER=13; DB.IT_SHIELD=14; DB.IT_BOW=15; DB.IT_CAPE=16; -- 鎶 DB.IT_2HANDED=17;-- 鍙屾墜 DB.IT_QUIVER=18; DB.IT_TABARD=19; DB.IT_ROBE=20; DB.IT_1HANDED=21;-- 鍗曟墜 DB.IT_CLAW=22; DB.IT_ACCESSORY=23; DB.IT_THROWN=24; DB.IT_GUN=25; cartoon face component DB.CFS_FACE = 0; DB.CFS_WRINKLE = 1; DB.CFS_EYE = 2; DB.CFS_EYEBROW = 3; DB.CFS_MOUTH = 4; DB.CFS_NOSE = 5; DB.CFS_MARKS = 6; cartoon face sub type DB.CFS_SUB_Style = 0; DB.CFS_SUB_Color = 1; DB.CFS_SUB_Scale = 2; DB.CFS_SUB_Rotation = 3; DB.CFS_SUB_X = 4; DB.CFS_SUB_Y = 5; read facial table information __syntax__ <verbatim>function DB.InitBodyParamIDSet()</verbatim> ---++++ !DB.ResetBaseModel reset the base model __syntax__ <verbatim>function DB.ResetBaseModel(ModelDir, Gender)</verbatim> __parameters__ | *ModelDir* | | | *Gender* | | ---++++ !DB.GetPlayerChar e.g. local player, playerChar = DB.GetPlayerChar(); __syntax__ <verbatim>function DB.GetPlayerChar()</verbatim> ---++++ !DB.GetItemIdListByType return a table containing a list of IDs for a given item type;the last one is always 0 * _param_ __Type__ : item types such as DB.IT_CAPE __syntax__ <verbatim>function DB.GetItemIdListByType(type)</verbatim> __parameters__ | *type* | | ---++++ !DB.GetItemIdListBySlotType return a table containing a list of IDs for a given item type;the last one is always 0 * _param_ __Type__ : item types such as DB.CS_HAND_RIGHT __syntax__ <verbatim>function DB.GetItemIdListBySlotType(type)</verbatim> __parameters__ | *type* | | ---++++ !DB.GetFaceComponentStyleList return a table containing a list of style IDs for the given face component * _param_ __nComponentID__ : such as DB.CFS_FACE __syntax__ <verbatim>function DB.GetFaceComponentStyleList(nComponentID)</verbatim> __parameters__ | *nComponentID* | such as DB.CFS_FACE | ---++++ !DB.GetFaceComponentIconList return a table containing a list of Icon path for the given face component * _param_ __nComponentID__ : such as DB.CFS_FACE __syntax__ <verbatim>function DB.GetFaceComponentIconList(nComponentID)</verbatim> __parameters__ | *nComponentID* | such as DB.CFS_FACE | ---++++ !DB.SetFaceComponent set the face component parameters e.g. DB.SetFaceComponent(DB.CFS_EYE, DB.CFS_SUB_Scale, 0.1); * _param_ __nComponentID__ : such as DB.CFS_FACE * _param_ __SubType__ : such as DB.CFS_SUB_Scale, if this is nil, it will call ResetFaceComponent() instead 0: style: int [0,00] 1: color: 32bits ARGB 2: scale: float in [-1,1] 3: rotation: float in (-3.14,3.14] 4: x: (-128,128] 5: y: (-128,128] * _param_ __value__ : it is abolute for face type and color, and delta value for all other types. if SubType is style and value is nil, it will automatically select the next style * _param_ __refreshModel__ : if nil, it will automatically refresh the character model, otherwise it will not refresh the model. __syntax__ <verbatim>function DB.SetFaceComponent(nComponentID, SubType, value)</verbatim> __parameters__ | *nComponentID* | such as DB.CFS_FACE | | *SubType* | | | *value* | it is abolute for face type and color, and delta value for all other types. if SubType is style and value is nil, it will automatically select the next style | ---++++ !DB.GetCartoonfaceInfoString get the cartoon face info string from the obj_param * _param_ __obj__ :_param: object parameter(table) or ParaObject object * _return_ ____ : the cartoon face string if CCS character with cartoon face or nil if no cartoon face information is found __syntax__ <verbatim>function DB.GetCartoonfaceInfoString(obj_params)</verbatim> __parameters__ | *obj* | _param: object parameter(table) or ParaObject object | | *params* | | ---++++ !DB.OnChangeCartoonFace change the cartoon face info of the current seleceted character __syntax__ <verbatim>function DB.OnChangeCartoonFace(obj_params, nComponentID, SubType, value)</verbatim> __parameters__ | *obj* | | | *params* | | | *nComponentID* | | | *SubType* | | | *value* | | ---++++ !DB.ResetFaceComponent reset the given face component to default value __syntax__ <verbatim>function DB.ResetFaceComponent(nComponentID)</verbatim> __parameters__ | *nComponentID* | | ---++++ !DB.AutoGenerateItems NOTE: this function will generate the database items according to standard specification avoid calling this function without authorization Contact Andy for more information __syntax__ <verbatim>function DB.AutoGenerateItems()</verbatim> ---++++ !DB.GetInventoryDB2 get the inventory information according to tabgrid __syntax__ <verbatim>function DB.GetInventoryDB2()</verbatim> ---++ Character Customization System default appearance | *Title* | Character Customization System default appearance | | *Author(s)* | WangTian | | *Date* | 2008/3/12 | | *File* | script/kids/3DMapSystemUI/CCS/DefaultAppearance.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/CCS/DefaultAppearance.lua"); </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.UI.CCS.DefaultAppearance.MountDefaultAppearance mount a nude CCS character with default appearance * _param_ __obj__ : ParaObject object __syntax__ <verbatim>function Map3DSystem.UI.CCS.DefaultAppearance.MountDefaultAppearance(obj)</verbatim> __parameters__ | *obj* | ParaObject object | ---++ Character Customization System inventory UI for 3D Map System | *Title* | Character Customization System inventory UI for 3D Map System | | *Author(s)* | WangTian | | *Date* | 2007/10/29 | | *File* | script/kids/3DMapSystemUI/CCS/Inventory.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/CCS/Inventory.lua"); </verbatim> ---+++ Member Functions ---++++ !Inventory.Show create, init and display the head inventory UI control * _param_ __parent__ : ParaUIObject which is the parent container __syntax__ <verbatim>function Inventory.Show(parent)</verbatim> __parameters__ | *parent* | ParaUIObject which is the parent container | ---++++ !Inventory.OnDestroy destroy the control __syntax__ <verbatim>function Inventory.OnDestroy()</verbatim> ---++++ !Inventory.PageLeft Page Left __syntax__ <verbatim>function Inventory.PageLeft()</verbatim> ---++++ !Inventory.PageRight Page Right __syntax__ <verbatim>function Inventory.PageRight()</verbatim> ---++++ !Inventory.RefreshMatrix3D Page Left __syntax__ <verbatim>function Inventory.RefreshMatrix3D()</verbatim> ---++++ !Inventory.GetCharacterSlotInfoString get the character slot information string from the obj_param * _param_ __obj__ :_param: object parameter(table) or ParaObject object * _return_ ____ : the character slot info string if CCS character or nil if no character slot information is found __syntax__ <verbatim>function Inventory.GetCharacterSlotInfoString(obj_params)</verbatim> __parameters__ | *obj* | _param: object parameter(table) or ParaObject object | | *params* | | ---++++ !Inventory.OnChangeCharacterSlot change the CCS character slot info of the current seleceted character __syntax__ <verbatim>function Inventory.OnChangeCharacterSlot(obj_params, nComponent, index)</verbatim> __parameters__ | *obj* | | | *params* | | | *nComponent* | | | *index* | | ---++++ !Inventory.OnClickIconMatrix icon matrix onclick function: mount the item to character slot __syntax__ <verbatim>function Inventory.OnClickIconMatrix(x, y)</verbatim> __parameters__ | *x* | | | *y* | | ---++++ !Inventory.OnClickUnmountCurrentCharacterSlot unmount the item according to current character slot on the current seleceted character __syntax__ <verbatim>function Inventory.OnClickUnmountCurrentCharacterSlot()</verbatim> ---++ character customization system UI inventory slot for 3D Map System | *Title* | character customization system UI inventory slot for 3D Map System | | *Author(s)* | WangTian | | *Date* | 2007/10/29, refactored 2008.6.12 lxz | | *File* | script/kids/3DMapSystemUI/CCS/InventorySlot.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/CCS/InventorySlot.lua"); local InventorySlot = Map3DSystem.UI.CCS.InventorySlot </verbatim> ---+++ Member Functions ---++++ !InventorySlot.SetInventorySlot * _param_ __section__ : this is solely for debugging purposes. to make this class universal to all inventory slots InventorySlot.Component = nil; * _param_ __section__ : set the current item slot of the inventory __syntax__ <verbatim>function InventorySlot.SetInventorySlot(Section)</verbatim> __parameters__ | *Section* | | ---++++ !InventorySlot.GetInventorySlot get the current item slot of the inventory __syntax__ <verbatim>function InventorySlot.GetInventorySlot()</verbatim> ---++++ !InventorySlot.MountInventorySlot Function: set the inventory slot parameters for the specific item slot __syntax__ <verbatim>function InventorySlot.MountInventorySlot(SubType, value, donot_refresh)</verbatim> __parameters__ | *SubType* | | | *value* | | | *donot* | | | *refresh* | | ---++ Character Customization System main enterance for 3D Map System | *Title* | Character Customization System main enterance for 3D Map System | | *Author(s)* | WangTian | | *Date* | 2007/10/29 | | *File* | script/kids/3DMapSystemUI/CCS/Main.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/CCS/Main.lua"); </verbatim> ---+++ Member Functions ---++++ !CCS.ShowAuraCCSInterface the new aura user interface enhance the user experience in the column window on the side of the screen categories in enlisted on the side and show as many candidates as possible draw the CCS interface with the new aura design __syntax__ <verbatim>function CCS.ShowAuraCCSInterface(bShow, parent, wnd)</verbatim> __parameters__ | *bShow* | | | *parent* | | | *wnd* | | ---++++ !CCS.OnClickCartoonFaceComponent change the cartoon face component category * _param_ __index__ : the index into the CartoonFace category table __syntax__ <verbatim>function CCS.OnClickCartoonFaceComponent(index)</verbatim> __parameters__ | *index* | the index into the CartoonFace category table | ---++++ !CCS.InitMessageSystem init message system: call this function at main bar initialization to init the message system for CCS __syntax__ <verbatim>function CCS.InitMessageSystem()</verbatim> ---++++ !CCS.SendMeMessage send a message to CCS:CCSMain window handler e.g. CCS.SendMeMessage({type = Map3DSystem.msg.MAINBAR_Show}) __syntax__ <verbatim>function CCS.SendMeMessage(msg)</verbatim> __parameters__ | *msg* | | ---++++ !CCS.MSGProc CCS: CCSMain window handler __syntax__ <verbatim>function CCS.MSGProc()</verbatim> ---++++ !CCS.ShowCartoonFace Function: show cartoon face control * _param_ __bShow__ : boolean to show or hide. if nil, it will toggle current setting. __syntax__ <verbatim>function CCS.ShowCartoonFace(bShow)</verbatim> __parameters__ | *bShow* | boolean to show or hide. if nil, it will toggle current setting. | ---++++ !CCS.ShowInventory Color Palette _this = ParaUI.CreateUIObject("button", "btnColorPalette", "_rt", -64, 16, 64, 128) _guihelper.SetVistaStyleButtonBright(_this, "Texture/3DMapSystem/CCS/btn_CCS_ColorPalette.png"); _this.text = "Color Palette"; _this.tooltip = "璋冭壊鏉?; _this.onclick = ";Map3DSystem.UI.CCS.OnClickColorPalette();"; _parent:AddChild(_this); local _lvl0 = ParaUI.GetUIObject("map3dsystem_ccs_level0_container"); _lvl0.visible = false; else if(bShow == nil) then bShow = (_this.visible == false); end _this.visible = bShow; if(bShow == true) then --_this:SetTopLevel(true); end end CCS.OnClickFaceComponent(); --CCS.ShowUIInterface(CCS_UI_Predefined); end Function: show cartoon face control * _param_ __bShow__ : boolean to show or hide. if nil, it will toggle current setting. __syntax__ <verbatim>function CCS.ShowInventory(bShow)</verbatim> __parameters__ | *bShow* | boolean to show or hide. if nil, it will toggle current setting. | ---++++ !CCS.OnClickInventoryReturn update the character information including gender and race __syntax__ <verbatim>function CCS.OnClickInventoryReturn()</verbatim> ---++++ !CCS.UpdateCharacterInfo function CCS.PleaseSelectRaceOrGender() --local obj = ObjEditor.GetCurrentObj(); --headon_speech.Speek(obj.name, "璇烽€夋嫨绉嶆棌鍜屾€у埆,鐪嬬湅鏈変粈涔堝弽搴?-)", 2); end update the character information including gender and race __syntax__ <verbatim>function CCS.UpdateCharacterInfo(from)</verbatim> __parameters__ | *from* | | ---++++ !CCS.ShowUIInterface show a given UI in the Interface container and remove the old one e.g. CCS.ShowUIInterface(CCS_UI_Predefined); __syntax__ <verbatim>function CCS.ShowUIInterface(componentName)</verbatim> __parameters__ | *componentName* | | ---++++ !CCS.OnDestroy destroy the control __syntax__ <verbatim>function CCS.OnDestroy()</verbatim> ---++++ !CCS.OnClickFaceComponent OnClick face component matrix __syntax__ <verbatim>function CCS.OnClickFaceComponent()</verbatim> ---++++ !CCS.OnClickHeadInventory OnClick item inventory matrix __syntax__ <verbatim>function CCS.OnClickHeadInventory()</verbatim> ---++ CCS main window | *Title* | CCS main window | | *Author(s)* | WangTian | | *Date* | 2008/5/26 | | *File* | script/kids/3DMapSystemUI/CCS/Main2.lua | ---+++ Description CCS application main window is upgraded to the new aura look, including: show the window on the side instead of bottom to utilize more screen space show the items in grid view form fit to window size automaticly categories are arranged on the top and left(/right) side of the grid view %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/CCS/Main2.lua"); </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.UI.CCS.Main2.ShowMainWnd Show the CCS main window __syntax__ <verbatim>function Map3DSystem.UI.CCS.Main2.ShowMainWnd(bShow)</verbatim> __parameters__ | *bShow* | | ---++++ !Map3DSystem.UI.CCS.Main2.DestroyMainWnd destory the main window, usually called when the world is closed __syntax__ <verbatim>function Map3DSystem.UI.CCS.Main2.DestroyMainWnd()</verbatim> ---++++ !Map3DSystem.UI.CCS.Main2.OnSize change the main window size, usually called on resolution change __syntax__ <verbatim>function Map3DSystem.UI.CCS.Main2.OnSize(width, height)</verbatim> __parameters__ | *width* | | | *height* | | ---++++ !Map3DSystem.UI.CCS.Main2.MSGProc Message Processor of CCS main control On receive WM_SIZE message it will update the CartoonFaceTabGrid and InventoryTabGrid control __syntax__ <verbatim>function Map3DSystem.UI.CCS.Main2.MSGProc(window, msg)</verbatim> __parameters__ | *window* | | | *msg* | | ---++++ !Map3DSystem.UI.CCS.Main2.Show show CCS in the parent window * _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_ __parentWindow__ : parent os window object, parent window for sending messages __syntax__ <verbatim>function Map3DSystem.UI.CCS.Main2.Show(bShow, _parent, parentWindow)</verbatim> __parameters__ | *bShow* | boolean to show or hide. if nil, it will toggle current setting. | | *parent* | | | *parentWindow* | parent os window object, parent window for sending messages | ---++++ !Map3DSystem.UI.CCS.Main2.OnChangeCCSTab on change the tabgrid NOTE by andy: don't SetLevelIndex() in this funcition, stack may overflow __syntax__ <verbatim>function Map3DSystem.UI.CCS.Main2.OnChangeCCSTab(i)</verbatim> __parameters__ | *i* | | ---++++ !Map3DSystem.UI.CCS.Main2.SetFaceType set the current player face type * _param_ __bCartoonFace__ : true to cartoon face, false to normal face __syntax__ <verbatim>function Map3DSystem.UI.CCS.Main2.SetFaceType(bCartoonFace)</verbatim> __parameters__ | *bCartoonFace* | true to cartoon face, false to normal face | ---++++ !Map3DSystem.UI.CCS.Main2.ChangeToCCSTab change to the target panel according to the index __syntax__ <verbatim>function Map3DSystem.UI.CCS.Main2.ChangeToCCSTab(i)</verbatim> __parameters__ | *i* | | ---++ CCS modify panel | *Title* | CCS modify panel | | *Author(s)* | WangTian | | *Date* | 2008/6/5 | | *File* | script/kids/3DMapSystemUI/CCS/Modify.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/CCS/Modify.lua"); Map3DSystem.UI.CCS.Modify.ShowMainWnd(true); Map3DSystem.UI.CCS.Modify.UpdatePanelUI(); </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.UI.CCS.Modify.ShowMainWnd Show the Sky main window __syntax__ <verbatim>function Map3DSystem.UI.CCS.Modify.ShowMainWnd(bShow)</verbatim> __parameters__ | *bShow* | | ---++++ !Map3DSystem.UI.CCS.Modify.MSGProc Message Processor of CCS main control On receive WM_SIZE message it will update the CreationTabGrid control __syntax__ <verbatim>function Map3DSystem.UI.CCS.Modify.MSGProc(window, msg)</verbatim> __parameters__ | *window* | | | *msg* | | ---++++ !Map3DSystem.UI.CCS.Modify.Show show the CCS in the parent window * _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_ __parentWindow__ : parent os window object, parent window for sending messages __syntax__ <verbatim>function Map3DSystem.UI.CCS.Modify.Show(bShow, _parent, parentWindow)</verbatim> __parameters__ | *bShow* | boolean to show or hide. if nil, it will toggle current setting. | | *parent* | | | *parentWindow* | parent os window object, parent window for sending messages | ---++++ !Map3DSystem.UI.CCS.Modify.UpdatePanelUI update the toggle face hair style and color magnify and minify __syntax__ <verbatim>function Map3DSystem.UI.CCS.Modify.UpdatePanelUI()</verbatim> ---++++ !Map3DSystem.UI.CCS.Modify.OnSwitchToObject Take control of the currently selected character. __syntax__ <verbatim>function Map3DSystem.UI.CCS.Modify.OnSwitchToObject()</verbatim> ---++ character customization UI plug-in for 3D Map System | *Title* | character customization UI plug-in for 3D Map System | | *Author(s)* | WangTian | | *Date* | 2007/10/29 | | *File* | script/kids/3DMapSystemUI/CCS/Predefined.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/CCS/Predefined.lua"); </verbatim> ---+++ Member Functions ---++++ !Predefined.ResetBaseModel reset the base model, e.g. Predefined.ResetBaseModel("character/v3/Child/", "Male"); Predefined.ResetBaseModel("character/v3/Child/", "Female"); __syntax__ <verbatim>function Predefined.ResetBaseModel(ModelDir, Gender)</verbatim> __parameters__ | *ModelDir* | | | *Gender* | | ---++++ !Predefined.OnChangeBaseModel change the facial info of the current seleceted character __syntax__ <verbatim>function Predefined.OnChangeBaseModel(obj_params, assetfile)</verbatim> __parameters__ | *obj* | | | *params* | | | *assetfile* | | ---++++ !Predefined.ResetBaseModel2 reset the base model, e.g. Predefined.ResetBaseModel("character/v3/Child/", "Male"); Predefined.ResetBaseModel("character/v3/Child/", "Female"); __syntax__ <verbatim>function Predefined.ResetBaseModel2(name, ModelDir, Gender)</verbatim> __parameters__ | *name* | | | *ModelDir* | | | *Gender* | | ---++++ !Predefined.GetFacialInfoString get the facial information string from the obj_param * _param_ __obj__ :_param: object parameter(table) or ParaObject object * _return_ ____ : the facial info string if CCS character or nil if no facial information is found __syntax__ <verbatim>function Predefined.GetFacialInfoString(obj_params)</verbatim> __parameters__ | *obj* | _param: object parameter(table) or ParaObject object | | *params* | | ---++++ !Predefined.ApplyFacialInfoString apply the facial information string to the obj_param object * _param_ __obj__ :_param: object parameter(table) or ParaObject object * _param_ __sInfo__ : ccs information string NOTE: Facial information string is the first section of the full CCS information string __syntax__ <verbatim>function Predefined.ApplyFacialInfoString(obj_params, sInfo)</verbatim> __parameters__ | *obj* | _param: object parameter(table) or ParaObject object | | *params* | | | *sInfo* | | ---++++ !Predefined.OnChangeFacialParam change the facial info of the current seleceted character __syntax__ <verbatim>function Predefined.OnChangeFacialParam(obj_params, skinColor, faceType, hairColor, hairStyle, facialHair)</verbatim> __parameters__ | *obj* | | | *params* | | | *skinColor* | | | *faceType* | | | *hairColor* | | | *hairStyle* | | | *facialHair* | | ---++++ !Predefined.ToggleFace CurrentFaceType == "CartoonFace": cartoon face CurrentFaceType == "CharacterFace": character face Predefined.CurrentFaceType = "CharacterFace"; __syntax__ <verbatim>function Predefined.ToggleFace()</verbatim> ---++++ !Predefined.ShowNextShirt itemid: it can be nil to iterate through all available ones in the database __syntax__ <verbatim>function Predefined.ShowNextShirt(itemid)</verbatim> __parameters__ | *itemid* | | ---++++ !Predefined.ShowNextHandSlot IsleftHand: nil if right hand, otherwise left one itemid: it can be nil to iterate through all available ones in the database __syntax__ <verbatim>function Predefined.ShowNextHandSlot(IsleftHand, itemid)</verbatim> __parameters__ | *IsleftHand* | | | *itemid* | | ---++++ !Predefined.ShowNextCape itemid: it can be nil to iterate through all available ones in the database __syntax__ <verbatim>function Predefined.ShowNextCape(itemid)</verbatim> __parameters__ | *itemid* | | ---++++ !Predefined.ShowNextHeadAtt itemid: it can be nil to iterate through all available ones in the database __syntax__ <verbatim>function Predefined.ShowNextHeadAtt(itemid)</verbatim> __parameters__ | *itemid* | | ---++++ !Predefined.ShowNextShoulderAtt itemid: it can be nil to iterate through all available ones in the database __syntax__ <verbatim>function Predefined.ShowNextShoulderAtt(itemid)</verbatim> __parameters__ | *itemid* | | %STOPINCLUDE%
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2008-02-29
-
LiXizhi
Home
Site map
CCWeb web
HaqiTeen web
Main web
ParaEngine web
TWiki web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
导航页WebTopMenu
Preferences
开发指南
Getting Started
ParacraftSDK
NPL
MCML
NPL Reference Manual
美术Mod
Account
Log In
English
简体中文
簡體中文
E
dit
A
ttach
Copyright © 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