annotate GUI/UI/UITransition.cpp @ 2513:28afacb08f76

Слияние
author Ritor1
date Thu, 02 Oct 2014 19:33:11 +0600
parents a77c34acdbc9
children c7264ab7132f
rev   line source
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1 #define _CRTDBG_MAP_ALLOC
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2 #include <stdlib.h>
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
3 #include <crtdbg.h>
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
4
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
5 #define _CRT_SECURE_NO_WARNINGS
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
6 #include <io.h>
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
7
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
8 #include "..\../Engine/ErrorHandling.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
9 #include "..\../Engine/mm7_data.h"
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2501
diff changeset
10 #include "..\../Media/MediaPlayer.h"
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
11 #include "..\../Engine/MapInfo.h"
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2501
diff changeset
12 #include "..\../GUI/GUIWindow.h"
a77c34acdbc9 Media folder
Ritor1
parents: 2501
diff changeset
13 #include "..\../GUI/GUIFont.h"
a77c34acdbc9 Media folder
Ritor1
parents: 2501
diff changeset
14 #include "..\../GUI/GUIProgressBar.h"
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
15 #include "..\../Engine/Party.h"
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2501
diff changeset
16 #include "..\../Media/Audio/AudioPlayer.h"
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
17 #include "..\../Engine/Graphics/Outdoor.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
18 #include "..\../Engine/LOD.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
19 #include "..\../Engine/Timer.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
20 #include "..\../Engine/stru159.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
21 #include "..\../Engine/Events2D.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
22 #include "..\../Engine/texts.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
23 #include "UIHouses.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
24
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
25
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
26
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
27
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
28 //----- (00444839) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
29 void TransitionUI_Load(uint anim_id, uint exit_pic_id, int x, int y, int z, int directiony, int directionx, int a8, const char *pLocationName)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
30 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
31 const char *v15; // eax@14
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
32 char pContainer[40]; // [sp+Ch] [bp-2Ch]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
33
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
34 dword_59117C_teleportx = x;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
35 dword_591178_teleporty = y;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
36 dword_591174_teleportz = z;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
37 dword_591170_teleport_directiony = directiony;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
38 dword_59116C_teleport_directionx = directionx;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
39 dword_591168_teleport_speedz = a8;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
40 dword_591164_teleport_map_name = (char *)pLocationName;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
41 uCurrentHouse_Animation = anim_id;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
42 pEventTimer->Pause();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
43 pAudioPlayer->StopChannels(-1, -1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
44
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
45 switch (pParty->alignment)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
46 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
47 case PartyAlignment_Good: sprintfex(pContainer, "evt%02d-b", const_2()); break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
48 case PartyAlignment_Neutral: sprintfex(pContainer, "evt%02d", const_2()); break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
49 case PartyAlignment_Evil: sprintfex(pContainer, "evt%02d-c", const_2()); break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
50 default: Error("Invalid alignment: %u", pParty->alignment);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
51 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
52
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
53 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
54 pTexture_outside = pIcons_LOD->LoadTexturePtr(pHouse_ExitPictures[exit_pic_id], TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
55 if (anim_id)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
56 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
57 if ( !IndoorLocation::GetLocationIndex(pLocationName) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
58 pMediaPlayer->OpenHouseMovie(pAnimatedRooms[p2DEvents[anim_id - 1].uAnimationID].video_name, 1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
59 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
60 else if ( !IndoorLocation::GetLocationIndex(pLocationName) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
61 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
62 if ( pMapStats->GetMapInfo(pCurrentMapName) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
63 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
64 sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName); // "Leave %s"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
65 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Transition, 0, sHouseName.data());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
66 //if ( pAnimatedRooms[p2DEvents[anim_id].uAnimationID].uRoomSoundId )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
67 //PlayHouseSound(anim_id, HouseSound_Greeting);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
68 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
69 pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
70 if ( IndoorLocation::GetLocationIndex(pLocationName) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
71 uCurrentHouse_Animation = IndoorLocation::GetLocationIndex(pLocationName);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
72 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
73 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
74 strcpy(sHouseName.data(), pGlobalTXT_LocalizationStrings[79]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
75 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Transition, 0, sHouseName.data());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
76 //if ( pAnimatedRooms[p2DEvents[anim_id].uAnimationID].uRoomSoundId )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
77 //PlayHouseSound(anim_id, HouseSound_Greeting);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
78 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
79 pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
80 if ( IndoorLocation::GetLocationIndex(pLocationName) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
81 uCurrentHouse_Animation = IndoorLocation::GetLocationIndex(pLocationName);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
82 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
83 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
84 v15 = pLocationName;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
85 if ( *pLocationName == 48 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
86 v15 = pCurrentMapName;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
87 if ( pMapStats->GetMapInfo(v15) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
88 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
89 sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[411], pMapStats->pInfos[pMapStats->GetMapInfo(v15)].pName);// ^Pv[%s]
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
90 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Transition, 0, sHouseName.data());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
91 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
92 pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
93 if ( IndoorLocation::GetLocationIndex(pLocationName) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
94 uCurrentHouse_Animation = IndoorLocation::GetLocationIndex(pLocationName);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
95 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
96 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
97 strcpy(sHouseName.data(), pGlobalTXT_LocalizationStrings[73]);//
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
98 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Transition, 0, sHouseName.data());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
99 //if ( pAnimatedRooms[p2DEvents[anim_id].uAnimationID].uRoomSoundId )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
100 //PlayHouseSound(anim_id, HouseSound_Greeting);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
101 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
102 pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
103 if ( IndoorLocation::GetLocationIndex(pLocationName) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
104 uCurrentHouse_Animation = IndoorLocation::GetLocationIndex(pLocationName);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
105 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
106
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
107 //----- (00444C8F) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
108 void TravelUI_Load()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
109 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
110 char pContainer[32]; // [sp+0h] [bp-28h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
111
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
112 pEventTimer->Pause();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
113
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
114 switch (pParty->alignment)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
115 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
116 case PartyAlignment_Good: sprintfex(pContainer, "evt%02d-b", const_2()); break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
117 case PartyAlignment_Neutral: sprintfex(pContainer, "evt%02d", const_2()); break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
118 case PartyAlignment_Evil: sprintfex(pContainer, "evt%02d-c", const_2()); break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
119 default: Error("Invalid alignment: %u", pParty->alignment);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
120 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
121
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
122 pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
123 pTexture_outside = pIcons_LOD->LoadTexturePtr("outside", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
124 if ( pMapStats->GetMapInfo(pCurrentMapName) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
125 sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName);// "Leave %s"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
126 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
127 strcpy(sHouseName.data(), pGlobalTXT_LocalizationStrings[79]);// "Exit"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
128 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_ChangeLocation, 0, sHouseName.data());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
129 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
130
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
131 //----- (00444DCA) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
132 void TravelUI_Draw()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
133 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
134 GUIWindow travel_window; // [sp+Ch] [bp-78h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
135 char pDestinationMapName[32]; // [sp+60h] [bp-24h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
136
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
137 memcpy(&travel_window, pPrimaryWindow, sizeof(travel_window));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
138 pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pDestinationMapName, 20);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
139 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
140 pRenderer->DrawTextureTransparent(468, 0, &pIcons_LOD->pTextures[uTextureID_right_panel_loop]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
141 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
142 pRenderer->DrawTextureIndexed(556, 451, pIcons_LOD->GetTexture(uTextureID_x_x_u));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
143 pRenderer->DrawTextureIndexed(476, 451, pIcons_LOD->GetTexture(uTextureID_x_ok_u));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
144 if ( pMapStats->GetMapInfo(pDestinationMapName) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
145 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
146 travel_window.uFrameX = 493;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
147 travel_window.uFrameWidth = 126;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
148 travel_window.uFrameZ = 366;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
149 travel_window.DrawTitleText(pFontCreate, 0, 4, 0, pMapStats->pInfos[pMapStats->GetMapInfo(pDestinationMapName)].pName, 3);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
150 travel_window.uFrameX = 483;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
151 travel_window.uFrameWidth = 148;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
152 travel_window.uFrameZ = 334;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
153 if ( GetTravelTime() == 1 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
154 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[663], 1, pMapStats->pInfos[pMapStats->GetMapInfo(pDestinationMapName)].pName);// "It will take %d day to cross to %s."
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
155 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
156 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[128], GetTravelTime(), pMapStats->pInfos[pMapStats->GetMapInfo(pDestinationMapName)].pName);// "It will take %d days to travel to %s."
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
157
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
158 strcat(pTmpBuf.data(), "\n \n");
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
159 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[126], pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
160 strcat(pTmpBuf.data(), pTmpBuf2.data());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
161 travel_window.DrawTitleText(pFontCreate, 0, (212 - pFontCreate->CalcTextHeight(pTmpBuf.data(), &travel_window, 0, 0)) / 2 + 101, 0, pTmpBuf.data(), 3);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
162 _unused_5B5924_is_travel_ui_drawn = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
163 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
164 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
165
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
166 //----- (00444A51) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
167 void TransitionUI_Draw()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
168 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
169 unsigned int v4; // [sp-10h] [bp-7Ch]@12
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
170 GUIWindow transition_window; // [sp+Ch] [bp-60h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
171 unsigned int v9; // [sp+60h] [bp-Ch]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
172 unsigned int map_id; // [sp+64h] [bp-8h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
173
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
174 memcpy(&transition_window, pPrimaryWindow, sizeof(transition_window));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
175 v9 = IndoorLocation::GetLocationIndex(dword_591164_teleport_map_name);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
176 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
177 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, pIcons_LOD->GetTexture(uTextureID_50795C));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
178 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
179 uTextureID_right_panel_loop = uTextureID_right_panel;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
180 pRenderer->DrawTextureTransparent(468, 0, pIcons_LOD->GetTexture(uTextureID_right_panel));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
181 pRenderer->DrawTextureIndexed(556, 451, pIcons_LOD->GetTexture(uTextureID_x_x_u));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
182 pRenderer->DrawTextureIndexed(476, 451, pIcons_LOD->GetTexture(uTextureID_x_ok_u));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
183 map_id = pMapStats->GetMapInfo(pCurrentMapName);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
184 if ( (pMovie_Track || v9) && *dword_591164_teleport_map_name != ' ' )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
185 map_id = pMapStats->GetMapInfo(dword_591164_teleport_map_name);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
186 transition_window.uFrameX = 493;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
187 transition_window.uFrameWidth = 126;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
188 transition_window.uFrameZ = 366;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
189 transition_window.DrawTitleText(pFontCreate, 0, 5, 0, pMapStats->pInfos[map_id].pName, 3);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
190 transition_window.uFrameX = 483;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
191 transition_window.uFrameWidth = 148;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
192 transition_window.uFrameZ = 334;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
193
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
194 if ( uCurrentHouse_Animation )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
195 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
196 v4 = (212 - pFontCreate->CalcTextHeight(pTransitionStrings[uCurrentHouse_Animation], &transition_window, 0, 0)) / 2 + 101;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
197 transition_window.DrawTitleText(pFontCreate, 0, v4, 0, pTransitionStrings[uCurrentHouse_Animation], 3);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
198 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
199 else if ( map_id )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
200 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
201 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[409], pMapStats->pInfos[map_id].pName);// "Do you wish to leave %s?"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
202 v4 = (212 - pFontCreate->CalcTextHeight(pTmpBuf.data(), &transition_window, 0, 0)) / 2 + 101;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
203 transition_window.DrawTitleText(pFontCreate, 0, v4, 0, pTmpBuf.data(), 3);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
204 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
205 else Error("Troubles in da house");
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
206
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
207 _unused_5B5924_is_travel_ui_drawn = true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
208 }