Mercurial > mm7
view GUI/UI/UIBooks.cpp @ 2553:48708da03b7f
Party Creation UI logic separated from MainMenu
author | a.parshin |
---|---|
date | Wed, 13 May 2015 02:20:05 +0200 |
parents | 3121fb54a110 |
children | dd36326a9994 |
line wrap: on
line source
#define _CRTDBG_MAP_ALLOC #define _CRT_SECURE_NO_WARNINGS #include <stdlib.h> #include <crtdbg.h> #include "Engine/Engine.h" #include "Engine/Graphics/Render.h" #include "Engine/LOD.h" #include "Engine/texts.h" #include "Engine/Awards.h" #include "GUI/GUIFont.h" #include "GUI/UI/UIBooks.h" #include "Media/Audio/AudioPlayer.h" //----- (00411597) -------------------------------------------------------- void GUIWindow_Book::Release() { // ----------------------------------------- // 0041C26A void GUIWindow::Release --- part free(pSpellFont); pSpellFont = nullptr; free(pBookFont); pBookFont = nullptr; free(pBook2Font); pBook2Font = nullptr; free(pAutonoteFont); pAutonoteFont = nullptr; pTexture_mapbordr->Release(); pAudioPlayer->PlaySound(SOUND_closebook, 0, 0, -1, 0, 0, 0, 0); pIcons_LOD->RemoveTexturesPackFromTextureList(); dword_506364 = 0; GUIWindow::Release(); } GUIWindow_Book::GUIWindow_Book() : GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr) { } void GUIWindow_Book::BasicBookInitialization() { // ----- (00411BFC) -------------------------------------------------------- // void GUIWindow::InitializeBookView() --- part // { pAudioPlayer->StopChannels(-1, -1); InitializeFonts(); CreateButton(475, 445, 158, 34, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], 0); // Close current_screen_type = SCREEN_BOOKS; full_num_items_in_book = 0; books_primary_item_per_page = 0; books_page_number = 0; num_achieved_awards = 0; } //----- (00411AAA) -------------------------------------------------------- void GUIWindow_Book::InitializeFonts() { pAudioPlayer->StopChannels(-1, -1); ++pIcons_LOD->uTexturePacksCount; if (!pIcons_LOD->uNumPrevLoadedFiles) pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; pAudioPlayer->PlaySound(SOUND_openbook, 0, 0, -1, 0, 0, 0, 0); pTexture_mapbordr = pIcons_LOD->LoadTexturePtr("mapbordr", TEXTURE_16BIT_PALETTE); pBookFont = LoadFont("book.fnt", "FONTPAL", NULL); pBook2Font = LoadFont("book2.fnt", "FONTPAL", NULL); pAutonoteFont = LoadFont("autonote.fnt", "FONTPAL", NULL); pSpellFont = LoadFont("spell.fnt", "FONTPAL", NULL); } //----- (0041140B) -------------------------------------------------------- void OnCloseSpellBookPage() { GUIButton *pNextButton; // esi@4 for ( uint i = 1; i <= 11; i++ ) { SBPageCSpellsTextureList[i]->Release(); SBPageSSpellsTextureList[i]->Release(); } pIcons_LOD->SyncLoadedFilesCount(); if ( pGUIWindow_CurrentMenu->pControlsHead ) { do { pNextButton = pGUIWindow_CurrentMenu->pControlsHead->pNext; free(pGUIWindow_CurrentMenu->pControlsHead); pGUIWindow_CurrentMenu->pControlsHead = pNextButton; } while ( pNextButton ); } pGUIWindow_CurrentMenu->pControlsHead = 0; pGUIWindow_CurrentMenu->pControlsTail = 0; pGUIWindow_CurrentMenu->uNumControls = 0; }