annotate UI/UIRest.cpp @ 2440:2b10278bc7ac

some more memory access fixed
author Grumpy7
date Thu, 24 Jul 2014 01:10:50 +0200
parents f4af3b203f65
children 104fdbea0386
rev   line source
2415
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2340
diff changeset
1 #define _CRTDBG_MAP_ALLOC
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2340
diff changeset
2 #include <stdlib.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2340
diff changeset
3 #include <crtdbg.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2340
diff changeset
4
2253
aff7a7b072b7 adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents: 2215
diff changeset
5 #define _CRT_SECURE_NO_WARNINGS
2336
d6887ee81068 header file include cleanup
Grumpy7
parents: 2253
diff changeset
6 #include "..\mm7_unsorted_subs.h"
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
7 #include "..\GUIWindow.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
8 #include "..\GUIFont.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
9 #include "..\Party.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
10 #include "..\AudioPlayer.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
11 #include "..\Outdoor.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
12 #include "..\LOD.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
13 #include "..\Viewport.h"
2044
28cb79ae2f6f Time.h rename
Ritor1
parents: 1713
diff changeset
14 #include "..\Timer.h"
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
15 #include "..\texts.h"
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
16
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
17 #include "..\mm7_data.h"
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
18
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
20
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
21 //----- (0041F6C1) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
22 void RestUI_Load()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
23 {
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
24 if ( !dword_506F14 )
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
25 pAudioPlayer->StopChannels(-1, -1);
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
26 if ( pCurrentScreen != SCREEN_GAME)
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
27 {
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
28 pGUIWindow_CurrentMenu->Release();
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
29 pCurrentScreen = SCREEN_GAME;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
30 viewparams->bRedrawGameUI = true;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
31 }
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
32 pEventTimer->Pause();
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
33 if ( dword_506F14 != 2 )
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
34 GUIWindow::Create(518, 450, 0, 0, WINDOW_PressedButton2, (int)pBtn_Rest, 0);
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
35 _506F18_num_minutes_to_sleep = 0;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
36 dword_506F14 = 0;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
37 uRestUI_FoodRequiredToRest = 2;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
38 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
39 uRestUI_FoodRequiredToRest = pOutdoor->GetNumFoodRequiredToRestInCurrentPos(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
40 if ( PartyHasDragon() )
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
41 {
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
42 for ( uint i = 0; i < 4; ++i )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
43 {
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
44 if (pParty->pPlayers[i].classType == PLAYER_CLASS_WARLOCK)
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
45 ++uRestUI_FoodRequiredToRest;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
46 }
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
47 }
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
48 if ( CheckHiredNPCSpeciality(Porter) )
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
49 --uRestUI_FoodRequiredToRest;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
50 if ( CheckHiredNPCSpeciality(QuarterMaster) )
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
51 uRestUI_FoodRequiredToRest -= 2;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
52 if ( CheckHiredNPCSpeciality(Gypsy) )
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
53 --uRestUI_FoodRequiredToRest;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
54 if ( uRestUI_FoodRequiredToRest < 1 )
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
55 uRestUI_FoodRequiredToRest = 1;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
56 if ( !_stricmp(pCurrentMapName, "d29.blv") && _449B57_test_bit(pParty->_quest_bits, 98) )//Замок Хармондейл
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
57 uRestUI_FoodRequiredToRest = 0;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
58
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
59 ++pIcons_LOD->uTexturePacksCount;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
60 if ( !pIcons_LOD->uNumPrevLoadedFiles )
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
61 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
62
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
63 pCurrentScreen = SCREEN_REST;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
64 _507CD4_RestUI_hourglass_anim_controller = 0;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
65 uTextureID_RestUI_restmain = pIcons_LOD->LoadTexture("restmain", TEXTURE_16BIT_PALETTE);
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
66 uTextureID_RestUI_restb1 = pIcons_LOD->LoadTexture("restb1", TEXTURE_16BIT_PALETTE);
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
67 uTextureID_RestUI_restb2 = pIcons_LOD->LoadTexture("restb2", TEXTURE_16BIT_PALETTE);
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
68 uTextureID_RestUI_restb3 = pIcons_LOD->LoadTexture("restb3", TEXTURE_16BIT_PALETTE);
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
69 uTextureID_RestUI_restb4 = pIcons_LOD->LoadTexture("restb4", TEXTURE_16BIT_PALETTE);
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
70 uTextureID_RestUI_restexit = pIcons_LOD->LoadTexture("restexit", TEXTURE_16BIT_PALETTE);
2340
dc822157c98d Moving functions from unsorted_subs.h pt4
Grumpy7
parents: 2336
diff changeset
71 OutdoorLocation::LoadActualSkyFrame();
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2153
diff changeset
72 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Rest, 0, 0);
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
73 pButton_RestUI_Exit = pGUIWindow_CurrentMenu->CreateButton(280, 297, 154, 37, 1, 0, UIMSG_ExitRest, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_RestUI_restexit), 0);
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
74 pButton_RestUI_Main = pGUIWindow_CurrentMenu->CreateButton( 24, 154, 225, 37, 1, 0, UIMSG_Rest8Hour, 0, 'R', "", pIcons_LOD->GetTexture(uTextureID_RestUI_restb4), 0);
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
75 pButton_RestUI_WaitUntilDawn = pGUIWindow_CurrentMenu->CreateButton( 61, 232, 154, 33, 1, 0, UIMSG_AlreadyResting, 0, 'D', "", pIcons_LOD->GetTexture(uTextureID_RestUI_restb1), 0);
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
76 pButton_RestUI_Wait1Hour = pGUIWindow_CurrentMenu->CreateButton( 61, 264, 154, 33, 1, 0, UIMSG_Wait1Hour, 0, 'H', "", pIcons_LOD->GetTexture(uTextureID_RestUI_restb2), 0);
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
77 pButton_RestUI_Wait5Minutes = pGUIWindow_CurrentMenu->CreateButton( 61, 296, 154, 33, 1, 0, UIMSG_Wait5Minutes, 0, 'M', "", pIcons_LOD->GetTexture(uTextureID_RestUI_restb3), 0);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
78 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
79
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
80 //----- (0041FA01) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
81 void RestUI_Draw()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
82 {
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
83 int live_characters; // esi@1
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
84 unsigned int v3; // eax@15
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
85 GUIButton tmp_button; // [sp+8h] [bp-DCh]@19
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
86 unsigned int am_pm_hours; // [sp+D8h] [bp-Ch]@9
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
87
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
88 live_characters = 0;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
89 for( int i = 1; i < 5; ++i )
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
90 if ( !pPlayers[i]->IsDead() && !pPlayers[i]->IsEradicated() && pPlayers[i]->sHealth > 0 )
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
91 ++live_characters;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
92
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
93 if ( live_characters )
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
94 {
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
95 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_RestUI_restmain));
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
96 am_pm_hours = pParty->uCurrentHour;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
97 dword_506F1C = pGUIWindow_CurrentMenu->pCurrentPosActiveItem;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
98 if ( (signed int)pParty->uCurrentHour <= 12 )
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
99 {
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
100 if ( !am_pm_hours )
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
101 am_pm_hours = 12;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
102 }
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
103 else
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
104 am_pm_hours -= 12;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
105 pRenderer->DrawTextureIndexed(16, 26, pTexture_RestUI_CurrentSkyFrame);
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
106 if ( pTexture_RestUI_CurrentHourglassFrame )
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
107 {
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
108 pTexture_RestUI_CurrentHourglassFrame->Release();
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
109 pIcons_LOD->SyncLoadedFilesCount();
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
110 }
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
111 v3 = pEventTimer->uTimeElapsed + _507CD4_RestUI_hourglass_anim_controller;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
112 _507CD4_RestUI_hourglass_anim_controller += pEventTimer->uTimeElapsed;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
113 if ( (unsigned int)_507CD4_RestUI_hourglass_anim_controller >= 512 )
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
114 {
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
115 v3 = 0;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
116 _507CD4_RestUI_hourglass_anim_controller = 0;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
117 }
1713
e013b92030e3 UIRest cleared
Ritor1
parents: 1711
diff changeset
118 hourglass_icon_idx = (int)floorf(((double)v3 / 512.0 * 120.0) + 0.5f) % 256 + 1;
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
119 if (hourglass_icon_idx >= 120 )
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
120 hourglass_icon_idx = 1;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
121
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
122 sprintf(pTmpBuf.data(), "hglas%03d", hourglass_icon_idx);
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
123 pTexture_RestUI_CurrentHourglassFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
124 pRenderer->DrawTextureIndexed(267, 159, pTexture_RestUI_CurrentHourglassFrame);
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
125 memset(&tmp_button, 0, sizeof(GUIButton));
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
126 tmp_button.uX = 24;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
127 tmp_button.uY = 154;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
128 tmp_button.uZ = 194;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
129 tmp_button.uW = 190;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
130 tmp_button.uWidth = 171;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
131 tmp_button.uHeight = 37;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
132 tmp_button.pParent = pButton_RestUI_WaitUntilDawn->pParent;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2044
diff changeset
133 tmp_button.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, Color16(10, 0, 0), Color16(230, 214, 193));//Отдых и лечение 8 часов
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
134 tmp_button.pParent = 0;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
135
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
136 sprintf(pTmpBuf.data(), "\r408%d", uRestUI_FoodRequiredToRest);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2044
diff changeset
137 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, Color16(10, 0, 0), pTmpBuf.data(), 0, 0, Color16(230, 214, 193));
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
138
2069
259df09dfb50 32bits almost there
Nomad
parents: 2044
diff changeset
139 pButton_RestUI_WaitUntilDawn->DrawLabel(pGlobalTXT_LocalizationStrings[237], pFontCreate, Color16(10, 0, 0), Color16(230, 214, 193));//Ждать до рассвета
259df09dfb50 32bits almost there
Nomad
parents: 2044
diff changeset
140 pButton_RestUI_Wait1Hour->DrawLabel(pGlobalTXT_LocalizationStrings[239], pFontCreate, Color16(10, 0, 0), Color16(230, 214, 193));//Ждать 1 час
259df09dfb50 32bits almost there
Nomad
parents: 2044
diff changeset
141 pButton_RestUI_Wait5Minutes->DrawLabel(pGlobalTXT_LocalizationStrings[238], pFontCreate, Color16(10, 0, 0), Color16(230, 214, 193));//Ждать 5 минут
259df09dfb50 32bits almost there
Nomad
parents: 2044
diff changeset
142 pButton_RestUI_Exit->DrawLabel(pGlobalTXT_LocalizationStrings[81], pFontCreate, Color16(10, 0, 0), Color16(230, 214, 193));//Закончить отдыхать
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
143 memset(&tmp_button, 0, sizeof(GUIButton));
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
144 tmp_button.uX = 45;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
145 tmp_button.uY = 199;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
146
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
147 tmp_button.uZ = 229;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
148 tmp_button.uW = 228;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
149
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
150 tmp_button.uWidth = 185;
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
151 tmp_button.uHeight = 30;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
152
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
153 tmp_button.pParent = pButton_RestUI_WaitUntilDawn->pParent;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2044
diff changeset
154 tmp_button.DrawLabel(pGlobalTXT_LocalizationStrings[236], pFontCreate, Color16(10, 0, 0), Color16(230, 214, 193));//Ждать без лечения
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
155 tmp_button.pParent = 0;
1713
e013b92030e3 UIRest cleared
Ritor1
parents: 1711
diff changeset
156 sprintf(pTmpBuf.data(), "%d:%02d %s", am_pm_hours, pParty->uCurrentMinute, aAMPMNames[(pParty->uCurrentHour >= 12 && pParty->uCurrentHour < 24)? 1:0]);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2044
diff changeset
157 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 368, 168, Color16(10, 0, 0), pTmpBuf.data(), 0, 0, Color16(230, 214, 193));
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
158 sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[56], pParty->uDaysPlayed + 1);//День
2069
259df09dfb50 32bits almost there
Nomad
parents: 2044
diff changeset
159 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 190, Color16(10, 0, 0), pTmpBuf.data(), 0, 0, Color16(230, 214, 193));
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
160 sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[146], pParty->uCurrentMonth + 1);//Месяц
2069
259df09dfb50 32bits almost there
Nomad
parents: 2044
diff changeset
161 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 222, Color16(10, 0, 0), pTmpBuf.data(), 0, 0, Color16(230, 214, 193));
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
162 sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear);//Год
2069
259df09dfb50 32bits almost there
Nomad
parents: 2044
diff changeset
163 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 254, Color16(10, 0, 0), pTmpBuf.data(), 0, 0, Color16(230, 214, 193));
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
164 if ( dword_506F14 )
2340
dc822157c98d Moving functions from unsorted_subs.h pt4
Grumpy7
parents: 2336
diff changeset
165 Party::Sleep6Hours();
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
166 }
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
167 else
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
168 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn,
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
169 (int)pButton_RestUI_Exit, pGlobalTXT_LocalizationStrings[81]); // "Exit Rest"
1711
69efd5d1ab5c RestUI_Draw()
Ritor1
parents: 1545
diff changeset
170 }