mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
Merge branch 'development' of https://github.com/TorqueGameEngines/Torque3D into alpha41/cmake_adjustments
This commit is contained in:
commit
0e1e36bbbb
4 changed files with 40 additions and 3 deletions
|
|
@ -65,7 +65,7 @@ void ForestItemData::initPersistFields()
|
||||||
|
|
||||||
addProtectedField( "shapeFile", TypeShapeFilename, Offset( mShapeName, ForestItemData ), &_setShapeData, &defaultProtectedGetFn,
|
addProtectedField( "shapeFile", TypeShapeFilename, Offset( mShapeName, ForestItemData ), &_setShapeData, &defaultProtectedGetFn,
|
||||||
"Shape file for this item type", AbstractClassRep::FIELD_HideInInspectors );
|
"Shape file for this item type", AbstractClassRep::FIELD_HideInInspectors );
|
||||||
endGroup( "Shape(s)" );
|
endGroup( "Shapes" );
|
||||||
|
|
||||||
addGroup("Physics");
|
addGroup("Physics");
|
||||||
addField( "collidable", TypeBool, Offset( mCollidable, ForestItemData ),
|
addField( "collidable", TypeBool, Offset( mCollidable, ForestItemData ),
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,14 @@
|
||||||
|
|
||||||
function UI::onCreate( %this )
|
function UI::onCreate( %this )
|
||||||
{
|
{
|
||||||
|
exec("./scripts/utility");
|
||||||
|
// create and set as core a defaultTable LanguageTable for localization purposes
|
||||||
|
// example usage for quick language appending
|
||||||
|
// addLanguage("defaultTable","check","ch");
|
||||||
|
// addLanguage("defaultTable","try","tr");
|
||||||
|
createLangTable("defaultTable");
|
||||||
|
setCoreLangTable("defaultTable");
|
||||||
|
exec("./langs/languageMap");
|
||||||
}
|
}
|
||||||
|
|
||||||
function UI::onDestroy( %this )
|
function UI::onDestroy( %this )
|
||||||
|
|
@ -81,7 +89,6 @@ function UI::initClient(%this)
|
||||||
%this.queueExec("./scripts/messageBoxes");
|
%this.queueExec("./scripts/messageBoxes");
|
||||||
%this.queueExec("./scripts/help");
|
%this.queueExec("./scripts/help");
|
||||||
%this.queueExec("./scripts/cursors");
|
%this.queueExec("./scripts/cursors");
|
||||||
%this.queueExec("./scripts/utility");
|
|
||||||
|
|
||||||
if(isToolBuild())
|
if(isToolBuild())
|
||||||
%this.queueExec("./tools/creator.tscript");
|
%this.queueExec("./tools/creator.tscript");
|
||||||
|
|
|
||||||
|
|
@ -130,3 +130,33 @@ function getButtonBitmap(%device, %button)
|
||||||
|
|
||||||
return %assetId;
|
return %assetId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createLangTable(%name)
|
||||||
|
{
|
||||||
|
// create a langtable, and global variable to be referenced by GUI elements
|
||||||
|
// opeates as follows:
|
||||||
|
// root gui element contains langTableMod = mylang;
|
||||||
|
// subelements inherit or override
|
||||||
|
// langTableMod then informs the underlying system to look for a $I18N::mylang
|
||||||
|
// this holds a reference to a table defined in .lso files, using data/UI/langs/languageMap global defines as a key
|
||||||
|
new LangTable(%name){};
|
||||||
|
eval("$I18N::"@ %name @"="@ %name @".getId();");
|
||||||
|
}
|
||||||
|
|
||||||
|
function addLanguage(%langTable, %filename, %alias)
|
||||||
|
{
|
||||||
|
// generate an .lso file and if a languageMap file does not exist, it as well
|
||||||
|
%needLangMap = true;
|
||||||
|
if(isFile("data/UI/langs/languageMap"))
|
||||||
|
%needLangMap = false;
|
||||||
|
|
||||||
|
CompileLanguage("data/UI/langs/"@ %filename @".txt", %needLangMap);
|
||||||
|
%langTable.addLanguage("data/UI/langs/"@ %filename @".lso", %alias);
|
||||||
|
}
|
||||||
|
|
||||||
|
function switchLanguage(%language) //use here the #n as it's the order of inclusion
|
||||||
|
{
|
||||||
|
// swap existing language from the current core langtable and refresh the gui contents
|
||||||
|
getCoreLangTable().setCurrentLanguage(%language);
|
||||||
|
Canvas.setContent(Canvas.getContent());
|
||||||
|
}
|
||||||
|
|
@ -482,7 +482,7 @@ function ForestEditorInspector::inspect( %this, %obj )
|
||||||
%this.groupFilters = "+ForestBrushElement,-Ungrouped";
|
%this.groupFilters = "+ForestBrushElement,-Ungrouped";
|
||||||
|
|
||||||
case "TSForestItemData":
|
case "TSForestItemData":
|
||||||
%this.groupFilters = "+Media,+Wind";
|
%this.groupFilters = "+Shapes,+Physics,+Wind,";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
%this.groupFilters = "";
|
%this.groupFilters = "";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue