---++!! !AssetsAppDev __description__: 鐢ㄦ埛鍙互涓婁紶鍜屼娇鐢ㄥ浘鐗囩浉鍐屻€?D妯″瀷锛屽苟鍜屾湅鍙嬪叡浜€傜敤鎴峰彲浠ュ皢鍥剧墖鍜?D妯″瀷鏈夐€夋嫨鐨勫姞鍏ュ埌鑷繁鐨勫垱浣滃伐鍏锋爮涓紝鍦?D涓栫晫涓娇鐢ㄣ€傚簲鐢ㄧ▼搴忓紑鍙戣€呬篃鍙互灏嗚祫婧愬彂甯冨埌鑷繁鐨勫簲鐢ㄧ▼搴忛椤碉紝鎺ㄨ崘缁欏簲鐢ㄧ▼搴忕殑鐢ㄦ埛銆 %TOC{title="Contents:"}% %STARTINCLUDE% ---++ Assets app for Paraworld | *Title* | Assets app for Paraworld | | *Author(s)* | LiXizhi | | *Date* | 2008/1/31 | | *File* | script/kids/3DMapSystemApp/Assets/app_main.lua | ---+++ Description db registration insert script INSERT INTO apps VALUES (NULL, 'Assets_GUID', 'Assets', '1.0.0', 'http://www.paraengine.com/apps/Assets_v1.zip', 'YourCompany', 'enUS', 'script/kids/3DMapSystemApp/Assets/IP.xml', '', 'script/kids/3DMapSystemApp/Assets/app_main.lua', 'Map3DSystem.App.Assets.MSGProc', 1); %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Assets/app_main.lua"); </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.App.Assets.OnConnection requires create class commonlib.setfield("Map3DSystem.App.Assets", {}); ------------------------------------------- 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.Assets.OnConnection(app, connectMode)</verbatim> __parameters__ | *app* | the object representing the current application in the IDE. | | *connectMode* | | ---++++ !Map3DSystem.App.Assets.OnDisconnection Receives notification that the Add-in is being unloaded. __syntax__ <verbatim>function Map3DSystem.App.Assets.OnDisconnection(app, disconnectMode)</verbatim> __parameters__ | *app* | | | *disconnectMode* | | ---++++ !Map3DSystem.App.Assets.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.Assets.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.Assets.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.Assets.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.Assets.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.Assets.OnRenderBox(mcmlData)</verbatim> __parameters__ | *mcmlData* | | ---++++ !Map3DSystem.App.Assets.Navigate called when the user wants to nagivate to the 3D world location relavent to this application __syntax__ <verbatim>function Map3DSystem.App.Assets.Navigate()</verbatim> ---++++ !Map3DSystem.App.Assets.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.Assets.GotoHomepage()</verbatim> ---++++ !Map3DSystem.App.Assets.DoQuickAction called when user clicks the quick action for this application. __syntax__ <verbatim>function Map3DSystem.App.Assets.DoQuickAction()</verbatim> ---++++ !Map3DSystem.App.Assets.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.Assets.MSGProc(window, msg)</verbatim> __parameters__ | *window* | | | *msg* | | ---++ asset definition for asset, folder, package | *Title* | asset definition for asset, folder, package | | *Author(s)* | LiXizhi | | *Date* | 2008/1/31 | | *File* | script/kids/3DMapSystemApp/Assets/AssetData.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Assets/AssetData.lua"); -- only included in asset manager </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.App.Assets.asset:new <verbatim> common control library NPL.load("(gl)script/ide/common_control.lua"); ---- requires its Map3DSystem.UI.Creation.GetObjParamsFromAsset NPL.load("(gl)script/kids/3DMapSystemUI/InGame/Creation.lua"); requires its Map3DSystem.UI.Creator.GetObjParamsFromAsset NPL.load("(gl)script/kids/3DMapSystemUI/Creator/Main.lua"); Map3DSystem.App.Assets.AssetStatus = { -- only a local copy of the asset Local = nil, -- a remote reference of the asset. The asset is not found in local disk Remote = 1, -- local and remote copy are identical Sync = 2, -- there is a difference between local copy and remote copy. Either overwrite from remote or update to remote. Diff = 3, }; a mapping from predefined category prefix to category text. Map3DSystem.App.Assets.CategoryMap = { ["Creations.BCS.doors"] = "鍒涘缓.寤虹瓚閮ㄤ欢.闂?, ["Creations.NormalModels.trees"] = "鍒涘缓.妯″瀷.鏍?, -- TODO: add more here: this should be the same as in the main bar } -------------------------------------- an asset template -------------------------------------- Map3DSystem.App.Assets.asset = { -- model or texture relative-to-root file path, this is the only required field. filename = nil, -- text to be displayed. if nil, default to ParaIO.GetFileName(filename) text = nil, -- default to "<filepath>.png", if filepath is not an image file. icon = nil, Price = nil, Reserved1 = nil, Reserved2 = nil, Reserved3 = nil, Reserved4 = nil, }</verbatim>; create a new asset. the asset's filename must not be nil. __syntax__ <verbatim>function Map3DSystem.App.Assets.asset:new(o)</verbatim> __parameters__ | *o* | | ---++++ !Map3DSystem.App.Assets.asset:ToItem convert this asset to the item format. item format is the internal format used by the Creator integration point. __syntax__ <verbatim>function Map3DSystem.App.Assets.asset:ToItem() </verbatim> ---++++ !Map3DSystem.App.Assets.asset:getModelParams it will return the objParams if it is a model or character asset, otherwise it will return nil. __syntax__ <verbatim>function Map3DSystem.App.Assets.asset:getModelParams() </verbatim> ---++++ !Map3DSystem.App.Assets.asset:getImageFile it will return the image file name if it is a texture asset, otherwise it will return nil. __syntax__ <verbatim>function Map3DSystem.App.Assets.asset:getImageFile() </verbatim> ---++++ !Map3DSystem.App.Assets.folder:new <verbatim>-------------------------------------- a folder template -------------------------------------- Map3DSystem.App.Assets.folder = { -- working directory of the folder. this is the only required field. it should ends with / filename = nil, -- a string or an array of strings. each one is a file extension. fileExt = {"*.x", "*.xml", "*.png", "*.jpg",}, }</verbatim>; create a new asset. the asset's filename must not be nil. __syntax__ <verbatim>function Map3DSystem.App.Assets.folder:new(o)</verbatim> __parameters__ | *o* | | ---++++ !Map3DSystem.App.Assets.Package:new create a new Package __syntax__ <verbatim>function Map3DSystem.App.Assets.Package:new(o)</verbatim> __parameters__ | *o* | | ---++++ !Map3DSystem.App.Assets.Package:ClearAll clear all objects __syntax__ <verbatim>function Map3DSystem.App.Assets.Package:ClearAll()</verbatim> ---++++ !Map3DSystem.App.Assets.Package:AddAsset add a new asset to the asset list. if the asset.filename already exist, it will update the existing one. return the asset and its index in the package __syntax__ <verbatim>function Map3DSystem.App.Assets.Package:AddAsset(asset)</verbatim> __parameters__ | *asset* | | ---++++ !Map3DSystem.App.Assets.Package:RemoveAsset remove an asset from the package by a given asset filename __syntax__ <verbatim>function Map3DSystem.App.Assets.Package:RemoveAsset(filename)</verbatim> __parameters__ | *filename* | | ---++++ !Map3DSystem.App.Assets.Package:GetAsset get an asset from the package by a given asset filename return the asset and its index in the package. return nil,nil if not found. __syntax__ <verbatim>function Map3DSystem.App.Assets.Package:GetAsset(filename)</verbatim> __parameters__ | *filename* | | ---++++ !Map3DSystem.App.Assets.Package:AddFolder add a new folder to the folder list. if the folder.filename already exist, it will update the existing one. return the folder and its index in the package __syntax__ <verbatim>function Map3DSystem.App.Assets.Package:AddFolder(folder)</verbatim> __parameters__ | *folder* | | ---++++ !Map3DSystem.App.Assets.Package:RemoveFolder remove an folder from the package by a given folder filename __syntax__ <verbatim>function Map3DSystem.App.Assets.Package:RemoveFolder(filename)</verbatim> __parameters__ | *filename* | | ---++++ !Map3DSystem.App.Assets.Package:GetFolder get an folder from the package by a given folder filename return the folder and its index in the package. return nil,nil if not found. __syntax__ <verbatim>function Map3DSystem.App.Assets.Package:GetFolder(filename)</verbatim> __parameters__ | *filename* | | ---++ Advanced asset manager window | *Title* | Advanced asset manager window | | *Author(s)* | LiXizhi | | *Date* | 2008/1/31 | | *File* | script/kids/3DMapSystemApp/Assets/AssetManager.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Assets/AssetManager.lua"); Map3DSystem.App.Assets.ShowAssetManager(_app) </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.App.Assets.AddPackage common control library NPL.load("(gl)script/ide/common_control.lua"); commonlib.setfield("Map3DSystem.App.Assets.AssetManager", {}); NPL.load("(gl)script/kids/3DMapSystemApp/Assets/AssetData.lua"); NPL.load("(gl)script/kids/3DMapSystemApp/Assets/AssetProvider.lua"); a list of packages to be displayed by the current asset manager window Map3DSystem.App.Assets.AssetManager.Packages = {}; the currently selected package Map3DSystem.App.Assets.AssetManager.CurPak = nil; add package to the package list. It does not update UI. __syntax__ <verbatim>function Map3DSystem.App.Assets.AddPackage(package)</verbatim> __parameters__ | *package* | | ---++++ !Map3DSystem.App.Assets.ShowAssetManager ----------------------------------------------------------------- UI stuffs ----------------------------------------------------------------- display the package window. __syntax__ <verbatim>function Map3DSystem.App.Assets.ShowAssetManager(_app)</verbatim> __parameters__ | *app* | | ---++++ !Map3DSystem.App.Assets.AssetManager.Show * _param_ __bShow__ : boolean to show or hide. if nil, it will toggle current setting. * _param_ ____ :_parent: parent window inside which the content is displayed. it can be nil. __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.Show(bShow, _parent, parentWindow)</verbatim> __parameters__ | *bShow* | boolean to show or hide. if nil, it will toggle current setting. | | *parent* | | | *parentWindow* | | ---++++ !Map3DSystem.App.Assets.AssetManager.DrawAssetsNodeHandler owner draw function to treeViewAssetsNodeList __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.DrawAssetsNodeHandler(_parent, treeNode)</verbatim> __parameters__ | *parent* | | | *treeNode* | | ---++++ !Map3DSystem.App.Assets.AssetManager.OnDestroy destory the control __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.OnDestroy()</verbatim> ---++++ !Map3DSystem.App.Assets.AssetManager.UpdateComboBoxSelectPkg --------------------------------------------------------------- update UI functions --------------------------------------------------------------- update the select package combo box __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.UpdateComboBoxSelectPkg()</verbatim> ---++++ !Map3DSystem.App.Assets.AssetManager.RebuildAssetsTreeView private: rebuild the package tree view according to the current package 's assets __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.RebuildAssetsTreeView()</verbatim> ---++++ !Map3DSystem.App.Assets.SelectPackage --------------------------------------------------------------- methods --------------------------------------------------------------- select a package as the current package and display its AssetManager. when a package is (de)selected, it will (un)hook object creation events. * _param_ __package__ : the package object to be selected. if nil, nothing will be selected. __syntax__ <verbatim>function Map3DSystem.App.Assets.SelectPackage(package)</verbatim> __parameters__ | *package* | the package object to be selected. if nil, nothing will be selected. | ---++++ !Map3DSystem.App.Assets.AssetManager.OnClickCreatePackage ------------------------------------------------------- tree view event handlers ------------------------------------------------------- user clicked to create a new package __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.OnClickCreatePackage()</verbatim> ---++++ !Map3DSystem.App.Assets.AssetManager.OnSelectPackage user clicked to display a given package __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.OnSelectPackage(sCtrlName, item)</verbatim> __parameters__ | *sCtrlName* | | | *item* | | ---++++ !Map3DSystem.App.Assets.AssetManager.AddNewAsset user clicks to add a new asset to the current package __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.AddNewAsset()</verbatim> ---++++ !Map3DSystem.App.Assets.AssetManager.AddNewFolder user clicks to add a new folder. __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.AddNewFolder()</verbatim> ---++++ !Map3DSystem.App.Assets.AssetManager.OnClickAssetsNode user clicked to edit or show an asset node. __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.OnClickAssetsNode(treeNode)</verbatim> __parameters__ | *treeNode* | | ---++++ !Map3DSystem.App.Assets.AssetManager.OnClickDeleteAssetNode user clicks to delete an asset node __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.OnClickDeleteAssetNode(sCtrlName, nodePath)</verbatim> __parameters__ | *sCtrlName* | | | *nodePath* | | ---++++ !Map3DSystem.App.Assets.AssetManager.OnClickRefreshAssetNode user clicks to refresh an asset node __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.OnClickRefreshAssetNode(sCtrlName, nodePath)</verbatim> __parameters__ | *sCtrlName* | | | *nodePath* | | ---++++ !Map3DSystem.App.Assets.AssetManager.OnClickDeleteFolderNode user clicks to delete an asset node __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.OnClickDeleteFolderNode(sCtrlName, nodePath)</verbatim> __parameters__ | *sCtrlName* | | | *nodePath* | | ---++++ !Map3DSystem.App.Assets.AssetManager.OnClickRefreshFolderNode user clicks to refresh a folder or directory node * _param_ __bDoNotUpdate__ : if true ctl:Update() is not called. __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.OnClickRefreshFolderNode(sCtrlName, nodePath, bDoNotUpdate)</verbatim> __parameters__ | *sCtrlName* | | | *nodePath* | | | *bDoNotUpdate* | if true ctl:Update() is not called. | ---++++ !Map3DSystem.App.Assets.AssetManager.RefreshFolderNode refresh a given folder or directory node. * _param_ __bRefreshChild__ : whether to refresh child node. return true if refreshed __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.RefreshFolderNode(node, bRefreshChild)</verbatim> __parameters__ | *node* | | | *bRefreshChild* | whether to refresh child node. return true if refreshed | ---++++ !Map3DSystem.App.Assets.AssetManager.OnClickFullExpandFolderNode refresh all child nodes. __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.OnClickFullExpandFolderNode(sCtrlName, nodePath)</verbatim> __parameters__ | *sCtrlName* | | | *nodePath* | | ---++++ !Map3DSystem.App.Assets.AssetManager.OnClickToggleFolderNode toggle display. it will refresh node on nodes that does not have children. so that folder hierachy is dynamically built with user interactions. __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.OnClickToggleFolderNode(sCtrlName, nodePath)</verbatim> __parameters__ | *sCtrlName* | | | *nodePath* | | ---++++ !Map3DSystem.App.Assets.AssetManager.OnCheckFileNode user checks a file in the folder to include/exclude from the assets __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.OnCheckFileNode(sCtrlName, nodePath)</verbatim> __parameters__ | *sCtrlName* | | | *nodePath* | | ---++++ !Map3DSystem.App.Assets.AssetManager.OnClickEditPackage user clicks to edit the current package __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.OnClickEditPackage()</verbatim> ---++++ !Map3DSystem.App.Assets.AssetManager.OnClickSavePackage user clicks to save the current package save the package to file and optional publish it to app server. __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetManager.OnClickSavePackage()</verbatim> ---++ Providing asset data from file or remote server | *Title* | Providing asset data from file or remote server | | *Author(s)* | LiXizhi | | *Date* | 2008/1/31 | | *File* | script/kids/3DMapSystemApp/Assets/AssetProvider.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Assets/AssetProvider.lua"); -- only included in asset manager </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.App.Assets.CreatePackage common control library NPL.load("(gl)script/ide/common_control.lua"); create a new package. One can later call SelectPackage to select it by UI. * _param_ __package__ : partial class of Map3DSystem.App.Assets.Package. if package is nil, a default one at the current player position will be created. otherwise, the caller can specify where to create the package and how big is the construction site. * _return_ __return__ : the package object created. __syntax__ <verbatim>function Map3DSystem.App.Assets.CreatePackage(package)</verbatim> __parameters__ | *package* | partial class of Map3DSystem.App.Assets.Package. if package is nil, a default one at the current player position will be created. otherwise, the caller can specify where to create the package and how big is the construction site. | ---++++ !Map3DSystem.App.Assets.LoadPackageFromFile load package from file. it returned the package object. it may return nil if failed. __syntax__ <verbatim>function Map3DSystem.App.Assets.LoadPackageFromFile(filename)</verbatim> __parameters__ | *filename* | | ---++++ !Map3DSystem.App.Assets.LoadAllLocalPackages local all local packages in the asset application directory to Map3DSystem.App.Assets.Packages array __syntax__ <verbatim>function Map3DSystem.App.Assets.LoadAllLocalPackages()</verbatim> ---++++ !Map3DSystem.App.Assets.SaveAsLocalPackage save a local package in the asset application directory * _param_ __filename__ : if nil, the package.Category + ".asset" is used as the file name * _return_ __return__ : the filename if succeed, otherwise return nil. __syntax__ <verbatim>function Map3DSystem.App.Assets.SaveAsLocalPackage(package, filename)</verbatim> __parameters__ | *package* | | | *filename* | if nil, the package.Category + ".asset" is used as the file name | ---++ asset view control: For previewing and editing asset properties. it is shown on the right side of asset manager window | *Title* | asset view control: For previewing and editing asset properties. it is shown on the right side of asset manager window | | *Author(s)* | LiXizhi | | *Date* | 2008/1/31 | | *File* | script/kids/3DMapSystemApp/Assets/AssetViewCtl.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Assets/AssetViewCtl.lua"); Map3DSystem.App.Assets.AssetViewCtl.Show(_parent) Map3DSystem.App.Assets.AssetViewCtl.Update(asset) </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.App.Assets.AssetViewCtl.Show the current binding local bindingContext; display the preview control. __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetViewCtl.Show(_parent)</verbatim> __parameters__ | *parent* | | ---++++ !Map3DSystem.App.Assets.AssetViewCtl.Update binding an asset object to the AssetViewCtl __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetViewCtl.Update(asset)</verbatim> __parameters__ | *asset* | | ---++++ !Map3DSystem.App.Assets.AssetViewCtl.OnClickAddToScene ------------------------ event handlers ------------------------ User clicks to add the current object to the scene __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetViewCtl.OnClickAddToScene()</verbatim> ---++++ !Map3DSystem.App.Assets.AssetViewCtl.OnClickSaveThumbNail User clicks to create a thumbnail image for the current asset __syntax__ <verbatim>function Map3DSystem.App.Assets.AssetViewCtl.OnClickSaveThumbNail()</verbatim> ---++ create and edit package dialog. | *Title* | create and edit package dialog. | | *Author(s)* | LiXizhi | | *Date* | 2008/1/31 | | *File* | script/kids/3DMapSystemApp/Assets/DlgPackage.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Assets/DlgPackage.lua"); Map3DSystem.App.Assets.ShowCreatePackageDlg() Map3DSystem.App.Assets.ShowEditPackageDlg(package) </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.App.Assets.ShowCreatePackageDlg current package binding context local bindingContext; show the create package dialog __syntax__ <verbatim>function Map3DSystem.App.Assets.ShowCreatePackageDlg()</verbatim> ---++++ !Map3DSystem.App.Assets.ShowEditPackageDlg show the edit package dialog __syntax__ <verbatim>function Map3DSystem.App.Assets.ShowEditPackageDlg(package)</verbatim> __parameters__ | *package* | | ---++++ !Map3DSystem.App.Assets.CreateEditPackageDlg create the dialog __syntax__ <verbatim>function Map3DSystem.App.Assets.CreateEditPackageDlg(_parent)</verbatim> __parameters__ | *parent* | | ---++ code behind page for ModelBrowserPage.html | *Title* | code behind page for ModelBrowserPage.html | | *Author(s)* | LiXizhi | | *Date* | 2008/4/25 | | *File* | script/kids/3DMapSystemApp/Assets/ModelBrowserPage.lua | ---+++ Description pick an model and add it to scene. %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Assets/ModelBrowserPage.lua"); </verbatim> ---+++ Member Functions ---++++ !ModelBrowserPage.OnInit require to use Map3DSystem.App.Assets.asset NPL.load("(gl)script/kids/3DMapSystemApp/Assets/AssetData.lua"); NPL.load("(gl)script/ide/Encoding.lua"); local ModelBrowserPage = {}; commonlib.setfield("Map3DSystem.App.Assets.ModelBrowserPage", ModelBrowserPage) --------------------------------- page event handlers --------------------------------- first time init page __syntax__ <verbatim>function ModelBrowserPage.OnInit()</verbatim> ---++++ !ModelBrowserPage.OnSelectFile User clicks a file __syntax__ <verbatim>function ModelBrowserPage.OnSelectFile(name, filepath)</verbatim> __parameters__ | *name* | | | *filepath* | | ---++++ !ModelBrowserPage.OnDoubleClickFile user doublle clicks a file, it will select it and add it to scene. __syntax__ <verbatim>function ModelBrowserPage.OnDoubleClickFile(name, filepath)</verbatim> __parameters__ | *name* | | | *filepath* | | ---++++ !ModelBrowserPage.OnSelectFolder user selects a new folder __syntax__ <verbatim>function ModelBrowserPage.OnSelectFolder(name, folderPath)</verbatim> __parameters__ | *name* | | | *folderPath* | | ---++++ !ModelBrowserPage.OnSelectFilter user selects a new filter __syntax__ <verbatim>function ModelBrowserPage.OnSelectFilter(name, filter)</verbatim> __parameters__ | *name* | | | *filter* | | ---++++ !ModelBrowserPage.OnClickAddToScene add the current model to file. __syntax__ <verbatim>function ModelBrowserPage.OnClickAddToScene()</verbatim> ---++++ !ModelBrowserPage.OnClickAddToScene_internal private function * _param_ __silentMode__ : : if true no UI alert is displayed. __syntax__ <verbatim>function ModelBrowserPage.OnClickAddToScene_internal(silentMode)</verbatim> __parameters__ | *silentMode* | if true no UI alert is displayed. | ---++++ !ModelBrowserPage.OnClickRefreshPreview refresh the current page. __syntax__ <verbatim>function ModelBrowserPage.OnClickRefreshPreview()</verbatim> ---++++ !ModelBrowserPage.OnClickRefreshPreview_Internal private function * _param_ __silentMode__ : : if true no UI alert is displayed. __syntax__ <verbatim>function ModelBrowserPage.OnClickRefreshPreview_Internal(silentMode)</verbatim> __parameters__ | *silentMode* | if true no UI alert is displayed. | ---++++ !Map3DSystem.App.Assets.ModelBrowserPage.OnClickTakeSnapShot take snapshot __syntax__ <verbatim>function Map3DSystem.App.Assets.ModelBrowserPage.OnClickTakeSnapShot()</verbatim> ---++ code behind page for PackageMakerPage.html | *Title* | code behind page for PackageMakerPage.html | | *Author(s)* | LiXizhi | | *Date* | 2008/5/6 | | *File* | script/kids/3DMapSystemApp/Assets/PackageMakerPage.lua | ---+++ Description make a zip package %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Assets/PackageMakerPage.lua"); </verbatim> ---+++ Member Functions ---++++ !PackageMakerPage.OnInit --------------------------------- page event handlers --------------------------------- first time init page __syntax__ <verbatim>function PackageMakerPage.OnInit()</verbatim> ---++++ !PackageMakerPage.OnCreatePackage Create package __syntax__ <verbatim>function PackageMakerPage.OnCreatePackage(name, values)</verbatim> __parameters__ | *name* | | | *values* | | ---++++ !PackageMakerPage.OnCreatePackage_imp return true if created successfully __syntax__ <verbatim>function PackageMakerPage.OnCreatePackage_imp(filepath,packageName,packagePath,packageVersion)</verbatim> __parameters__ | *filepath* | | | *packageName* | | | *packagePath* | | | *packageVersion* | | ---++++ !PackageMakerPage.OnSelectFile User clicks a file __syntax__ <verbatim>function PackageMakerPage.OnSelectFile(name, filepath)</verbatim> __parameters__ | *name* | | | *filepath* | | ---++++ !PackageMakerPage.OnSelectFolder user selects a new folder __syntax__ <verbatim>function PackageMakerPage.OnSelectFolder(name, folderPath)</verbatim> __parameters__ | *name* | | | *folderPath* | | ---++++ !PackageMakerPage.OnSelectFilter user selects a new filter __syntax__ <verbatim>function PackageMakerPage.OnSelectFilter(name, filter)</verbatim> __parameters__ | *name* | | | *filter* | | ---++++ !PackageMakerPage.OnCreateFileNode when a file node created. we can modify its display to give some hints, such as 1. whether the file is being used by the system or not. 1. whether the file is previously included by the system or not __syntax__ <verbatim>function PackageMakerPage.OnCreateFileNode(name, treeNode, filepath)</verbatim> __parameters__ | *name* | | | *treeNode* | | | *filepath* | | ---++++ !PackageMakerPage.OnClickRefreshFileInUse refresh the file currently in used. __syntax__ <verbatim>function PackageMakerPage.OnClickRefreshFileInUse(name, values)</verbatim> __parameters__ | *name* | | | *values* | | ---++++ !PackageMakerPage.GetPrintList 鑾峰彇瑕佹墦鍗扮殑鍒楄〃 __syntax__ <verbatim>function PackageMakerPage.GetPrintList()</verbatim> ---++++ !PackageMakerPage.UpdateFloderMembersTreeView 鏄剧ず閫変腑鏂囦欢澶逛腑 琚紩鎿庝娇鐢ㄧ殑鏂囦欢 __syntax__ <verbatim>function PackageMakerPage.UpdateFloderMembersTreeView()</verbatim> ---++++ !PackageMakerPage.LoadTxtPathList 鍔犺浇鍘嬬缉鍖呯殑鏂囨湰閰嶇疆鏂囦欢 __syntax__ <verbatim>function PackageMakerPage.LoadTxtPathList()</verbatim> ---++++ !PackageMakerPage.ImportFileTabitemOnclick ---------------------------------------------------------------------------------- ImportFileTabitemOnclick __syntax__ <verbatim>function PackageMakerPage.ImportFileTabitemOnclick()</verbatim> ---++++ !PackageMakerPage.import_LoadTxtPathList 瀵煎叆鏂囨湰鏂囦欢 __syntax__ <verbatim>function PackageMakerPage.import_LoadTxtPathList()</verbatim> ---++++ !PackageMakerPage.CutFilter 杞崲閫氶厤绗?*.*" __syntax__ <verbatim>function PackageMakerPage.CutFilter(path)</verbatim> __parameters__ | *path* | | ---++++ !PackageMakerPage.GenerateGreaterCFByField generate a greater compare function according to a node field name. * _param_ __fieldName__ : the name of the field, such as "Text", "Name", etc __syntax__ <verbatim>function PackageMakerPage.GenerateGreaterCFByField(fieldName)</verbatim> __parameters__ | *fieldName* | the name of the field, such as "Text", "Name", etc | ---++++ !PackageMakerPage.BuildPackageByGroupPath <verbatim>------------------------------------------------------------------------- * _param_ __txtPathList__ :涓€涓枃鏈矾寰勭殑闆嗗悎 {"a/b/1.txt","a/b/2.txt",} * _param_ __zipPath__ :鐢熸垚鍘嬬缉鍖呯殑璺緞 c/d/test.zip [[ NPL.load("(gl)script/kids/3DMapSystemApp/Assets/PackageMakerPage.lua"); local txtPathList = { "packages/redist/1-1.0.txt", "packages/redist/2-1.0.txt", "packages/redist/3-1.0.txt" }</verbatim> local zipPath = "packages/redist/test.zip"; local PackageMakerPage = Map3DSystem.App.Assets.PackageMakerPage; PackageMakerPage.BuildPackageByGroupPath(txtPathList,zipPath) ]] __syntax__ <verbatim>function PackageMakerPage.BuildPackageByGroupPath(txtPathList,zipPath)</verbatim> __parameters__ | *txtPathList* | 涓€涓枃鏈矾寰勭殑闆嗗悎 {"a/b/1.txt","a/b/2.txt",} | | *zipPath* | | %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