annotate UI/UIRest.cpp @ 1566:1e5086f7d401

undoing 1481
author Grumpy7
date Sun, 08 Sep 2013 04:11:10 +0200
parents c4ab816fcc5e
children 69efd5d1ab5c
rev   line source
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1 #ifdef _MSC_VER
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3 #endif
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
5 #include "..\GUIWindow.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
6 #include "..\GUIFont.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
7 #include "..\Party.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
8 #include "..\AudioPlayer.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
9 #include "..\Outdoor.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
10 #include "..\LOD.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
11 #include "..\Viewport.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
12 #include "..\Time.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
13 #include "..\texts.h"
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
14
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
15 #include "..\mm7_data.h"
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
18
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
19 //----- (0041F6C1) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
20 void RestUI_Load()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
21 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
22 Player *v0; // eax@10
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
24 if ( !dword_506F14 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
25 pAudioPlayer->StopChannels(-1, -1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
26 if ( pCurrentScreen != SCREEN_GAME)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
27 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
28 pGUIWindow_CurrentMenu->Release();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
29 pCurrentScreen = SCREEN_GAME;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
30 viewparams->bRedrawGameUI = true;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
31 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
32 pEventTimer->Pause();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
33 if ( dword_506F14 != 2 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
34 GUIWindow::Create(518, 450, 0, 0, WINDOW_PressedButton2, (int)pBtn_Rest, 0);
1396
e6908823897f Research on #62
Nomad
parents: 1362
diff changeset
35 _506F18_num_minutes_to_sleep = 0;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
36 dword_506F14 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
37 uRestUI_FoodRequiredToRest = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
38 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
39 uRestUI_FoodRequiredToRest = pOutdoor->GetNumFoodRequiredToRestInCurrentPos(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
40 if ( PartyHasDragon() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
41 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
42 v0 = pParty->pPlayers;//[0].uClass;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
43 while ( v0 <= &pParty->pPlayers[3] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
44 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
45 ++v0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
46 if ( v0 > &pParty->pPlayers[3] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
47 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
48 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
49 if(v0->classType == PLAYER_CLASS_WARLOCK)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
50 ++uRestUI_FoodRequiredToRest;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
51 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
52 if ( CheckHiredNPCSpeciality(Porter) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
53 --uRestUI_FoodRequiredToRest;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
54 if ( CheckHiredNPCSpeciality(QuarterMaster) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
55 uRestUI_FoodRequiredToRest -= 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
56 if ( CheckHiredNPCSpeciality(Gypsy) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
57 --uRestUI_FoodRequiredToRest;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
58 if ( uRestUI_FoodRequiredToRest < 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
59 uRestUI_FoodRequiredToRest = 1;
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1396
diff changeset
60 if ( !_stricmp(pCurrentMapName, "d29.blv") && _449B57_test_bit(pParty->_quest_bits, 98) )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
61 uRestUI_FoodRequiredToRest = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
63 ++pIcons_LOD->uTexturePacksCount;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
64 if ( !pIcons_LOD->uNumPrevLoadedFiles )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
65 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
66
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
67 pCurrentScreen = SCREEN_REST;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
68 _507CD4_RestUI_hourglass_anim_controller = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
69 uTextureID_RestUI_restmain = pIcons_LOD->LoadTexture("restmain", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
70 uTextureID_RestUI_restb1 = pIcons_LOD->LoadTexture("restb1", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
71 uTextureID_RestUI_restb2 = pIcons_LOD->LoadTexture("restb2", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
72 uTextureID_RestUI_restb3 = pIcons_LOD->LoadTexture("restb3", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
73 uTextureID_RestUI_restb4 = pIcons_LOD->LoadTexture("restb4", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
74 uTextureID_RestUI_restexit = pIcons_LOD->LoadTexture("restexit", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
75
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
76 LoadActualSkyFrame();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
77
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
78 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Rest, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
79 pButton_RestUI_Exit = pGUIWindow_CurrentMenu->CreateButton(280, 297, 154, 37, 1, 0, UIMSG_ExitRest, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_RestUI_restexit), 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
80 pButton_RestUI_Main = pGUIWindow_CurrentMenu->CreateButton( 24, 154, 225, 37, 1, 0, UIMSG_Rest8Hour, 0, 'R', "", pIcons_LOD->GetTexture(uTextureID_RestUI_restb4), 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
81 pButton_RestUI_WaitUntilDawn = pGUIWindow_CurrentMenu->CreateButton( 61, 232, 154, 33, 1, 0, UIMSG_AlreadyResting, 0, 'D', "", pIcons_LOD->GetTexture(uTextureID_RestUI_restb1), 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
82 pButton_RestUI_Wait1Hour = pGUIWindow_CurrentMenu->CreateButton( 61, 264, 154, 33, 1, 0, UIMSG_Wait1Hour, 0, 'H', "", pIcons_LOD->GetTexture(uTextureID_RestUI_restb2), 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
83 pButton_RestUI_Wait5Minutes = pGUIWindow_CurrentMenu->CreateButton( 61, 296, 154, 33, 1, 0, UIMSG_Wait5Minutes, 0, 'M', "", pIcons_LOD->GetTexture(uTextureID_RestUI_restb3), 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
84 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
85
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
86 //----- (0041FA01) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
87 void RestUI_Draw()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
88 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
89 int live_characters; // esi@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
90 unsigned int v3; // eax@15
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
91 //char v4; // al@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
92 bool v5; // eax@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
93 GUIButton tmp_button; // [sp+8h] [bp-DCh]@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
94 //double v7; // [sp+C4h] [bp-20h]@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
95 float v8; // [sp+CCh] [bp-18h]@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
96 __int64 v9; // [sp+D0h] [bp-14h]@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
97 unsigned int am_pm_hours; // [sp+D8h] [bp-Ch]@9
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
98 __int16 shadow_color; // [sp+DCh] [bp-8h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
99 int text_color; // [sp+E0h] [bp-4h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
100
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
101 live_characters = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
102 text_color = TargetColor(10, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
103 shadow_color = TargetColor(230, 214, 193);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
104 for(int i=1; i<5; ++i)
1362
d6cf8ead9242 Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents: 1361
diff changeset
105 if ( !pPlayers[i]->IsDead() && !pPlayers[i]->IsEradicated() && pPlayers[i]->sHealth > 0 )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
106 ++live_characters;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
107
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
108 if ( live_characters )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
109 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
110 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_RestUI_restmain));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
111 am_pm_hours = pParty->uCurrentHour;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
112 dword_506F1C = pGUIWindow_CurrentMenu->pCurrentPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
113 if ( (signed int)pParty->uCurrentHour <= 12 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
114 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
115 if ( !am_pm_hours )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
116 am_pm_hours = 12;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
117 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
118 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
119 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
120 am_pm_hours -= 12;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
121 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
122 pRenderer->DrawTextureIndexed(16u, 26u, pTexture_RestUI_CurrentSkyFrame);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
123 if ( pTexture_RestUI_CurrentHourglassFrame )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
124 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
125 pTexture_RestUI_CurrentHourglassFrame->Release();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
126 pIcons_LOD->SyncLoadedFilesCount();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
127 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
128 v3 = pEventTimer->uTimeElapsed + _507CD4_RestUI_hourglass_anim_controller;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
129 _507CD4_RestUI_hourglass_anim_controller += pEventTimer->uTimeElapsed;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
130 if ( (unsigned int)_507CD4_RestUI_hourglass_anim_controller >= 512 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
131 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
132 v3 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
133 _507CD4_RestUI_hourglass_anim_controller = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
134 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
135 v9 = v3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
136 v8 = (double)v3 / 512.0 * 120.0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
137 //v7 = v8 + 6.7553994e15;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
138 HIDWORD(v9) = floorf(v8 + 0.5f);//LODWORD(v7);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
139 hourglass_icon_idx = (int)floorf(v8 + 0.5f) % 256 + 1;//LOBYTE(v7) + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
140 //hourglass_icon_idx = v4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
141 if (hourglass_icon_idx >= 120 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
142 hourglass_icon_idx = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
143
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
144 sprintf(pTmpBuf.data(), "hglas%03d", hourglass_icon_idx);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
145 pTexture_RestUI_CurrentHourglassFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
146 pRenderer->DrawTextureIndexed(267, 159, pTexture_RestUI_CurrentHourglassFrame);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
147 memset(&tmp_button, 0, sizeof(GUIButton));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
148 tmp_button.uX = 24;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
149 tmp_button.uY = 154;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
150
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
151 tmp_button.uZ = 194;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
152 tmp_button.uW = 190;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
153
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
154 tmp_button.uWidth = 171;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
155 tmp_button.uHeight = 37;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
156
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
157 tmp_button.pParent = pButton_RestUI_WaitUntilDawn->pParent;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
158 tmp_button.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, text_color, shadow_color);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
159 tmp_button.pParent = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
160 sprintf(pTmpBuf.data(), "\r408%d", uRestUI_FoodRequiredToRest);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
161 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, text_color, pTmpBuf.data(), 0, 0, shadow_color);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
162 pButton_RestUI_WaitUntilDawn->DrawLabel(pGlobalTXT_LocalizationStrings[237], pFontCreate, text_color, shadow_color);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
163 pButton_RestUI_Wait1Hour->DrawLabel(pGlobalTXT_LocalizationStrings[239], pFontCreate, text_color, shadow_color);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
164 pButton_RestUI_Wait5Minutes->DrawLabel(pGlobalTXT_LocalizationStrings[238], pFontCreate, text_color, shadow_color);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
165 pButton_RestUI_Exit->DrawLabel(pGlobalTXT_LocalizationStrings[81], pFontCreate, text_color, shadow_color);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
166 memset(&tmp_button, 0, sizeof(GUIButton));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
167 tmp_button.uX = 45;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
168 tmp_button.uY = 199;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
169
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
170 tmp_button.uZ = 229;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
171 tmp_button.uW = 228;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
172
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
173 tmp_button.uWidth = 185;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
174 tmp_button.uHeight = 30;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
175
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
176 tmp_button.pParent = pButton_RestUI_WaitUntilDawn->pParent;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
177 tmp_button.DrawLabel(pGlobalTXT_LocalizationStrings[236], pFontCreate, text_color, shadow_color);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
178 tmp_button.pParent = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
179 v5 = (pParty->uCurrentHour >= 12 && pParty->uCurrentHour < 24)? 1:0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
180 sprintf(pTmpBuf.data(), "%d:%02d %s", am_pm_hours, pParty->uCurrentMinute, aAMPMNames[v5]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
181 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 368, 168, text_color, pTmpBuf.data(), 0, 0, shadow_color);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
182 sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[56], pParty->uDaysPlayed + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
183 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 190, text_color, pTmpBuf.data(), 0, 0, shadow_color);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
184 sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[146], pParty->uCurrentMonth + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
185 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 222, text_color, pTmpBuf.data(), 0, 0, shadow_color);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
186 sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
187 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 254, text_color, pTmpBuf.data(), 0, 0, shadow_color);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
188 if ( dword_506F14 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
189 Sleep6Hours();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
190 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
191 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
192 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn,
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
193 (int)pButton_RestUI_Exit, pGlobalTXT_LocalizationStrings[81]); // "Exit Rest"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
194 }