.
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
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
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
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
syntax
function CartoonFace.Show(parent)
parameters
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
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
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
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
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
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
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", 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"},
}
;
datasource function for pe:gridview
syntax
function CharSelectionPage.DS_Avatar_Func(index)
parameters
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
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
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
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
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
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
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
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
syntax
function Map3DSystem.UI.CCS.DefaultAppearance.MountDefaultAppearance(obj)
parameters
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
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/CCS/Inventory.lua");
Member Functions
Inventory.Show
create, init and display the head inventory UI control
syntax
function Inventory.Show(parent)
parameters
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
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
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
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
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
CCS.OnClickCartoonFaceComponent
change the cartoon face component category
- param index : the index into the CartoonFace category table
syntax
function CCS.OnClickCartoonFaceComponent(index)
parameters
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
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 |
boolean to show or hide. if nil, it will toggle current setting. |
CCS.ShowInventory
Color Palette
_this = 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 = 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
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
function CCS.ShowInventory(bShow)
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
function CCS.OnClickInventoryReturn()
CCS.UpdateCharacterInfo
function PleaseSelectRaceOrGender()
--local obj = GetCurrentObj();
--headon_speech.Speek(obj.name, "璇烽€夋嫨绉嶆棌鍜屾€у埆,鐪嬬湅鏈変粈涔堝弽搴?-)", 2);
end
update the character information including gender and race
syntax
function CCS.UpdateCharacterInfo(from)
parameters
CCS.ShowUIInterface
show a given UI in the Interface container and remove the old one
e.g. ShowUIInterface(CCS_UI_Predefined);
syntax
function CCS.ShowUIInterface(componentName)
parameters
CCS.OnDestroy
destroy the control
syntax
function CCS.OnDestroy()
CCS.OnClickFaceComponent
OnClick face component matrix
syntax
function CCS.OnClickFaceComponent()
CCS.OnClickHeadInventory
OnClick item inventory matrix
syntax
function CCS.OnClickHeadInventory()
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
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/CCS/Main2.lua");
Member Functions
Map3DSystem.UI.CCS.Main2.ShowMainWnd
Show the CCS main window
syntax
function Map3DSystem.UI.CCS.Main2.ShowMainWnd(bShow)
parameters
Map3DSystem.UI.CCS.Main2.DestroyMainWnd
destory the main window, usually called when the world is closed
syntax
function Map3DSystem.UI.CCS.Main2.DestroyMainWnd()
Map3DSystem.UI.CCS.Main2.OnSize
change the main window size, usually called on resolution change
syntax
function Map3DSystem.UI.CCS.Main2.OnSize(width, height)
parameters
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
function Map3DSystem.UI.CCS.Main2.MSGProc(window, msg)
parameters
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
function Map3DSystem.UI.CCS.Main2.Show(bShow, _parent, parentWindow)
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
function Map3DSystem.UI.CCS.Main2.OnChangeCCSTab(i)
parameters
Map3DSystem.UI.CCS.Main2.SetFaceType
set the current player face type
- param bCartoonFace : true to cartoon face, false to normal face
syntax
function Map3DSystem.UI.CCS.Main2.SetFaceType(bCartoonFace)
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
function Map3DSystem.UI.CCS.Main2.ChangeToCCSTab(i)
parameters
CCS modify panel
Title |
CCS modify panel |
Author(s) |
WangTian |
Date |
2008/6/5 |
File |
script/kids/3DMapSystemUI/CCS/Modify.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/CCS/Modify.lua");
Map3DSystem.UI.CCS.Modify.ShowMainWnd(true);
Map3DSystem.UI.CCS.Modify.UpdatePanelUI();
Member Functions
Map3DSystem.UI.CCS.Modify.ShowMainWnd
Show the Sky main window
syntax
function Map3DSystem.UI.CCS.Modify.ShowMainWnd(bShow)
parameters
Map3DSystem.UI.CCS.Modify.MSGProc
Message Processor of CCS main control
On receive WM_SIZE message it will update the CreationTabGrid control
syntax
function Map3DSystem.UI.CCS.Modify.MSGProc(window, msg)
parameters
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
function Map3DSystem.UI.CCS.Modify.Show(bShow, _parent, parentWindow)
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
function Map3DSystem.UI.CCS.Modify.UpdatePanelUI()
Map3DSystem.UI.CCS.Modify.OnSwitchToObject
Take control of the currently selected character.
syntax
function Map3DSystem.UI.CCS.Modify.OnSwitchToObject()
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
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/CCS/Predefined.lua");
Member Functions
Predefined.ResetBaseModel
reset the base model, e.g.
ResetBaseModel("character/v3/Child/", "Male");
ResetBaseModel("character/v3/Child/", "Female");
syntax
function Predefined.ResetBaseModel(ModelDir, Gender)
parameters
Predefined.OnChangeBaseModel
change the facial info of the current seleceted character
syntax
function Predefined.OnChangeBaseModel(obj_params, assetfile)
parameters
Predefined.ResetBaseModel2
reset the base model, e.g.
ResetBaseModel("character/v3/Child/", "Male");
ResetBaseModel("character/v3/Child/", "Female");
syntax
function Predefined.ResetBaseModel2(name, ModelDir, Gender)
parameters
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
function Predefined.GetFacialInfoString(obj_params)
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
function Predefined.ApplyFacialInfoString(obj_params, sInfo)
parameters
obj |
_param: object parameter(table) or ParaObject object |
params |
|
sInfo |
|
Predefined.OnChangeFacialParam
change the facial info of the current seleceted character
syntax
function Predefined.OnChangeFacialParam(obj_params, skinColor, faceType, hairColor, hairStyle, facialHair)
parameters
obj |
|
params |
|
skinColor |
|
faceType |
|
hairColor |
|
hairStyle |
|
facialHair |
|
Predefined.ToggleFace
CurrentFaceType == "CartoonFace": cartoon face
CurrentFaceType == "CharacterFace": character face
CurrentFaceType = "CharacterFace";
syntax
function Predefined.ToggleFace()
Predefined.ShowNextShirt
itemid: it can be nil to iterate through all available ones in the database
syntax
function Predefined.ShowNextShirt(itemid)
parameters
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
function Predefined.ShowNextHandSlot(IsleftHand, itemid)
parameters
Predefined.ShowNextCape
itemid: it can be nil to iterate through all available ones in the database
syntax
function Predefined.ShowNextCape(itemid)
parameters
Predefined.ShowNextHeadAtt
itemid: it can be nil to iterate through all available ones in the database
syntax
function Predefined.ShowNextHeadAtt(itemid)
parameters
Predefined.ShowNextShoulderAtt
itemid: it can be nil to iterate through all available ones in the database
syntax
function Predefined.ShowNextShoulderAtt(itemid)
parameters