Exemple #1
0
void ObjectEditFrame::setupObjectList( ObjectCreator& creator )
{
	ObjectFactoryMap& of = creator.getFactoryMap();
	mObjectListCtrl->removeAllItem();

	int num = 0;
	for( ObjectFactoryMap::iterator iter = of.begin() , itEnd = of.end();
		iter != itEnd ; ++iter )
	{

		unsigned idx = mObjectListCtrl->appendItem( iter->first );
		mObjectListCtrl->setItemData( idx , (void*)iter->first );
		++num;
	}


	Vec2i size;
	size.x = ButtonSize().x;
	size.y = num * mObjectListCtrl->getItemHeight();
	mObjectListCtrl->setSize( size );
	
	size.x += 4;
	size.y += TopSideHeight + 4 + ButtonSize().y;
	setSize( size );

}
Exemple #2
0
ObjectEditFrame::ObjectEditFrame( int id , Vec2f const& pos , GWidget* parent ) 
	:BaseClass( id , pos , Vec2i( 4 , 4 ) + Vec2i( 0 , 0 ) , parent )
{

	Vec2i posCur = Vec2i( 2 , 2 + TopSideHeight );

	GTextButton* button = new GTextButton( UI_OBJECT_DESTROY , posCur , ButtonSize() , this );
	button->text->setFont( getGame()->getFont(0) );
	button->text->setCharSize( 20 );
	button->text->setString( "Destroy" );
	posCur.y += ButtonSize().y + 2;

	mObjectListCtrl = new GListCtrl( UI_OBJECT_LISTCTRL , posCur , Vec2i(0,0) , this );
}
Exemple #3
0
void ActionEditFrame::setupActionList( ActionCreator& creator )
{
	Vec2i  basePos = Vec2i( ListCtrlWidth + 2 + 3 , TopSideHeight + 2 );
	ActionFactoryMap& of = creator.getFactoryMap();
	int num = 0;
	for( ActionFactoryMap::iterator iter = of.begin() , itEnd = of.end();
		iter != itEnd ; ++iter )
	{
		Vec2i pos = basePos;
		pos.y += num  * ( ButtonSize().y + 2 );
		GTextButton* button = new GTextButton( UI_ACTION_SELECT , pos , ButtonSize() , this );
		button->text->setFont( getGame()->getFont(0) );
		button->text->setCharSize( 20 );
		button->text->setString( iter->first );
		button->setUserData( (void*)iter->second );
		++num;
	}
}
Exemple #4
0
// Load the icon graphics based on a theme
void FrontendManager::LoadCommonGraphics(string themeName)
{
	string iconName;

	// Checkbox
	iconName = "media/textures/gui/" + themeName + "/common/checkbox/checkDefault.tga";
	m_pCheckboxIcon->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/checkbox/checkHover.tga";
	m_pCheckboxIconHover->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/checkbox/checkPressed.tga";
	m_pCheckboxIconPressed->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/checkbox/checkDisabled.tga";
	m_pCheckboxIconDisabled->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/checkbox/checkToggled.tga";
	m_pCheckboxIconToggled->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/checkbox/checkToggledHover.tga";
	m_pCheckboxIconToggledHover->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/checkbox/checkToggledPressed.tga";
	m_pCheckboxIconToggledPressed->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/checkbox/checkToggledDisabled.tga";
	m_pCheckboxIconToggledDisabled->SetIcon(iconName);

	// Optionbox
	iconName = "media/textures/gui/" + themeName + "/common/optionbox/optionDefault.tga";
	m_pOptionboxIcon->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/optionbox/optionHover.tga";
	m_pOptionboxIconHover->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/optionbox/optionPressed.tga";
	m_pOptionboxIconPressed->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/optionbox/optionDisabled.tga";
	m_pOptionboxIconDisabled->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/optionbox/optionToggled.tga";
	m_pOptionboxIconToggled->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/optionbox/optionToggledHover.tga";
	m_pOptionboxIconToggledHover->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/optionbox/optionToggledPressed.tga";
	m_pOptionboxIconToggledPressed->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/optionbox/optionToggledDisabled.tga";
	m_pOptionboxIconToggledDisabled->SetIcon(iconName);

	// Scrollbar
	iconName = "media/textures/gui/" + themeName + "/common/scrollbar/arrowDownDefault.tga";
	m_pScrollbarArrowDownIcon->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/scrollbar/arrowDownHover.tga";
	m_pScrollbarArrowDownIconHover->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/scrollbar/arrowDownPressed.tga";
	m_pScrollbarArrowDownIconPressed->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/scrollbar/arrowDownDisabled.tga";
	m_pScrollbarArrowDownIconDisabled->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/scrollbar/arrowUpDefault.tga";
	m_pScrollbarArrowUpIcon->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/scrollbar/arrowUpHover.tga";
	m_pScrollbarArrowUpIconHover->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/scrollbar/arrowUpPressed.tga";
	m_pScrollbarArrowUpIconPressed->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/scrollbar/arrowUpDisabled.tga";
	m_pScrollbarArrowUpIconDisabled->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/scrollbar/backgroundDefault.tga";
	m_pScrollbarBackgroundIcon->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/scrollbar/backgroundDisabled.tga";
	m_pScrollbarBackgroundIconDisabled->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/scrollbar/scrollbarDefault.tga";
	m_pScrollbarIcon->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/scrollbar/scrollbarHover.tga";
	m_pScrollbarIconHover->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/scrollbar/scrollbarPressed.tga";
	m_pScrollbarIconPressed->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/scrollbar/scrollbarDisabled.tga";
	m_pScrollbarIconDisabled->SetIcon(iconName);

	// Buttons
	for (int i = 0; i < ButtonSize_NUM; i++)
	{
		string sizeFolder = "";
		if (ButtonSize(i) == ButtonSize_85x25) { sizeFolder = "85x25"; }
		if (ButtonSize(i) == ButtonSize_65x25) { sizeFolder = "65x25"; }
		if (ButtonSize(i) == ButtonSize_110x47) { sizeFolder = "110x47"; }
		if (ButtonSize(i) == ButtonSize_225x75) { sizeFolder = "225x75"; }

		iconName = "media/textures/gui/" + themeName + "/common/buttons/" + sizeFolder + "/buttonDefault.tga";
		m_pButtonIcon[ButtonSize(i)]->SetIcon(iconName);
		iconName = "media/textures/gui/" + themeName + "/common/buttons/" + sizeFolder + "/buttonHover.tga";
		m_pButtonIconHover[ButtonSize(i)]->SetIcon(iconName);
		iconName = "media/textures/gui/" + themeName + "/common/buttons/" + sizeFolder + "/buttonPressed.tga";
		m_pButtonIconPressed[ButtonSize(i)]->SetIcon(iconName);
		iconName = "media/textures/gui/" + themeName + "/common/buttons/" + sizeFolder + "/buttonDisabled.tga";
		m_pButtonIconDisabled[ButtonSize(i)]->SetIcon(iconName);
	}

	// Close button
	iconName = "media/textures/gui/" + themeName + "/common/close_button/close_exit.tga";
	m_pCloseExitButtonIcon->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/close_button/close_exit_hover.tga";
	m_pCloseExitButtonIcon_Hover->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/close_button/close_exit_pressed.tga";
	m_pCloseExitButtonIcon_Pressed->SetIcon(iconName);

	// Rotate buttons
	iconName = "media/textures/gui/" + themeName + "/common/rotate/arrow_left.tga";
	m_pArrowLeft_Icon->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/rotate/arrow_left_hover.tga";
	m_pArrowLeft_Icon_Hover->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/rotate/arrow_left_pressed.tga";
	m_pArrowLeft_Icon_Pressed->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/rotate/arrow_right.tga";
	m_pArrowRight_Icon->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/rotate/arrow_right_hover.tga";
	m_pArrowRight_Icon_Hover->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/rotate/arrow_right_pressed.tga";
	m_pArrowRight_Icon_Pressed->SetIcon(iconName);

	// Tab options
	iconName = "media/textures/gui/" + themeName + "/common/tab_option/tab.tga";
	m_pTab75OptionIcon->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/tab_option/tab_hover.tga";
	m_pTab75OptionIcon_Hover->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/tab_option/tab_pressed.tga";
	m_pTab75OptionIcon_Pressed->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/tab_option/tab_toggled.tga";
	m_pTab75OptionIcon_Toggled->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/tab_option/tab_toggled_hover.tga";
	m_pTab75OptionIcon_Toggled_Hover->SetIcon(iconName);
	iconName = "media/textures/gui/" + themeName + "/common/tab_option/tab_toggled_pressed.tga";
	m_pTab75OptionIcon_Toggled_Pressed->SetIcon(iconName);
}
Exemple #5
0
FrontendManager::FrontendManager(Renderer* pRenderer, OpenGLGUI* pGUI)
{
	m_pRenderer = pRenderer;
	m_pGUI = pGUI;

	m_pCamera = NULL;

	// Fonts
	m_pRenderer->CreateFreeTypeFont("media/fonts/pf_ronda_seven.ttf", 26, &m_frontendFont_Large, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/pf_ronda_seven.ttf", 18, &m_frontendFont_Medium, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/pf_ronda_seven.ttf", 12, &m_frontendFont_Small, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolbackot.ttf", 14, &m_frontendFont_14, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolot.ttf", 14, &m_frontendFont_14_Outline, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolbackot.ttf", 18, &m_frontendFont_18, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolot.ttf", 18, &m_frontendFont_18_Outline, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolbackot.ttf", 20, &m_frontendFont_20, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolot.ttf", 20, &m_frontendFont_20_Outline, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolbackot.ttf", 22, &m_frontendFont_22, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolot.ttf", 22, &m_frontendFont_22_Outline, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolbackot.ttf", 25, &m_frontendFont_25, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolot.ttf", 25, &m_frontendFont_25_Outline, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolbackot.ttf", 30, &m_frontendFont_30, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolot.ttf", 30, &m_frontendFont_30_Outline, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolbackot.ttf", 35, &m_frontendFont_35, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolot.ttf", 35, &m_frontendFont_35_Outline, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolbackot.ttf", 40, &m_frontendFont_40, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolot.ttf", 40, &m_frontendFont_40_Outline, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolbackot.ttf", 50, &m_frontendFont_50, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolot.ttf", 50, &m_frontendFont_50_Outline, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolbackot.ttf", 80, &m_frontendFont_80, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolot.ttf", 80, &m_frontendFont_80_Outline, true);

	// Text effects fonts
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolbackot.ttf", 34, &m_textEffectFontNormal, true);
	m_pRenderer->CreateFreeTypeFont("media/fonts/screenloggercoolot.ttf", 34, &m_textEffectFontOutline, true);

	// Checkbox
	m_pCheckboxIcon = new Icon(m_pRenderer, "", 16, 16);
	m_pCheckboxIcon->SetDepth(2.0f);
	m_pCheckboxIconHover = new Icon(m_pRenderer, "", 16, 16);
	m_pCheckboxIconHover->SetDepth(2.0f);
	m_pCheckboxIconPressed = new Icon(m_pRenderer, "", 16, 16);
	m_pCheckboxIconPressed->SetDepth(2.0f);
	m_pCheckboxIconDisabled = new Icon(m_pRenderer, "", 16, 16);
	m_pCheckboxIconDisabled->SetDepth(2.0f);
	m_pCheckboxIconToggled = new Icon(m_pRenderer, "", 16, 16);
	m_pCheckboxIconToggled->SetDepth(2.0f);
	m_pCheckboxIconToggledHover = new Icon(m_pRenderer, "", 16, 16);
	m_pCheckboxIconToggledHover->SetDepth(2.0f);
	m_pCheckboxIconToggledPressed = new Icon(m_pRenderer, "", 16, 16);
	m_pCheckboxIconToggledPressed->SetDepth(2.0f);
	m_pCheckboxIconToggledDisabled = new Icon(m_pRenderer, "", 16, 16);
	m_pCheckboxIconToggledDisabled->SetDepth(2.0f);

	// Optionbox
	m_pOptionboxIcon = new Icon(m_pRenderer, "", 16, 16);
	m_pOptionboxIcon->SetDepth(2.0f);
	m_pOptionboxIconHover = new Icon(m_pRenderer, "", 16, 16);
	m_pOptionboxIconHover->SetDepth(2.0f);
	m_pOptionboxIconPressed = new Icon(m_pRenderer, "", 16, 16);
	m_pOptionboxIconPressed->SetDepth(2.0f);
	m_pOptionboxIconDisabled = new Icon(m_pRenderer, "", 16, 16);
	m_pOptionboxIconDisabled->SetDepth(2.0f);
	m_pOptionboxIconToggled = new Icon(m_pRenderer, "", 16, 16);
	m_pOptionboxIconToggled->SetDepth(2.0f);
	m_pOptionboxIconToggledHover = new Icon(m_pRenderer, "", 16, 16);
	m_pOptionboxIconToggledHover->SetDepth(2.0f);
	m_pOptionboxIconToggledPressed = new Icon(m_pRenderer, "", 16, 16);
	m_pOptionboxIconToggledPressed->SetDepth(2.0f);
	m_pOptionboxIconToggledDisabled = new Icon(m_pRenderer, "", 16, 16);
	m_pOptionboxIconToggledDisabled->SetDepth(2.0f);

	// Scrollbar
	m_pScrollbarArrowDownIcon = new Icon(m_pRenderer, "", 18, 18);
	m_pScrollbarArrowDownIcon->SetDepth(2.0f);
	m_pScrollbarArrowDownIconHover = new Icon(m_pRenderer, "", 18, 18);
	m_pScrollbarArrowDownIconHover->SetDepth(2.0f);
	m_pScrollbarArrowDownIconPressed = new Icon(m_pRenderer, "", 18, 18);
	m_pScrollbarArrowDownIconPressed->SetDepth(2.0f);
	m_pScrollbarArrowDownIconDisabled = new Icon(m_pRenderer, "", 18, 18);
	m_pScrollbarArrowDownIconDisabled->SetDepth(2.0f);
	m_pScrollbarArrowUpIcon = new Icon(m_pRenderer, "", 18, 18);
	m_pScrollbarArrowUpIcon->SetDepth(2.0f);
	m_pScrollbarArrowUpIconHover = new Icon(m_pRenderer, "", 18, 18);
	m_pScrollbarArrowUpIconHover->SetDepth(2.0f);
	m_pScrollbarArrowUpIconPressed = new Icon(m_pRenderer, "", 18, 18);
	m_pScrollbarArrowUpIconPressed->SetDepth(2.0f);
	m_pScrollbarArrowUpIconDisabled = new Icon(m_pRenderer, "", 18, 18);
	m_pScrollbarArrowUpIconDisabled->SetDepth(2.0f);
	m_pScrollbarBackgroundIcon = new Icon(m_pRenderer, "", 18, 18);
	m_pScrollbarBackgroundIcon->SetDepth(2.0f);
	m_pScrollbarBackgroundIconDisabled = new Icon(m_pRenderer, "", 18, 18);
	m_pScrollbarBackgroundIconDisabled->SetDepth(2.0f);
	m_pScrollbarIcon = new Icon(m_pRenderer, "", 18, 18);
	m_pScrollbarIcon->SetDepth(4.0f);
	m_pScrollbarIconHover = new Icon(m_pRenderer, "", 18, 18);
	m_pScrollbarIconHover->SetDepth(4.0f);
	m_pScrollbarIconPressed = new Icon(m_pRenderer, "", 18, 18);
	m_pScrollbarIconPressed->SetDepth(4.0f);
	m_pScrollbarIconDisabled = new Icon(m_pRenderer, "", 18, 18);
	m_pScrollbarIconDisabled->SetDepth(4.0f);

	// Buttons
	m_pButtonIcon = new Icon*[ButtonSize_NUM];
	m_pButtonIconHover = new Icon*[ButtonSize_NUM];
	m_pButtonIconPressed = new Icon*[ButtonSize_NUM];
	m_pButtonIconDisabled = new Icon*[ButtonSize_NUM];
	for (int i = 0; i < ButtonSize_NUM; i++)
	{
		int width = 0;
		int height = 0;
		if (ButtonSize(i) == ButtonSize_85x25) { width = 85; height = 25; }
		if (ButtonSize(i) == ButtonSize_65x25) { width = 65; height = 25; }
		if (ButtonSize(i) == ButtonSize_110x47) { width = 110; height = 47; }
		if (ButtonSize(i) == ButtonSize_225x75) { width = 225; height = 75; }

		m_pButtonIcon[ButtonSize(i)] = new Icon(m_pRenderer, "", width, height);
		m_pButtonIcon[ButtonSize(i)]->SetDepth(2.0f);
		m_pButtonIconHover[ButtonSize(i)] = new Icon(m_pRenderer, "", width, height);
		m_pButtonIconHover[ButtonSize(i)]->SetDepth(2.0f);
		m_pButtonIconPressed[ButtonSize(i)] = new Icon(m_pRenderer, "", width, height);
		m_pButtonIconPressed[ButtonSize(i)]->SetDepth(2.0f);
		m_pButtonIconDisabled[ButtonSize(i)] = new Icon(m_pRenderer, "", width, height);
		m_pButtonIconDisabled[ButtonSize(i)]->SetDepth(2.0f);
	}

	// Close button
	m_pCloseExitButtonIcon = new Icon(m_pRenderer, "", 32, 32);
	m_pCloseExitButtonIcon->SetDepth(1.0f);
	m_pCloseExitButtonIcon_Hover = new Icon(m_pRenderer, "", 32, 32);
	m_pCloseExitButtonIcon_Hover->SetDepth(1.0f);
	m_pCloseExitButtonIcon_Pressed = new Icon(m_pRenderer, "", 32, 32);
	m_pCloseExitButtonIcon_Pressed->SetDepth(1.0f);

	// Rotate buttons
	m_pArrowLeft_Icon = new Icon(m_pRenderer, "", 32, 32);
	m_pArrowLeft_Icon->SetDepth(2.0f);
	m_pArrowLeft_Icon_Hover = new Icon(m_pRenderer, "", 32, 32);
	m_pArrowLeft_Icon_Hover->SetDepth(2.0f);
	m_pArrowLeft_Icon_Pressed = new Icon(m_pRenderer, "", 32, 32);
	m_pArrowLeft_Icon_Pressed->SetDepth(2.0f);
	m_pArrowRight_Icon = new Icon(m_pRenderer, "", 32, 32);
	m_pArrowRight_Icon->SetDepth(2.0f);
	m_pArrowRight_Icon_Hover = new Icon(m_pRenderer, "", 32, 32);
	m_pArrowRight_Icon_Hover->SetDepth(2.0f);
	m_pArrowRight_Icon_Pressed = new Icon(m_pRenderer, "", 32, 32);
	m_pArrowRight_Icon_Pressed->SetDepth(2.0f);

	// Tab options
	m_pTab75OptionIcon = new Icon(m_pRenderer, "", 75, 44);
	m_pTab75OptionIcon->SetDepth(2.0f);
	m_pTab75OptionIcon_Hover = new Icon(m_pRenderer, "", 75, 44);
	m_pTab75OptionIcon_Hover->SetDepth(2.0f);
	m_pTab75OptionIcon_Pressed = new Icon(m_pRenderer, "", 75, 44);
	m_pTab75OptionIcon_Pressed->SetDepth(2.0f);
	m_pTab75OptionIcon_Toggled = new Icon(m_pRenderer, "", 75, 44);
	m_pTab75OptionIcon_Toggled->SetDepth(2.0f);
	m_pTab75OptionIcon_Toggled_Hover = new Icon(m_pRenderer, "", 75, 44);
	m_pTab75OptionIcon_Toggled_Hover->SetDepth(2.0f);
	m_pTab75OptionIcon_Toggled_Pressed = new Icon(m_pRenderer, "", 75, 44);
	m_pTab75OptionIcon_Toggled_Pressed->SetDepth(2.0f);

	// Common, shared frontend page params
	m_cameraOrbitTimer = 15.0f;

	// Constants
	m_tooltipAppearDelay = 0.25f;

	// Load the common graphics that are set as the currently loaded mod
	LoadCommonGraphics(VoxGame::GetInstance()->GetModsManager()->GetHUDTextureTheme());

	// Pages
	int width = 800;
	int height = 800;
	FrontendPage* pMainMenu = new MainMenu(m_pRenderer, m_pGUI, this, width, height);
	FrontendPage* pSelectCharacter = new SelectCharacter(m_pRenderer, m_pGUI, this, width, height);
	FrontendPage* pCreateCharacter = new CreateCharacter(m_pRenderer, m_pGUI, this, width, height);
	FrontendPage* pQuitPopup = new QuitPopup(m_pRenderer, m_pGUI, this, width, height);
	FrontendPage* pPauseMenu = new PauseMenu(m_pRenderer, m_pGUI, this, width, height);
	FrontendPage* pOptionsMenu = new OptionsMenu(m_pRenderer, m_pGUI, this, width, height);
	FrontendPage* pModMenu = new ModMenu(m_pRenderer, m_pGUI, this, width, height);

	m_vpFrontendPages.push_back(pMainMenu);
	m_vpFrontendPages.push_back(pSelectCharacter);
	m_vpFrontendPages.push_back(pCreateCharacter);
	m_vpFrontendPages.push_back(pQuitPopup);
	m_vpFrontendPages.push_back(pPauseMenu);
	m_vpFrontendPages.push_back(pOptionsMenu);
	m_vpFrontendPages.push_back(pModMenu);

	// Initial page
	m_currentScreen = FrontendScreen_None;
	m_currentPage = NULL;
	SetFrontendScreen(FrontendScreen_None);
}
Exemple #6
0
ActionEditFrame::ActionEditFrame( int id , Vec2i const& pos , GWidget* widget ) 
	:BaseClass( id , pos , Vec2i( ListCtrlWidth + ButtonSize().x + 4 + 3 , 200 ) , widget )
{
	mListCtrl = new GListCtrl( UI_ACTION_LISTCTRL , Vec2i( 2 , TopSideHeight + 2 ) , Vec2i( 100 , 100 ) , this );
	mTrigger = NULL;
}
    CEditAnimationDialog::CEditAnimationDialog(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos, const wxSize &size, long style, const wxString &name)
    : CEditDialogBase(parent, id, title, pos, size, style, name)
    , m_bAnimation(false)
    , m_bSkeleton(false)
    , m_bSkin(false)
    , m_bIsLoop(false)
    , m_bIsVisibleBone(false)
    , m_bIsVisibleCoordinate(false)
    , m_bIsSelectAll(false)
    , m_bISLanguageSwitch(false)
{
    m_Manager.SetManagedWindow(this);
    wxToolTip::Enable(true);
    wxSize ButtonSize(60,0);
    wxSize DefaultButtonSize(DEFAULT_PGBUTTONWIDTH, DEFAULT_PGBUTTONWIDTH);
    wxSize client_size = GetClientSize();
    

    wxBoxSizer* pModelTreeSizer = new wxBoxSizer(wxVERTICAL);
    wxBoxSizer* pTopRightSizer = new wxBoxSizer(wxVERTICAL);
    wxBoxSizer* pTopRightTopSizer = new wxBoxSizer(wxVERTICAL);
    wxBoxSizer* pTopRightCenterSizer = new wxBoxSizer(wxVERTICAL);
    wxBoxSizer* pTopRightBottomSizer = new wxBoxSizer(wxVERTICAL);
    wxBoxSizer* pLogPanelSizer = new wxBoxSizer(wxVERTICAL);
    wxBoxSizer* pTimeBarPanelSizer = new wxBoxSizer(wxVERTICAL);
    wxBoxSizer* pTimeBarPanelTopSizer = new wxBoxSizer(wxHORIZONTAL);
    wxBoxSizer* pTopRightTopBottomSizer = new wxBoxSizer(wxHORIZONTAL);
    wxBoxSizer* pTopRightCenterBottomSizer = new wxBoxSizer(wxHORIZONTAL);
    wxBoxSizer* pTopRightBottomBottomSizer = new wxBoxSizer(wxHORIZONTAL);

    wxPanel* pLogPanel      = new wxPanel(this);
    wxPanel* pTimeBarPanel  = new wxPanel(this);
    wxPanel* pTopRightPanel = new wxPanel(this);
    wxPanel* pModelTreePanel  = new wxPanel(this);
    wxTextCtrl* pTextCtrl   = new wxTextCtrl(pLogPanel, wxID_ANY, _T(""), wxPoint(0,0), client_size, wxNO_BORDER | wxTE_MULTILINE);
    wxButton* pButton       = new wxButton(pLogPanel, ID_BUTTON_CLEANLOG, _T("X"), wxDefaultPosition, DefaultButtonSize);
    wxImageList *pFileIconImages = new wxImageList(15, 15, true);
    wxIcon fileIcons[eTCIT_Count];
    wxSize iconSize(15, 15);
    fileIcons[eTCIT_File] = wxArtProvider::GetIcon(wxART_NORMAL_FILE, wxART_LIST, iconSize);
    fileIcons[eTCIT_FileSelected] = wxArtProvider::GetIcon(wxART_FILE_OPEN, wxART_LIST, iconSize);
    fileIcons[eTCIT_Folder] = wxArtProvider::GetIcon(wxART_FOLDER, wxART_LIST, iconSize);
    fileIcons[eTCIT_FolderSelected] = wxArtProvider::GetIcon(wxART_FOLDER, wxART_LIST, iconSize);
    fileIcons[eTCIT_FolderOpened] = wxArtProvider::GetIcon(wxART_FOLDER_OPEN, wxART_LIST, iconSize);
    for (size_t i = 0; i < eTCIT_Count; ++i)
    {
        pFileIconImages->Add(fileIcons[i]);
    }

    m_pModelTreeMenu    = new wxMenu;
    m_pModelTree        = new wxTreeCtrl(pModelTreePanel, ID_TREECTRL_MODELS, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE | wxTR_NO_LINES | wxTR_EDIT_LABELS | wxSUNKEN_BORDER);
    m_pTimeBar          = new CTimeBarFrame(pTimeBarPanel);
    m_pAnimitionListBox = new wxListBox(pTopRightPanel, ID_LISTBOX_ANIMATION);
    m_pSkeletonListBox  = new wxListBox(pTopRightPanel, ID_LISTBOX_SKELETON, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_MULTIPLE);
    m_pSkinListBox      = new wxListBox(pTopRightPanel, ID_LISTBOX_SKIN);
    m_pSkeletonChoice   = new wxChoice(pTopRightPanel, ID_CHOICE_SKELETON);
    m_pButtonPlay       = new wxButton(pTimeBarPanel, ID_BUTTON_PLAY, _T("|>"), wxDefaultPosition, DefaultButtonSize);
    m_pButtonPause      = new wxButton(pTimeBarPanel, ID_BUTTON_PAUSE, _T("||"), wxDefaultPosition, DefaultButtonSize);
    m_pButtonStop       = new wxButton(pTimeBarPanel, ID_BUTTON_STOP, _T("[]"), wxDefaultPosition, DefaultButtonSize);
    m_pLoopCheckBox     = new wxCheckBox(pTimeBarPanel, ID_CHECKBOX_LOOP, _("Loop"));
    m_pButtonSkin       = new wxButton(pTopRightPanel, ID_BUTTON_SELECTSKIDIR, _T("Skin"));
    m_pButtonAnimaton   = new wxButton(pTopRightPanel, ID_BUTTON_SELECTANIDIR, _T("Animation"));
    m_pSKECheckBox      = new wxCheckBox(pTopRightPanel, ID_CHECKBOX_SKELETONVISIBLE, _T("SKE"));
    m_pSKEBCheckBox     = new wxCheckBox(pTopRightPanel, ID_CHECKBOX_SKELETONBONEVISIBLE, _T("SKEB"));
    m_pSkeSelectButton  = new wxButton(pTopRightPanel, ID_BUTTON_SELECT, _T("SelectAll"), wxDefaultPosition, ButtonSize);
    m_pButtonSkeleton   = new wxButton(pTopRightPanel, ID_BUTTON_SELECTSKEDIR, _T("Skeleton"), wxDefaultPosition, ButtonSize);
    m_pSkeletonCheckBox = new wxCheckBox(pTopRightPanel, wxID_ANY, _T(""));
    m_pSkinCheckBox     = new wxCheckBox(pTopRightPanel, wxID_ANY, _T(""));
    m_pAnimationCheckBox = new wxCheckBox(pTopRightPanel, wxID_ANY, _T(""));
    m_pAnimationGLWindow = new CAnimationGLWindow(this, static_cast<CEngineEditor*>(wxApp::GetInstance())->GetGLContext());
    static_cast<CEngineEditor*>(wxApp::GetInstance())->GetMainFrame()->RegisterUpdateWindow(m_pAnimationGLWindow);
    m_pAnimationCheckBox->Disable();
    m_pSkeletonCheckBox->Disable();
    m_pSkinCheckBox->Disable();    

    pLogPanel->SetSizer(pLogPanelSizer);
    pTimeBarPanel->SetSizer(pTimeBarPanelSizer);
    pTopRightPanel->SetSizer(pTopRightSizer);
    pModelTreePanel->SetSizer(pModelTreeSizer);

    m_pButtonPlay->SetToolTip(_T("Play"));
    m_pButtonPause->SetToolTip(_T("Pause"));
    m_pButtonStop->SetToolTip(_T("Stop"));
    pButton->SetToolTip(_T("clean log"));

    m_pModelTree->AssignImageList(pFileIconImages);
    m_pModelTree->AddRoot(_T("Models"), eTCIT_Folder);

    m_pModelTreeMenu->Append(ID_MENU_CREATE, _T("Create"));
    m_pModelTreeMenu->Append(ID_MENU_COPY, _T("Copy"));
    m_pModelTreeMenu->Append(ID_MENU_PAST, _T("Paste"));
    m_pModelTreeMenu->Append(ID_MENU_DELETE, _T("Delete"));

    m_pTimeBar->SetFrameWindow(this);
    pTextCtrl->SetEditable(false);
    wxLog::DisableTimestamp();
    m_pLogOld = wxLog::SetActiveTarget(new wxLogTextCtrl(pTextCtrl));
    m_pLog = pTextCtrl;
    
    pModelTreeSizer->Add(m_pModelTree, 1, wxGROW|wxALL, 0);

    pLogPanelSizer->Add(pButton, 0, wxALIGN_RIGHT|wxALL, 0);
    pLogPanelSizer->Add(new wxStaticLine(pLogPanel, wxLI_HORIZONTAL), 0, wxGROW|wxALL, 0);
    pLogPanelSizer->Add(m_pLog, 1, wxGROW|wxALL, 0);
    
    pTimeBarPanelSizer->Add(pTimeBarPanelTopSizer, 0, wxGROW|wxALL, 0);
    pTimeBarPanelSizer->Add(m_pTimeBar, 1, wxGROW|wxALL, 0);
    
    pTimeBarPanelTopSizer->Add(m_pButtonPlay, 0, wxALIGN_RIGHT|wxALL, 0);
    pTimeBarPanelTopSizer->Add(m_pButtonPause, 0, wxALIGN_RIGHT|wxALL, 0);
    pTimeBarPanelTopSizer->Add(m_pButtonStop, 0, wxALIGN_RIGHT|wxALL, 0);
    pTimeBarPanelTopSizer->Add(m_pLoopCheckBox, 0, wxALIGN_RIGHT|wxALL, 0);

    pTopRightSizer->Add(pTopRightTopSizer, 1, wxGROW|wxALL, 5);
    pTopRightSizer->Add(new wxStaticLine(pTopRightPanel, wxLI_HORIZONTAL), 0, wxGROW|wxALL, 5);
    pTopRightSizer->Add(pTopRightCenterSizer, 1, wxGROW|wxALL, 5);
    pTopRightSizer->Add(new wxStaticLine(pTopRightPanel, wxLI_HORIZONTAL), 0, wxGROW|wxALL, 5);
    pTopRightSizer->Add(pTopRightBottomSizer, 1, wxGROW|wxALL, 5);

    pTopRightTopSizer->Add(m_pAnimitionListBox, 1, wxGROW|wxALL, 0);
    pTopRightTopSizer->Add(pTopRightTopBottomSizer, 0, wxGROW|wxALL, 0);

    pTopRightCenterSizer->Add(m_pSkeletonChoice, 0, wxGROW|wxALL, 0);
    pTopRightCenterSizer->Add(m_pSkeletonListBox, 1, wxGROW|wxALL, 1);
    pTopRightCenterSizer->Add(pTopRightCenterBottomSizer, 0, wxGROW|wxALL, 0);

    pTopRightBottomSizer->Add(m_pSkinListBox, 1, wxGROW|wxALL, 0);
    pTopRightBottomSizer->Add(pTopRightBottomBottomSizer, 0, wxGROW|wxALL, 0);

    pTopRightTopBottomSizer->AddStretchSpacer();
    pTopRightTopBottomSizer->Add(m_pAnimationCheckBox, 0, wxGROW|wxALL, 5);
    pTopRightTopBottomSizer->Add(m_pButtonAnimaton, 0, wxGROW|wxALL, 0);
    pTopRightTopBottomSizer->AddStretchSpacer();

    pTopRightCenterBottomSizer->Add(m_pSKECheckBox, 0, wxGROW|wxALL, 0);
    pTopRightCenterBottomSizer->Add(m_pSKEBCheckBox, 0, wxGROW|wxALL, 0);
    pTopRightCenterBottomSizer->AddStretchSpacer();
    pTopRightCenterBottomSizer->Add(m_pSkeletonCheckBox, 0, wxGROW|wxALL, 5);
    pTopRightCenterBottomSizer->Add(m_pButtonSkeleton, 0, wxGROW|wxALL, 0);
    pTopRightCenterBottomSizer->Add(m_pSkeSelectButton, 0, wxGROW|wxALL, 0);
    pTopRightCenterBottomSizer->AddStretchSpacer();

    pTopRightBottomBottomSizer->AddStretchSpacer();
    pTopRightBottomBottomSizer->Add(m_pSkinCheckBox, 0, wxGROW|wxALL, 5);
    pTopRightBottomBottomSizer->Add(m_pButtonSkin, 0, wxGROW|wxALL, 0);
    pTopRightBottomBottomSizer->AddStretchSpacer();

    m_Manager.AddPane(pModelTreePanel, wxAuiPaneInfo().MinSize(260,100).CenterPane().
        Name(wxT("Model")).
        Left());
    m_Manager.AddPane(m_pAnimationGLWindow, wxAuiPaneInfo().CenterPane().
        Name(wxT("GLWindow")).
        Center());
    m_Manager.AddPane(pTopRightPanel, wxAuiPaneInfo().MinSize(260,0).CenterPane().
        Name(wxT("Right")).
        Right());
    m_Manager.AddPane(pTimeBarPanel, wxAuiPaneInfo().MinSize(100,200).CenterPane().
        Name(wxT("Timebar")).
        Bottom());
    m_Manager.AddPane(pLogPanel, wxAuiPaneInfo().CenterPane().
        Name(wxT("Log")).
        Bottom());

    GetResourceList(CResourcePathManager::GetInstance()->GetResourcePath(CResourcePathManager::eRPT_Animation));
    GetResourceList(CResourcePathManager::GetInstance()->GetResourcePath(CResourcePathManager::eRPT_Skeleton));
    GetResourceList(CResourcePathManager::GetInstance()->GetResourcePath(CResourcePathManager::eRPT_Skin));
    wxLogMessage(wxT("This is edit log."));
    m_Manager.Update();
}