comparison GUI/UI/UICharacter.cpp @ 2544:c674d547cc7c

GUIWindow switch logic refactored into behaviour classes
author a.parshin
date Mon, 11 May 2015 09:51:04 +0200
parents bacf9809126a
children fed97f15d1e1
comparison
equal deleted inserted replaced
2543:b6140dfeac27 2544:c674d547cc7c
414 pAudioPlayer->StopChannels(-1, -1); 414 pAudioPlayer->StopChannels(-1, -1);
415 bRingsShownInCharScreen = false; 415 bRingsShownInCharScreen = false;
416 CharacterUI_LoadPaperdollTextures(); 416 CharacterUI_LoadPaperdollTextures();
417 current_screen_type = screen; 417 current_screen_type = screen;
418 418
419 auto wnd = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_CharacterRecord, uActiveCharacter, 0); 419 auto wnd = new GUIWindow_CharacterRecord(0, 0, window->GetWidth(), window->GetHeight(), uActiveCharacter, 0);
420 pCharacterScreen_StatsBtn = wnd->CreateButton(pViewport->uViewportTL_X + 12, pViewport->uViewportTL_Y + 308, 420 pCharacterScreen_StatsBtn = wnd->CreateButton(pViewport->uViewportTL_X + 12, pViewport->uViewportTL_Y + 308,
421 pIcons_LOD->GetTexture(papredoll_dbrds[9])->uTextureWidth, 421 pIcons_LOD->GetTexture(papredoll_dbrds[9])->uTextureWidth,
422 pIcons_LOD->GetTexture(papredoll_dbrds[9])->uTextureHeight, 422 pIcons_LOD->GetTexture(papredoll_dbrds[9])->uTextureHeight,
423 1, 0, UIMSG_ClickStatsBtn, 0, 'S', pGlobalTXT_LocalizationStrings[216],// Stats 423 1, 0, UIMSG_ClickStatsBtn, 0, 'S', pGlobalTXT_LocalizationStrings[216],// Stats
424 pIcons_LOD->GetTexture(papredoll_dbrds[10]), 424 pIcons_LOD->GetTexture(papredoll_dbrds[10]),
470 pEventTimer->Pause(); 470 pEventTimer->Pause();
471 pAudioPlayer->StopChannels(-1, -1); 471 pAudioPlayer->StopChannels(-1, -1);
472 bRingsShownInCharScreen = 0; 472 bRingsShownInCharScreen = 0;
473 CharacterUI_LoadPaperdollTextures(); 473 CharacterUI_LoadPaperdollTextures();
474 current_screen_type = SCREEN_CASTING; 474 current_screen_type = SCREEN_CASTING;
475 CS_inventory_window = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_CastSpell_InInventory, (int)this, 0); 475 CS_inventory_window = new GUIWindow_Inventory_CastSpell(0, 0, window->GetWidth(), window->GetHeight(), (int)this, 0);
476 pCharacterScreen_ExitBtn = CS_inventory_window->CreateButton(394, 318, 75, 33, 1, 0, UIMSG_ClickExitCharacterWindowBtn, 0, 0, 476 pCharacterScreen_ExitBtn = CS_inventory_window->CreateButton(394, 318, 75, 33, 1, 0, UIMSG_ClickExitCharacterWindowBtn, 0, 0,
477 pGlobalTXT_LocalizationStrings[79], // Close 477 pGlobalTXT_LocalizationStrings[79], // Close
478 pIcons_LOD->GetTexture(papredoll_dbrds[2]), 478 pIcons_LOD->GetTexture(papredoll_dbrds[2]),
479 pIcons_LOD->GetTexture(papredoll_dbrds[1]), 0); 479 pIcons_LOD->GetTexture(papredoll_dbrds[1]), 0);
480 CS_inventory_window->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, UIMSG_InventoryLeftClick, 0, 0, "", 0); 480 CS_inventory_window->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, UIMSG_InventoryLeftClick, 0, 0, "", 0);
693 693
694 //----- (0041ABFD) -------------------------------------------------------- 694 //----- (0041ABFD) --------------------------------------------------------
695 void CharacterUI_CharacterScreen_Draw(Player *player) 695 void CharacterUI_CharacterScreen_Draw(Player *player)
696 { 696 {
697 pRenderer->ClearZBuffer(0, 479); 697 pRenderer->ClearZBuffer(0, 479);
698 switch (pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0]) 698 switch (current_character_screen_window)
699 { 699 {
700 case WINDOW_CharacterWindow_Stats: // stats 700 case WINDOW_CharacterWindow_Stats: // stats
701 CharacterUI_ReleaseButtons(); 701 CharacterUI_ReleaseButtons();
702 ReleaseAwardsScrollBar(); 702 ReleaseAwardsScrollBar();
703 CharacterUI_StatsTab_Draw(player); 703 CharacterUI_StatsTab_Draw(player);