PEDN> Main Web>DeveloperSite > OfficialApps>CCSAppDev (2008-02-29, LiXizhi) Change language en zh-cn? EditAttach

CCSAppDev

description: 编辑人物的种族、相貌、衣着和道具,以及玩家的化身(avatar)管理.

Contents:

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.
   -- ShortCutIndex is the index of the animation, usually 1-9. 
   Map3DSystem.App.Commands.Call("Profile.CCS.AnimationPage", {ShortCutIndex = keyNumber})

character facing target

set the facing of the character to the target
   Map3DSystem.App.CCS.CharacterFaceTarget(ParaScene.GetPlayer(), x,y,z);
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);

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/CCS/app_main.lua");

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

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

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

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

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

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

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

function Map3DSystem.App.CCS.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.CCS.CharacterFaceCamera

  • param let : the object to face camera.

syntax

function Map3DSystem.App.CCS.CharacterFaceCamera(obj)

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

function Map3DSystem.App.CCS.CharacterFaceTarget(obj, cx,cy,cz)

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

function Map3DSystem.App.CCS.OnRenderBox(mcmlData)

parameters

mcmlData  

Map3DSystem.App.CCS.Navigate

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

syntax

function Map3DSystem.App.CCS.Navigate()

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

function Map3DSystem.App.CCS.GotoHomepage()

Map3DSystem.App.CCS.DoQuickAction

called when user clicks the quick action for this application.

syntax

function Map3DSystem.App.CCS.DoQuickAction()

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

function Map3DSystem.App.CCS.OnWorldLoad()

Map3DSystem.App.CCS.OnWorldClosed

called whenever a world is being closed.

syntax

function Map3DSystem.App.CCS.OnWorldClosed()

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

function Map3DSystem.App.CCS.MSGProc(window, msg)

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.

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/CCS/AnimationPage.lua");
Map3DSystem.App.CCS.AnimationPage.PlayAnimByIndex(index)
Map3DSystem.App.CCS.AnimationPage.PlayAnimFile(filepath)

Member Functions

AnimationPage.DS_Anims_Func

 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"},
}
;

datasource function for pe:gridview

syntax

function AnimationPage.DS_Anims_Func(index)

parameters

index  

AnimationPage.OnInit

init

syntax

function AnimationPage.OnInit()

AnimationPage.PlayAnimFile


common anim tab

clicks the common animation file

  • return __ : true if played.

syntax

function AnimationPage.PlayAnimFile(filepath)

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 CommonAnims?
  • return __ : true if played.

syntax

function AnimationPage.PlayAnimByIndex(index)

parameters

index [1,9]. upper limit is the size of CommonAnims?

AnimationPage.OnSelectFolder


from file tab
User clicks a file

syntax

function AnimationPage.OnSelectFolder(name, folderPath)

parameters

name  
folderPath  

AnimationPage.OnSelectAnimFile

User clicks a file

syntax

function AnimationPage.OnSelectAnimFile(name, filepath)

parameters

name  
filepath  

AnimationPage.OnDoubleClickAnimFile

user double clicks a file, it will select it and add it to scene.

syntax

function AnimationPage.OnDoubleClickAnimFile(name, filepath)

parameters

name  
filepath  

AnimationPage.OnClickPlayAnimFile

play animation file.

syntax

function AnimationPage.OnClickPlayAnimFile()

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

function AnimationPage.SaveOpenAnimFileRecord(filepath)

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) , a list of avaible avatars in the middle(using TreeView) , and a brief description of the selected avatar .

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/CCS/AvatarRegPage.lua");
Map3DSystem.App.CCS.AvatarRegPage:Create("CCS.AvatarRegPage", parent, "_fi", 0,0,0,0);

Member Functions

AvatarRegPage.DS_Avatar_Func

 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"},
}
;

datasource function for pe:gridview

syntax

function AvatarRegPage.DS_Avatar_Func(index)

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 OnFinishedFunc? = nil;

take screen shot of the character pe:avatar.

syntax

function AvatarRegPage.TakeAvatarSnapshot()

AvatarRegPage.UpdateAvatar

User select a character in the gridview list, change the 3d display in pe:avatar window

syntax

function AvatarRegPage.UpdateAvatar(index)

parameters

index  

AvatarRegPage.OnAccept

Accept the current preview avatar and save to CCSApp profile

syntax

function AvatarRegPage.OnAccept(btnName, values, bindingContext)

parameters

btnName  
values  
bindingContext  

AvatarRegPage.OnSkip

Skip the avatar registration page

syntax

function AvatarRegPage.OnSkip(btnName, values, bindingContext)

parameters

btnName  
values  
bindingContext  

AvatarRegPage:Leave

just exit to call back.

syntax

function AvatarRegPage:Leave()

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

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/CCS/CartoonFace.lua");
local CartoonFace = Map3DSystem.UI.CCS.CartoonFace;

Member Functions

CartoonFace.Show

create, init and display the cartoon face UI control

  • param parent : ParaUIObject? which is the parent container

syntax

function CartoonFace.Show(parent)

parameters

parent ParaUIObject? which is the parent container

CartoonFace.OnDestroy

destroy the control

syntax

function CartoonFace.OnDestroy()

CartoonFace.PageLeft

Page Left

syntax

function CartoonFace.PageLeft()

CartoonFace.PageRight

Page Right

syntax

function CartoonFace.PageRight()

CartoonFace.GetDirectory

get the face directory according to current face component section

syntax

function CartoonFace.GetDirectory()

CartoonFace.ResetFaceComponent

reset face component section

syntax

function CartoonFace.ResetFaceComponent()

CartoonFace.OnIconMatrixClick

click on cartoon face icon matrix set the cartoon face component according to the click

syntax

function CartoonFace.OnIconMatrixClick(x, y)

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

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/CCS/CartoonFaceComponent.lua");

Member Functions

CartoonFaceComponent.SetFaceSection

  • param section : set the current section of the face component

syntax

function CartoonFaceComponent.SetFaceSection(Section)

parameters

Section  

CartoonFaceComponent.GetFaceComponentSection

get the current section of the face component

syntax

function CartoonFaceComponent.GetFaceComponentSection()

CartoonFaceComponent.SetFaceComponent

Function: set the face component parameters for the specific section

syntax

function CartoonFaceComponent.SetFaceComponent(SubType, value, donot_refresh)

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

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/CCS/ccs.lua");

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

function Map3DSystem.UI.CCS.GetCCSInfoString(obj_params)

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

function Map3DSystem.UI.CCS.ApplyCCSInfoString(obj_params, sInfo)

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

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/CCS/CharSavePage.lua");

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

function CharSavePage.OnInit()

CharSavePage.TakeAvatarSnapshot

take screen shot of the character pe:avatar.

syntax

function CharSavePage.TakeAvatarSnapshot()

CharSavePage.OnRefreshAvatar

load the current player to canvas

syntax

function CharSavePage.OnRefreshAvatar()

CharSavePage.OnClickSave

save the user avatar information

syntax

function CharSavePage.OnClickSave()

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

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/CCS/CharSelectionPage.lua");

Member Functions

CharSelectionPage.DS_Avatar_Func

 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", 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"},
}
;

datasource function for pe:gridview

syntax

function CharSelectionPage.DS_Avatar_Func(index)

parameters

index  

CharSelectionPage.TakeAvatarSnapshot

take screen shot of the character pe:avatar.

syntax

function CharSelectionPage.TakeAvatarSnapshot()

CharSelectionPage.UpdateChar

User select a character in the gridview list, change the 3d display in pe:avatar window

syntax

function CharSelectionPage.UpdateChar(index)

parameters

index  

CharSelectionPage.OnAccept

Accept the current preview avatar and save to CCSApp profile

syntax

function CharSelectionPage.OnAccept(btnName, values, bindingContext)

parameters

btnName  
values  
bindingContext  

CharSelectionPage:Leave

just exit to call back.

syntax

function CharSelectionPage:Leave()

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

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/CCS/DB.lua");
local DB = Map3DSystem.UI.CCS.DB

Member Functions

DB.InitBodyParamIDSet


common control library NPL.load("(gl)script/sqlite/sqlite3.lua");

local DB = {} commonlib.setfield("Map3DSystem.UI.CCS.DB", DB)

BodyParamIDSet? = {};

DB.dbfile = "Database/characters.db"; ModelDir? = "character/v3/Child/"; DB.Gender= "Male"; ItemObjectPath? = "character/v3/Item/ObjectComponents/"; ItemTexturePath? = "character/v3/Item/TextureComponents/"; ItemIdLists? = {}; ItemIdSlotLists? = {}; FaceStyleLists? = {}; FaceIconLists? = {}; FaceStyleIterators? = {};

CurrentCharacterInfo? = {};

the following are calculated ModelName? = "Child"; 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

function DB.InitBodyParamIDSet()

DB.ResetBaseModel

reset the base model

syntax

function DB.ResetBaseModel(ModelDir, Gender)

parameters

ModelDir  
Gender  

DB.GetPlayerChar

e.g. local player, playerChar = GetPlayerChar? ();

syntax

function DB.GetPlayerChar()

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

function DB.GetItemIdListByType(type)

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

function DB.GetItemIdListBySlotType(type)

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

function DB.GetFaceComponentStyleList(nComponentID)

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

function DB.GetFaceComponentIconList(nComponentID)

parameters

nComponentID such as DB.CFS_FACE

DB.SetFaceComponent

set the face component parameters e.g. 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

function DB.SetFaceComponent(nComponentID, SubType, value)

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

function DB.GetCartoonfaceInfoString(obj_params)

parameters

obj _param: object parameter(table) or ParaObject? object
params  

DB.OnChangeCartoonFace

change the cartoon face info of the current seleceted character

syntax

function DB.OnChangeCartoonFace(obj_params, nComponentID, SubType, value)

parameters

obj  
params  
nComponentID  
SubType  
value  

DB.ResetFaceComponent

reset the given face component to default value

syntax

function DB.ResetFaceComponent(nComponentID)

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

function DB.AutoGenerateItems()

DB.GetInventoryDB2

get the inventory information according to tabgrid

syntax

function DB.GetInventoryDB2()

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

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/CCS/DefaultAppearance.lua");

Member Functions

Map3DSystem.UI.CCS.DefaultAppearance.MountDefaultAppearance

mount a nude CCS character with default appearance

  • param obj : ParaObject? object

syntax

function Map3DSystem.UI.CCS.DefaultAppearance.MountDefaultAppearance(obj)

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

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/CCS/Inventory.lua");

Member Functions

Inventory.Show

create, init and display the head inventory UI control

  • param parent : ParaUIObject? which is the parent container

syntax

function Inventory.Show(parent)

parameters

parent ParaUIObject? which is the parent container

Inventory.OnDestroy

destroy the control

syntax

function Inventory.OnDestroy()

Inventory.PageLeft

Page Left

syntax

function Inventory.PageLeft()

Inventory.PageRight

Page Right

syntax

function Inventory.PageRight()

Inventory.RefreshMatrix3D

Page Left

syntax

function Inventory.RefreshMatrix3D()

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

function Inventory.GetCharacterSlotInfoString(obj_params)

parameters

obj _param: object parameter(table) or ParaObject? object
params  

Inventory.OnChangeCharacterSlot

change the CCS character slot info of the current seleceted character

syntax

function Inventory.OnChangeCharacterSlot(obj_params, nComponent, index)

parameters

obj  
params  
nComponent  
index  

Inventory.OnClickIconMatrix

icon matrix onclick function: mount the item to character slot

syntax

function Inventory.OnClickIconMatrix(x, y)

parameters

x  
y  

Inventory.OnClickUnmountCurrentCharacterSlot

unmount the item according to current character slot on the current seleceted character

syntax

function Inventory.OnClickUnmountCurrentCharacterSlot()

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

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/CCS/InventorySlot.lua");
local InventorySlot = Map3DSystem.UI.CCS.InventorySlot

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

function InventorySlot.SetInventorySlot(Section)

parameters

Section  

InventorySlot.GetInventorySlot

get the current item slot of the inventory

syntax

function InventorySlot.GetInventorySlot()

InventorySlot.MountInventorySlot

Function: set the inventory slot parameters for the specific item slot

syntax

function InventorySlot.MountInventorySlot(SubType, value, donot_refresh)

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

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/CCS/Main.lua");

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

function CCS.ShowAuraCCSInterface(bShow, parent, wnd)

parameters

bShow  
parent  
wnd  

CCS.OnClickCartoonFaceComponent

change the cartoon face component category

  • param index : the index into the CartoonFace? category table

syntax

function CCS.OnClickCartoonFaceComponent(index)

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

function CCS.InitMessageSystem()

CCS.SendMeMessage

send a message to CCS:CCSMain window handler e.g. SendMeMessage? ({type = Map3DSystem? .msg.MAINBAR_Show})

syntax

function CCS.SendMeMessage(msg)

parameters

msg  

CCS.MSGProc

CCS: CCSMain window handler

syntax

function CCS.MSGProc()

CCS.ShowCartoonFace

Function: show cartoon face control

  • param bShow : boolean to show or hide. if nil, it will toggle current setting.

syntax

function CCS.ShowCartoonFace(bShow)

parameters

bShow