Mercurial > mm7
diff UI/UISaveLoad.cpp @ 1739:1776d4f033a7
WeaponShop cleared
author | Ritor1 |
---|---|
date | Fri, 27 Sep 2013 15:19:32 +0600 |
parents | 873ac151c38d |
children | c1c74df0a33e |
line wrap: on
line diff
--- a/UI/UISaveLoad.cpp Thu Sep 26 17:39:39 2013 +0600 +++ b/UI/UISaveLoad.cpp Fri Sep 27 15:19:32 2013 +0600 @@ -148,219 +148,178 @@ UI_DrawSaveLoad(true); } - //----- (0045E361) -------------------------------------------------------- void LoadUI_Load(unsigned int uDialogueType) { - unsigned int v1; // ebp@5 - unsigned int v2; // eax@5 - //signed int v3; // ebp@11 - FILE *v4; // eax@14 - FILE *v5; // eax@18 - unsigned int v6; // eax@25 - GUIButton *v7; // eax@27 - const char *v8; // [sp-8h] [bp-26Ch]@25 - //char *v9; // [sp-4h] [bp-268h]@19 - enum TEXTURE_TYPE v10; // [sp-4h] [bp-268h]@25 - unsigned int uDialogueType_; // [sp+10h] [bp-254h]@1 - //RGBTexture *pTex; // [sp+10h] [bp-254h]@12 - //SavegameHeader *Dest; // [sp+14h] [bp-250h]@12 - //const char *Str1; // [sp+18h] [bp-24Ch]@12 - LODWriteableFile pLODFile; // [sp+1Ch] [bp-248h]@1 - int v16; // [sp+260h] [bp-4h]@1 + LODWriteableFile pLODFile; // [sp+1Ch] [bp-248h]@1 - uDialogueType_ = uDialogueType; - dword_6BE138 = -1; - pIcons_LOD->_inlined_sub2(); + dword_6BE138 = -1; + pIcons_LOD->_inlined_sub2(); - memset(pSavegameUsedSlots.data(), 0, sizeof(pSavegameUsedSlots)); - memset(pSavegameThumbnails.data(), 0, 45 * sizeof(RGBTexture)); - uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE); - uTextureID_load_up = pIcons_LOD->LoadTexture("load_up", TEXTURE_16BIT_PALETTE); - uTextureID_save_up = pIcons_LOD->LoadTexture("save_up", TEXTURE_16BIT_PALETTE); - uTextureID_LS_loadU = pIcons_LOD->LoadTexture("LS_loadU", TEXTURE_16BIT_PALETTE); - uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE); - uTextureID_x_u = pIcons_LOD->LoadTexture("x_u", TEXTURE_16BIT_PALETTE); - if ( uDialogueType_ ) - { - pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_loadsave)); - if ( pCurrentScreen == SCREEN_SAVEGAME ) - { - v1 = uTextureID_save_up; - v2 = uTextureID_LS_saveU; - } - else - { - v1 = uTextureID_load_up; - v2 = uTextureID_LS_loadU; - } - pRenderer->DrawTextureIndexed(241, 302, pIcons_LOD->GetTexture(v2)); - pRenderer->DrawTextureIndexed( 18, 141, pIcons_LOD->GetTexture(v1)); - pRenderer->DrawTextureIndexed(351, 302, pIcons_LOD->GetTexture(uTextureID_x_u)); - } + memset(pSavegameUsedSlots.data(), 0, sizeof(pSavegameUsedSlots)); + memset(pSavegameThumbnails.data(), 0, 45 * sizeof(RGBTexture)); + uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE); + uTextureID_load_up = pIcons_LOD->LoadTexture("load_up", TEXTURE_16BIT_PALETTE); + uTextureID_save_up = pIcons_LOD->LoadTexture("save_up", TEXTURE_16BIT_PALETTE); + uTextureID_LS_loadU = pIcons_LOD->LoadTexture("LS_loadU", TEXTURE_16BIT_PALETTE); + uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE); + uTextureID_x_u = pIcons_LOD->LoadTexture("x_u", TEXTURE_16BIT_PALETTE); + if ( uDialogueType ) + { + pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_loadsave)); + if ( pCurrentScreen == SCREEN_SAVEGAME ) + { + pRenderer->DrawTextureIndexed(241, 302, pIcons_LOD->GetTexture(uTextureID_LS_saveU)); + pRenderer->DrawTextureIndexed( 18, 141, pIcons_LOD->GetTexture(uTextureID_save_up)); + } else - { - pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX); - } - pGUIWindow_CurrentMenu = GUIWindow::Create(saveload_dlg_xs[uDialogueType_], saveload_dlg_ys[uDialogueType_], saveload_dlg_zs[uDialogueType_], - saveload_dlg_ws[uDialogueType_], WINDOW_MainMenu_Load, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0);// "Reading..." - pRenderer->Present(); - pSavegameList->Initialize(0); - if ( pSaveListPosition > (signed int)uNumSavegameFiles ) - { - pSaveListPosition = 0; - uLoadGameUI_SelectedSlot = 0; - } - pLODFile.AllocSubIndicesAndIO(0x12C, 0); - Assert(sizeof(SavegameHeader) == 0x64); - //v3 = 0; - for (uint i = 0; i < uNumSavegameFiles; ++i) - { + { + pRenderer->DrawTextureIndexed(241, 302, pIcons_LOD->GetTexture(uTextureID_LS_loadU)); + pRenderer->DrawTextureIndexed( 18, 141, pIcons_LOD->GetTexture(uTextureID_load_up)); + } + pRenderer->DrawTextureIndexed(351, 302, pIcons_LOD->GetTexture(uTextureID_x_u)); + } + else + pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX); + pGUIWindow_CurrentMenu = GUIWindow::Create(saveload_dlg_xs[uDialogueType], saveload_dlg_ys[uDialogueType], saveload_dlg_zs[uDialogueType], + saveload_dlg_ws[uDialogueType], WINDOW_MainMenu_Load, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0);// "Reading..." + pRenderer->Present(); + pSavegameList->Initialize(0); + if ( pSaveListPosition > (signed int)uNumSavegameFiles ) + { + pSaveListPosition = 0; + uLoadGameUI_SelectedSlot = 0; + } + pLODFile.AllocSubIndicesAndIO(300, 0); + Assert(sizeof(SavegameHeader) == 100); + for (uint i = 0; i < uNumSavegameFiles; ++i) + { + sprintf(pTmpBuf.data(), "saves\\%s", pSavegameList->pFileList[i].pSaveFileName); + if (_access(pTmpBuf.data(), 6)) + { + pSavegameUsedSlots[i] = 0; + strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[72]); // "Empty" + continue; + } + pLODFile.LoadFile(pTmpBuf.data(), 1); + if ( pLODFile.FindContainer("header.bin", true) ) + fread(&pSavegameHeader[i], 100, 1, pLODFile.FindContainer("header.bin", true)); + if ( !_stricmp(pSavegameList->pFileList[i].pSaveFileName, pGlobalTXT_LocalizationStrings[613]) )// "AutoSave.MM7" + strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[16]);// "Autosave" + if ( !pLODFile.FindContainer("image.pcx", true) ) + { + pSavegameUsedSlots[i] = 0; + strcpy(pSavegameList->pFileList[i].pSaveFileName, ""); + } + else + { + pSavegameThumbnails[i].LoadFromFILE(pLODFile.FindContainer("image.pcx", true), 0, true); + pLODFile.CloseWriteFile(); + pSavegameUsedSlots[i] = 1; + } + } - sprintf(pTmpBuf.data(), "saves\\%s", pSavegameList->pFileList[i].pSaveFileName); - if (_access(pTmpBuf.data(), 6)) - { - pSavegameUsedSlots[i] = 0; - strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[72]); // "Empty" - continue; - } - pLODFile.LoadFile(pTmpBuf.data(), 1); - v4 = pLODFile.FindContainer("header.bin", true); - if ( v4 ) - fread(&pSavegameHeader[i], 0x64, 1, v4); - if ( !_stricmp(pSavegameList->pFileList[i].pSaveFileName, pGlobalTXT_LocalizationStrings[613]) )// "AutoSave.MM7" - strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[16]);// "Autosave" - v5 = pLODFile.FindContainer("image.pcx", true); - if ( !v5 ) - { - pSavegameUsedSlots[i] = 0; - strcpy(pSavegameList->pFileList[i].pSaveFileName, ""); - } - else - { - pSavegameThumbnails[i].LoadFromFILE(v5, 0, true); - pLODFile.CloseWriteFile(); - pSavegameUsedSlots[i] = 1; - } - } - - //LABEL_24: - pLODFile.FreeSubIndexAndIO(); - if ( pCurrentScreen == SCREEN_SAVEGAME ) - { - uTextureID_x_d = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE); - uTextureID_LS_ = pIcons_LOD->LoadTexture("LS_saveD",TEXTURE_16BIT_PALETTE); - } - else - { - uTextureID_x_d = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE); - uTextureID_LS_ = pIcons_LOD->LoadTexture("LS_loadD",TEXTURE_16BIT_PALETTE); - } - uTextureID_AR_UP_DN = pIcons_LOD->LoadTexture("AR_UP_DN", TEXTURE_16BIT_PALETTE); - uTextureID_AR_DN_DN = pIcons_LOD->LoadTexture("AR_DN_DN", TEXTURE_16BIT_PALETTE); - pGUIWindow_CurrentMenu->CreateButton(21, 198, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 0, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(21, 219, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 1, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(21, 240, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 2, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(21, 261, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 3, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(21, 282, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 4, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(21, 303, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 5, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(21, 324, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 6, 0, "", 0); - pBtnLoadSlot = pGUIWindow_CurrentMenu->CreateButton(241, 302, 105, 40, 1, 0, UIMSG_SaveLoadBtn, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_LS_), 0); - pBtnCancel = pGUIWindow_CurrentMenu->CreateButton(350, 302, 105, 40, 1, 0, UIMSG_Cancel, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_x_d), 0); - pBtnArrowUp = pGUIWindow_CurrentMenu->CreateButton(215, 199, 17, 17, 1, 0, UIMSG_ArrowUp, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_AR_UP_DN), 0); - pBtnDownArrow = pGUIWindow_CurrentMenu->CreateButton(215, 323, 17, 17, 1, 0, UIMSG_DownArrow, uNumSavegameFiles, 0, "", pIcons_LOD->GetTexture(uTextureID_AR_DN_DN), 0); + pLODFile.FreeSubIndexAndIO(); + if ( pCurrentScreen == SCREEN_SAVEGAME ) + { + uTextureID_x_d = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE); + uTextureID_LS_ = pIcons_LOD->LoadTexture("LS_saveD",TEXTURE_16BIT_PALETTE); + } + else + { + uTextureID_x_d = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE); + uTextureID_LS_ = pIcons_LOD->LoadTexture("LS_loadD",TEXTURE_16BIT_PALETTE); + } + uTextureID_AR_UP_DN = pIcons_LOD->LoadTexture("AR_UP_DN", TEXTURE_16BIT_PALETTE); + uTextureID_AR_DN_DN = pIcons_LOD->LoadTexture("AR_DN_DN", TEXTURE_16BIT_PALETTE); + pGUIWindow_CurrentMenu->CreateButton(21, 198, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 0, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(21, 219, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 1, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(21, 240, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 2, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(21, 261, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 3, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(21, 282, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 4, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(21, 303, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 5, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(21, 324, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 6, 0, "", 0); + pBtnLoadSlot = pGUIWindow_CurrentMenu->CreateButton(241, 302, 105, 40, 1, 0, UIMSG_SaveLoadBtn, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_LS_), 0); + pBtnCancel = pGUIWindow_CurrentMenu->CreateButton(350, 302, 105, 40, 1, 0, UIMSG_Cancel, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_x_d), 0); + pBtnArrowUp = pGUIWindow_CurrentMenu->CreateButton(215, 199, 17, 17, 1, 0, UIMSG_ArrowUp, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_AR_UP_DN), 0); + pBtnDownArrow = pGUIWindow_CurrentMenu->CreateButton(215, 323, 17, 17, 1, 0, UIMSG_DownArrow, uNumSavegameFiles, 0, "", pIcons_LOD->GetTexture(uTextureID_AR_DN_DN), 0); } //----- (0045E93E) -------------------------------------------------------- void SaveUI_Load() { - unsigned int v0; // ebp@4 - unsigned int v1; // eax@4 - char *v3; // eax@7 - FILE *v4; // eax@11 - FILE *v5; // eax@11 - LODWriteableFile v11; // [sp+1Ch] [bp-248h]@1 + char *v3; // eax@7 + LODWriteableFile pLODFile; // [sp+1Ch] [bp-248h]@1 - ++pIcons_LOD->uTexturePacksCount; - if ( !pIcons_LOD->uNumPrevLoadedFiles ) - pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; - memset(pSavegameUsedSlots.data(), 0, 0xB4u); - memset(&pSavegameThumbnails, 0, 0x708u); - uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE); - uTextureID_load_up = pIcons_LOD->LoadTexture("load_up", TEXTURE_16BIT_PALETTE); - uTextureID_save_up = pIcons_LOD->LoadTexture("save_up", TEXTURE_16BIT_PALETTE); - uTextureID_LS_loadU = pIcons_LOD->LoadTexture("LS_loadU", TEXTURE_16BIT_PALETTE); - uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE); - uTextureID_x_u = pIcons_LOD->LoadTexture("x_u", TEXTURE_16BIT_PALETTE); - pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_loadsave)); - if ( pCurrentScreen == SCREEN_SAVEGAME ) + ++pIcons_LOD->uTexturePacksCount; + if ( !pIcons_LOD->uNumPrevLoadedFiles ) + pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; + memset(pSavegameUsedSlots.data(), 0, 0xB4u); + memset(&pSavegameThumbnails, 0, 0x708u); + uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE); + uTextureID_load_up = pIcons_LOD->LoadTexture("load_up", TEXTURE_16BIT_PALETTE); + uTextureID_save_up = pIcons_LOD->LoadTexture("save_up", TEXTURE_16BIT_PALETTE); + uTextureID_LS_loadU = pIcons_LOD->LoadTexture("LS_loadU", TEXTURE_16BIT_PALETTE); + uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE); + uTextureID_x_u = pIcons_LOD->LoadTexture("x_u", TEXTURE_16BIT_PALETTE); + pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_loadsave)); + if ( pCurrentScreen == SCREEN_SAVEGAME ) + { + pRenderer->DrawTextureIndexed(241, 302, pIcons_LOD->GetTexture(uTextureID_LS_saveU)); + pRenderer->DrawTextureIndexed(351, 302, pIcons_LOD->GetTexture(uTextureID_x_u)); + pRenderer->DrawTextureIndexed(18, 141, pIcons_LOD->GetTexture(uTextureID_save_up)); + } + else + { + pRenderer->DrawTextureIndexed(241, 302, pIcons_LOD->GetTexture(uTextureID_LS_loadU)); + pRenderer->DrawTextureIndexed(351, 302, pIcons_LOD->GetTexture(uTextureID_x_u)); + pRenderer->DrawTextureIndexed(18, 141, pIcons_LOD->GetTexture(uTextureID_load_up)); + } + pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0);//Read...(Чтение...) + pRenderer->Present(); + pSavegameList->Initialize(1); + pLODFile.AllocSubIndicesAndIO(300, 0); + for (uint i = 0; i < 40; ++i) + { + v3 = pSavegameList->pFileList[i].pSaveFileName; + if ( !*pSavegameList->pFileList[i].pSaveFileName ) + v3 = "1.mm7"; + sprintf(pTmpBuf.data(), "saves\\%s", v3); + if ( _access(pTmpBuf.data(), 0) || _access(pTmpBuf.data(), 6) ) { - v0 = uTextureID_save_up; - v1 = uTextureID_LS_saveU; - } + pSavegameUsedSlots[i] = 0; + strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[LOCSTR_EMPTY]); + } else { - v0 = uTextureID_load_up; - v1 = uTextureID_LS_loadU; - } - pRenderer->DrawTextureIndexed(0xF1u, 0x12Eu, pIcons_LOD->GetTexture(v1)); - pRenderer->DrawTextureIndexed(0x15Fu, 0x12Eu, pIcons_LOD->GetTexture(uTextureID_x_u)); - pRenderer->DrawTextureIndexed(0x12u, 0x8Du, pIcons_LOD->GetTexture(v0)); - pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0); - pRenderer->Present(); - pSavegameList->Initialize(1u); - v11.AllocSubIndicesAndIO(0x12Cu, 0); - //v2 = pSavegameUsedSlots; - // Dest = pSavegameHeader; - // this_ = pSavegameThumbnails; - // v8 = (char *)pSavegameList->pSavesNames; - for (uint i = 0; i < 40; ++i) - { - v3 = pSavegameList->pFileList[i].pSaveFileName; - if ( !*pSavegameList->pFileList[i].pSaveFileName ) - v3 = "1.mm7"; - sprintf(pTmpBuf.data(), "saves\\%s", v3); - if ( _access(pTmpBuf.data(), 0) || _access(pTmpBuf.data(), 6) ) - { - pSavegameUsedSlots[i] = 0; - strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[LOCSTR_EMPTY]); - } - else - { - v11.LoadFile(pTmpBuf.data(), 1); - v4 = v11.FindContainer("header.bin", 1); - fread(&pSavegameHeader[i], 100, 1u, v4); - v5 = v11.FindContainer("image.pcx", 1); - if ( v5 ) - { - pSavegameThumbnails[i].LoadFromFILE(v5, 0, 1u); - v11.CloseWriteFile(); - pSavegameUsedSlots[i] = 1; - } - else - { - pSavegameUsedSlots[i] = 0; - } - } - - } - - v11.FreeSubIndexAndIO(); - uTextureID_x_d = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE); - uTextureID_LS_ = pIcons_LOD->LoadTexture("LS_saveD", TEXTURE_16BIT_PALETTE); - uTextureID_AR_UP_DN = pIcons_LOD->LoadTexture("AR_UP_DN", TEXTURE_16BIT_PALETTE); - uTextureID_AR_DN_DN = pIcons_LOD->LoadTexture("AR_DN_DN", TEXTURE_16BIT_PALETTE); - pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SaveLoadButtons, 0, 0); - pGUIWindow_CurrentMenu->CreateButton(21, 198, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 0, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(21, 218, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 1, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(21, 238, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 2, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(21, 258, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 3, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(21, 278, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 4, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(21, 298, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 5, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(21, 318, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 6, 0, "", 0); - pBtnLoadSlot = pGUIWindow_CurrentMenu->CreateButton(241, 302, 105, 40, 1, 0, UIMSG_SaveLoadBtn, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_LS_), 0); - pBtnCancel = pGUIWindow_CurrentMenu->CreateButton(350, 302, 105, 40, 1, 0, UIMSG_Cancel, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_x_d), 0); - pBtnArrowUp = pGUIWindow_CurrentMenu->CreateButton(215, 199, 17, 17, 1, 0, UIMSG_ArrowUp, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_AR_UP_DN), 0); - pBtnDownArrow = pGUIWindow_CurrentMenu->CreateButton(215, 323, 17, 17, 1, 0, UIMSG_DownArrow, 34, 0, "", pIcons_LOD->GetTexture(uTextureID_AR_DN_DN), 0); -} + pLODFile.LoadFile(pTmpBuf.data(), 1); + fread(&pSavegameHeader[i], 100, 1, pLODFile.FindContainer("header.bin", 1)); + if ( pLODFile.FindContainer("image.pcx", 1) ) + { + pSavegameThumbnails[i].LoadFromFILE(pLODFile.FindContainer("image.pcx", 1), 0, 1); + pLODFile.CloseWriteFile(); + pSavegameUsedSlots[i] = 1; + } + else + pSavegameUsedSlots[i] = 0; + } + } + pLODFile.FreeSubIndexAndIO(); + uTextureID_x_d = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE); + uTextureID_LS_ = pIcons_LOD->LoadTexture("LS_saveD", TEXTURE_16BIT_PALETTE); + uTextureID_AR_UP_DN = pIcons_LOD->LoadTexture("AR_UP_DN", TEXTURE_16BIT_PALETTE); + uTextureID_AR_DN_DN = pIcons_LOD->LoadTexture("AR_DN_DN", TEXTURE_16BIT_PALETTE); + pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SaveLoadButtons, 0, 0); + pGUIWindow_CurrentMenu->CreateButton(21, 198, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 0, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(21, 218, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 1, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(21, 238, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 2, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(21, 258, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 3, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(21, 278, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 4, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(21, 298, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 5, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(21, 318, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 6, 0, "", 0); + pBtnLoadSlot = pGUIWindow_CurrentMenu->CreateButton(241, 302, 105, 40, 1, 0, UIMSG_SaveLoadBtn, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_LS_), 0); + pBtnCancel = pGUIWindow_CurrentMenu->CreateButton(350, 302, 105, 40, 1, 0, UIMSG_Cancel, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_x_d), 0); + pBtnArrowUp = pGUIWindow_CurrentMenu->CreateButton(215, 199, 17, 17, 1, 0, UIMSG_ArrowUp, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_AR_UP_DN), 0); + pBtnDownArrow = pGUIWindow_CurrentMenu->CreateButton(215, 323, 17, 17, 1, 0, UIMSG_DownArrow, 34, 0, "", pIcons_LOD->GetTexture(uTextureID_AR_DN_DN), 0); +} \ No newline at end of file