annotate UIRest.cpp @ 1189:cb365b58a641

Слияние
author Ritor1
date Fri, 07 Jun 2013 11:31:20 +0600
parents 29a8defbad9e
children 8c02e6f74b29
rev   line source
1165
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1104
diff changeset
1 #ifdef _MSC_VER
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1104
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1104
diff changeset
3 #endif
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1104
diff changeset
4
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
5 #include <assert.h>
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
6
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
7 #include "MM7.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
8
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
9 #include "MapInfo.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
10 #include "Game.h"
1006
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
11 #include "Player.h"
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
12 #include "GUIWindow.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
13 #include "GUIFont.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
14 #include "GUIProgressBar.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
15 #include "Party.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
16 #include "AudioPlayer.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
17 #include "Outdoor.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
18 #include "IndoorCamera.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
19 #include "Overlays.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
20 #include "Monsters.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
21 #include "Arcomage.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
22 #include "LOD.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
23 #include "Actor.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
24 #include "Allocator.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
25 #include "Events.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
26 #include "Viewport.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
27 #include "FrameTableInc.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
28 #include "Math.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
29 #include "SpriteObject.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
30 #include "ObjectList.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
31 #include "Chest.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
32 #include "PaletteManager.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
33 #include "DecorationList.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
34 #include "SaveLoad.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
35 #include "stru123.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
36 #include "Time.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
37 #include "IconFrameTable.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
38 #include "Awards.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
39 #include "Autonotes.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
40 #include "stru160.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
41 #include "TurnEngine.h"
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 907
diff changeset
42 #include "CastSpellInfo.h"
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
43 #include "Weather.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
44 #include "stru298.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
45 #include "StorylineTextTable.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
46 #include "Events2D.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
47 #include "texts.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
48
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
49 #include "mm7_data.h"
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
50
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
51
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
52
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
53 //----- (0041F6C1) --------------------------------------------------------
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1006
diff changeset
54 void RestUI_Load()
938
016e3577865c stru289 removed, some data movements
Nomad
parents: 937
diff changeset
55 {
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
56 Player *v0; // eax@10
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
57
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
58 if ( !dword_506F14 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
59 pAudioPlayer->StopChannels(-1, -1);
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1006
diff changeset
60 if ( pCurrentScreen != SCREEN_GAME)
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1006
diff changeset
61 {
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
62 pGUIWindow_CurrentMenu->Release();
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
63 pCurrentScreen = SCREEN_GAME;
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1006
diff changeset
64 viewparams->bRedrawGameUI = true;
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1006
diff changeset
65 }
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
66 pEventTimer->Pause();
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
67 if ( dword_506F14 != 2 )
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
68 GUIWindow::Create(518, 450, 0, 0, WINDOW_PressedButton2, (int)pBtn_Rest, 0);
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
69 _506F18_num_hours_to_sleep = 0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
70 dword_506F14 = 0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
71 uRestUI_FoodRequiredToRest = 2;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
72 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
73 uRestUI_FoodRequiredToRest = pOutdoor->GetNumFoodRequiredToRestInCurrentPos(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
74 if ( PartyHasDragon() )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
75 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
76 v0 = pParty->pPlayers;//[0].uClass;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
77 while ( v0 <= &pParty->pPlayers[3] )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
78 {
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
79 ++v0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
80 if ( v0 > &pParty->pPlayers[3] )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
81 break;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
82 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
83 if(v0->classType == PLAYER_CLASS_WARLOCK)
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
84 ++uRestUI_FoodRequiredToRest;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
85 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
86 if ( CheckHiredNPCSpeciality(Porter) )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
87 --uRestUI_FoodRequiredToRest;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
88 if ( CheckHiredNPCSpeciality(QuarterMaster) )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
89 uRestUI_FoodRequiredToRest -= 2;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
90 if ( CheckHiredNPCSpeciality(Gypsy) )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
91 --uRestUI_FoodRequiredToRest;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
92 if ( uRestUI_FoodRequiredToRest < 1 )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
93 uRestUI_FoodRequiredToRest = 1;
1104
5d5c78088274 strcmpi to stricmp conversion
Grumpy7
parents: 1033
diff changeset
94 if ( !_stricmp(pCurrentMapName, "d29.blv") && _449B57_test_bit(pParty->_quest_bits, 98) )
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
95 uRestUI_FoodRequiredToRest = 0;
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1006
diff changeset
96
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
97 ++pIcons_LOD->uTexturePacksCount;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
98 if ( !pIcons_LOD->uNumPrevLoadedFiles )
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
99 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1006
diff changeset
100
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
101 pCurrentScreen = SCREEN_REST;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
102 _507CD4_RestUI_hourglass_anim_controller = 0;
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
103 uTextureID_RestUI_restmain = pIcons_LOD->LoadTexture("restmain", TEXTURE_16BIT_PALETTE);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
104 uTextureID_RestUI_restb1 = pIcons_LOD->LoadTexture("restb1", TEXTURE_16BIT_PALETTE);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
105 uTextureID_RestUI_restb2 = pIcons_LOD->LoadTexture("restb2", TEXTURE_16BIT_PALETTE);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
106 uTextureID_RestUI_restb3 = pIcons_LOD->LoadTexture("restb3", TEXTURE_16BIT_PALETTE);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
107 uTextureID_RestUI_restb4 = pIcons_LOD->LoadTexture("restb4", TEXTURE_16BIT_PALETTE);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
108 uTextureID_RestUI_restexit = pIcons_LOD->LoadTexture("restexit", TEXTURE_16BIT_PALETTE);
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 939
diff changeset
109
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
110 LoadActualSkyFrame();
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 939
diff changeset
111
5a2dbb00c399 Code cleaning.
Nomad
parents: 939
diff changeset
112 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Rest, 0, 0);
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1006
diff changeset
113 pButton_RestUI_Exit = pGUIWindow_CurrentMenu->CreateButton(280, 297, 154, 37, 1, 0, UIMSG_ExitRest, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_RestUI_restexit), 0);
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1006
diff changeset
114 pButton_RestUI_Main = pGUIWindow_CurrentMenu->CreateButton( 24, 154, 225, 37, 1, 0, UIMSG_Rest8Hour, 0, 'R', "", pIcons_LOD->GetTexture(uTextureID_RestUI_restb4), 0);
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1006
diff changeset
115 pButton_RestUI_WaitUntilDawn = pGUIWindow_CurrentMenu->CreateButton( 61, 232, 154, 33, 1, 0, UIMSG_AlreadyResting, 0, 'D', "", pIcons_LOD->GetTexture(uTextureID_RestUI_restb1), 0);
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1006
diff changeset
116 pButton_RestUI_Wait1Hour = pGUIWindow_CurrentMenu->CreateButton( 61, 264, 154, 33, 1, 0, UIMSG_Wait1Hour, 0, 'H', "", pIcons_LOD->GetTexture(uTextureID_RestUI_restb2), 0);
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1006
diff changeset
117 pButton_RestUI_Wait5Minutes = pGUIWindow_CurrentMenu->CreateButton( 61, 296, 154, 33, 1, 0, UIMSG_Wait5Minutes, 0, 'M', "", pIcons_LOD->GetTexture(uTextureID_RestUI_restb3), 0);
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 939
diff changeset
118 }
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
119
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
120 //----- (0041FA01) --------------------------------------------------------
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1006
diff changeset
121 void RestUI_Draw()
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1006
diff changeset
122 {
1006
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
123 int live_characters; // esi@1
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
124 unsigned int v3; // eax@15
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
125 //char v4; // al@17
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
126 bool v5; // eax@21
1006
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
127 GUIButton tmp_button; // [sp+8h] [bp-DCh]@19
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
128 //double v7; // [sp+C4h] [bp-20h]@17
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
129 float v8; // [sp+CCh] [bp-18h]@17
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
130 __int64 v9; // [sp+D0h] [bp-14h]@17
1006
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
131 unsigned int am_pm_hours; // [sp+D8h] [bp-Ch]@9
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
132 __int16 shadow_color; // [sp+DCh] [bp-8h]@1
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
133 int text_color; // [sp+E0h] [bp-4h]@1
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
134
1006
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
135 live_characters = 0;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
136 text_color = TargetColor(10, 0, 0);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
137 shadow_color = TargetColor(230, 214, 193);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
138 for(int i=1; i<5; ++i)
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
139 if ( !pPlayers[i]->pConditions[Player::Condition_Dead] && !pPlayers[i]->pConditions[Player::Condition_Eradicated] && pPlayers[i]->sHealth > 0 )
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
140 ++live_characters;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
141
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
142 if ( live_characters )
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
143 {
1006
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
144 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_RestUI_restmain));
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
145 am_pm_hours = pParty->uCurrentHour;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
146 dword_506F1C = pGUIWindow_CurrentMenu->pCurrentPosActiveItem;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
147 if ( (signed int)pParty->uCurrentHour <= 12 )
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
148 {
1006
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
149 if ( !am_pm_hours )
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
150 am_pm_hours = 12;
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
151 }
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
152 else
1006
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
153 {
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
154 am_pm_hours -= 12;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
155 }
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
156 pRenderer->DrawTextureIndexed(16u, 26u, pTexture_RestUI_CurrentSkyFrame);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
157 if ( pTexture_RestUI_CurrentHourglassFrame )
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
158 {
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
159 pTexture_RestUI_CurrentHourglassFrame->Release();
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
160 pIcons_LOD->SyncLoadedFilesCount();
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
161 }
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
162 v3 = pEventTimer->uTimeElapsed + _507CD4_RestUI_hourglass_anim_controller;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
163 _507CD4_RestUI_hourglass_anim_controller += pEventTimer->uTimeElapsed;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
164 if ( (unsigned int)_507CD4_RestUI_hourglass_anim_controller >= 512 )
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
165 {
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
166 v3 = 0;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
167 _507CD4_RestUI_hourglass_anim_controller = 0;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
168 }
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
169 v9 = v3;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
170 v8 = (double)v3 / 512.0 * 120.0;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
171 //v7 = v8 + 6.7553994e15;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
172 HIDWORD(v9) = floorf(v8 + 0.5f);//LODWORD(v7);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
173 hourglass_icon_idx = (int)floorf(v8 + 0.5f) % 256 + 1;//LOBYTE(v7) + 1;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
174 //hourglass_icon_idx = v4;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
175 if (hourglass_icon_idx >= 120 )
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
176 hourglass_icon_idx = 1;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
177
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
178 sprintf(pTmpBuf, "hglas%03d", hourglass_icon_idx);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
179 pTexture_RestUI_CurrentHourglassFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
180 pRenderer->DrawTextureIndexed(267, 159, pTexture_RestUI_CurrentHourglassFrame);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
181 memset(&tmp_button, 0, sizeof(GUIButton));
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
182 tmp_button.uX = 24;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
183 tmp_button.uY = 154;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
184
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
185 tmp_button.uZ = 194;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
186 tmp_button.uW = 190;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
187
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
188 tmp_button.uWidth = 171;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
189 tmp_button.uHeight = 37;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
190
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
191 tmp_button.pParent = pButton_RestUI_WaitUntilDawn->pParent;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
192 tmp_button.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, text_color, shadow_color);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
193 tmp_button.pParent = 0;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
194 sprintf(pTmpBuf, "\r408%d", uRestUI_FoodRequiredToRest);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
195 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, text_color, pTmpBuf, 0, 0, shadow_color);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
196 pButton_RestUI_WaitUntilDawn->DrawLabel(pGlobalTXT_LocalizationStrings[237], pFontCreate, text_color, shadow_color);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
197 pButton_RestUI_Wait1Hour->DrawLabel(pGlobalTXT_LocalizationStrings[239], pFontCreate, text_color, shadow_color);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
198 pButton_RestUI_Wait5Minutes->DrawLabel(pGlobalTXT_LocalizationStrings[238], pFontCreate, text_color, shadow_color);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
199 pButton_RestUI_Exit->DrawLabel(pGlobalTXT_LocalizationStrings[81], pFontCreate, text_color, shadow_color);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
200 memset(&tmp_button, 0, sizeof(GUIButton));
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
201 tmp_button.uX = 45;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
202 tmp_button.uY = 199;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
203
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
204 tmp_button.uZ = 229;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
205 tmp_button.uW = 228;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
206
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
207 tmp_button.uWidth = 185;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
208 tmp_button.uHeight = 30;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
209
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
210 tmp_button.pParent = pButton_RestUI_WaitUntilDawn->pParent;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
211 tmp_button.DrawLabel(pGlobalTXT_LocalizationStrings[236], pFontCreate, text_color, shadow_color);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
212 tmp_button.pParent = 0;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
213 v5 = (pParty->uCurrentHour >= 12 && pParty->uCurrentHour < 24)? 1:0;
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
214 sprintf(pTmpBuf, "%d:%02d %s", am_pm_hours, pParty->uCurrentMinute, aAMPMNames[v5]);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
215 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 368, 168, text_color, pTmpBuf, 0, 0, shadow_color);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
216 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[56], pParty->uDaysPlayed + 1);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
217 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 190, text_color, pTmpBuf, 0, 0, shadow_color);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
218 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[146], pParty->uCurrentMonth + 1);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
219 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 222, text_color, pTmpBuf, 0, 0, shadow_color);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
220 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
221 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 254, text_color, pTmpBuf, 0, 0, shadow_color);
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
222 if ( dword_506F14 )
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
223 Sleep6Hours();
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
224 }
e865f349aa41 ui cleanup
Gloval
parents: 962
diff changeset
225 else
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1006
diff changeset
226 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, (int)pButton_RestUI_Exit, (int)pGlobalTXT_LocalizationStrings[81]); // "Exit Rest"
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents:
diff changeset
227 }