#include "orimpexpgames_tool.h"
#define ORTOOLGAMESEXPORT__CLASS ORTOOLGAMESEXPORT__CLASSNAME
#define ORTOOLGAMESEXPORT__LABEL "Games Export"
#define ORTOOLGAMESEXPORT__DESC "OR - Games Export Tool Description"
ORTOOLGAMESEXPORT__LABEL,
ORTOOLGAMESEXPORT__DESC,
bool ORToolGamesExport::FBCreate()
{
UICreate ();
UIConfigure ();
UIReset ();
return true;
}
void ORToolGamesExport::FBDestroy()
{
}
void ORToolGamesExport::UICreate()
{
int lS = 5;
int lW = 100;
int lH = 25;
AddRegion("LayoutRegionExportOptions", "LayoutRegionExportOptions",
AddRegion("LabelExportOptions", "LabelExportOptions",
AddRegion("ButtonGlobalInfo", "ButtonGlobalInfo",
AddRegion("ButtonModels", "ButtonModels",
AddRegion("ButtonAnimation", "ButtonAnimation",
AddRegion("ButtonMesh", "ButtonMesh",
AddRegion("ButtonDevices", "ButtonDevices",
AddRegion("ButtonConstraints", "ButtonConstraints",
AddRegion("ButtonProperties", "ButtonProperties",
AddRegion("ButtonCameras", "ButtonCameras",
AddRegion("ButtonLights", "ButtonLights",
AddRegion("ButtonTextures", "ButtonTextures",
AddRegion("ButtonMaterials", "ButtonMaterials",
AddRegion("ButtonTakes", "ButtonTakes",
AddRegion("ButtonMedia", "ButtonMedia",
AddRegion("ButtonSelected", "ButtonSelected",
AddRegion("ButtonExport", "ButtonExport",
SetControl( "LabelExportOptions", mLabelExportOptions );
SetControl( "ButtonGlobalInfo", mButtonGlobalInfo );
SetControl( "ButtonModels", mButtonModels );
SetControl( "ButtonAnimation", mButtonAnimation );
SetControl( "ButtonMesh", mButtonMesh );
SetControl( "ButtonDevices", mButtonDevices );
SetControl( "ButtonConstraints", mButtonConstraints );
SetControl( "ButtonProperties", mButtonProperties );
SetControl( "ButtonCameras", mButtonCameras );
SetControl( "ButtonLights", mButtonLights );
SetControl( "ButtonTextures", mButtonTextures );
SetControl( "ButtonMaterials", mButtonMaterials );
SetControl( "ButtonTakes", mButtonTakes );
SetControl( "ButtonMedia", mButtonMedia );
SetControl( "ButtonSelected", mButtonSelected );
SetControl( "ButtonExport", mButtonExport );
}
void ORToolGamesExport::UIConfigure()
{
SetBorder(
"LayoutRegionExportOptions",
kFBEmbossBorder,
false,
true, 2, 1, 90.0, 0 );
mLabelExportOptions.Caption = "Export Options";
mButtonGlobalInfo.Caption = "Global Info";
mButtonModels.Caption = "Models";
mButtonAnimation.Caption = "Animation";
mButtonMesh.Caption = "Mesh";
mButtonDevices.Caption = "Devices";
mButtonConstraints.Caption = "Constraints";
mButtonProperties.Caption = "Properties";
mButtonCameras.Caption = "Cameras";
mButtonLights.Caption = "Lights";
mButtonTextures.Caption = "Textures";
mButtonMaterials.Caption = "Materials";
mButtonTakes.Caption = "Takes";
mButtonMedia.Caption = "Media";
mButtonSelected.Caption = "Selected";
mButtonExport.Caption = "Export";
mButtonExport.OnClick.Add(
this, (
FBCallback)&ORToolGamesExport::EventButtonExportClick );
}
void ORToolGamesExport::UIReset()
{
mButtonGlobalInfo.State = mEngine.mExportGlobalInfo ? 1:0;
mButtonModels.State = mEngine.mExportModels ? 1:0;
mButtonAnimation.State = mEngine.mExportAnimation ? 1:0;
mButtonMesh.State = mEngine.mExportMesh ? 1:0;
mButtonDevices.State = mEngine.mExportDevices ? 1:0;
mButtonConstraints.State = mEngine.mExportConstraints? 1:0;
mButtonProperties.State = mEngine.mExportProperties ? 1:0;
mButtonCameras.State = mEngine.mExportCameras ? 1:0;
mButtonLights.State = mEngine.mExportLights ? 1:0;
mButtonTextures.State = mEngine.mExportTextures ? 1:0;
mButtonMaterials.State = mEngine.mExportMaterials ? 1:0;
mButtonTakes.State = mEngine.mExportTakes ? 1:0;
mButtonMedia.State = mEngine.mExportMedia ? 1:0;
mButtonSelected.State = mEngine.mExportSelected ? 1:0;
}
{
FBFilePopup lFilePopup;
lFilePopup.Path = "C:\\";
lFilePopup.Filter = "*.txt";
if(lFilePopup.Execute())
{
mEngine.mExportGlobalInfo =( mButtonGlobalInfo.State != 0 );
mEngine.mExportModels =( mButtonModels.State != 0 );
mEngine.mExportAnimation =( mButtonAnimation.State != 0 );
mEngine.mExportMesh =( mButtonMesh.State != 0 );
mEngine.mExportDevices =( mButtonDevices.State != 0 );
mEngine.mExportConstraints =( mButtonConstraints.State != 0 );
mEngine.mExportProperties =( mButtonProperties.State != 0 );
mEngine.mExportCameras =( mButtonCameras.State != 0 );
mEngine.mExportLights =( mButtonLights.State != 0 );
mEngine.mExportTextures =( mButtonTextures.State != 0 );
mEngine.mExportMaterials =( mButtonMaterials.State != 0 );
mEngine.mExportTakes =( mButtonTakes.State != 0 );
mEngine.mExportMedia =( mButtonMedia.State != 0 );
mEngine.mExportSelected =( mButtonSelected.State != 0 );
mEngine.Export(lFilePopup.FullFilename);
}
}