comparison UI/UITransition.cpp @ 1757:11f5c0ac170a

UITransition.cpp cleared
author Ritor1
date Mon, 30 Sep 2013 18:25:14 +0600
parents dc5d8edf629a
children 28cb79ae2f6f
comparison
equal deleted inserted replaced
1756:dc5d8edf629a 1757:11f5c0ac170a
100 pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0); 100 pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
101 if ( IndoorLocation::GetLocationIndex(pLocationName) ) 101 if ( IndoorLocation::GetLocationIndex(pLocationName) )
102 uCurrentHouse_Animation = IndoorLocation::GetLocationIndex(pLocationName); 102 uCurrentHouse_Animation = IndoorLocation::GetLocationIndex(pLocationName);
103 } 103 }
104 104
105
106
107
108 //----- (00444C8F) -------------------------------------------------------- 105 //----- (00444C8F) --------------------------------------------------------
109 void TravelUI_Load() 106 void TravelUI_Load()
110 { 107 {
111 unsigned int v1; // eax@6
112 GUIWindow *result; // eax@9
113 char pContainer[32]; // [sp+0h] [bp-28h]@1 108 char pContainer[32]; // [sp+0h] [bp-28h]@1
114 109
115 pEventTimer->Pause(); 110 pEventTimer->Pause();
116 111
117 switch (pParty->alignment) 112 switch (pParty->alignment)
122 default: Error("Invalid alignment: %u", pParty->alignment); 117 default: Error("Invalid alignment: %u", pParty->alignment);
123 } 118 }
124 119
125 pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); 120 pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
126 pTexture_outside = pIcons_LOD->LoadTexturePtr("outside", TEXTURE_16BIT_PALETTE); 121 pTexture_outside = pIcons_LOD->LoadTexturePtr("outside", TEXTURE_16BIT_PALETTE);
127 v1 = pMapStats->GetMapInfo(pCurrentMapName); 122 if ( pMapStats->GetMapInfo(pCurrentMapName) )
128 if ( v1 ) 123 sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName);// "Leave %s"
129 sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[v1].pName);// "Leave %s"
130 else 124 else
131 strcpy(sHouseName.data(), pGlobalTXT_LocalizationStrings[79]);// "Exit" 125 strcpy(sHouseName.data(), pGlobalTXT_LocalizationStrings[79]);// "Exit"
132 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_ChangeLocation, 0, sHouseName.data()); 126 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_ChangeLocation, 0, sHouseName.data());
133 } 127 }
134 128
135
136
137 //----- (00444DCA) -------------------------------------------------------- 129 //----- (00444DCA) --------------------------------------------------------
138 void TravelUI_Draw() 130 void TravelUI_Draw()
139 { 131 {
140 unsigned int v0; // edi@1 132 GUIWindow travel_window; // [sp+Ch] [bp-78h]@1
141 MapInfo *v1; // edi@2
142 signed int v3; // eax@2
143 int v4; // eax@5
144 const char *v5; // [sp-Ch] [bp-90h]@3
145 signed int v6; // [sp-8h] [bp-8Ch]@3
146 GUIWindow v7; // [sp+Ch] [bp-78h]@1
147 char pDestinationMapName[32]; // [sp+60h] [bp-24h]@1 133 char pDestinationMapName[32]; // [sp+60h] [bp-24h]@1
148 unsigned int v9; // [sp+80h] [bp-4h]@1 134
149 135 memcpy(&travel_window, pPrimaryWindow, sizeof(travel_window));
150 memcpy(&v7, pPrimaryWindow, sizeof(v7));
151 v9 = pMapStats->GetMapInfo(pCurrentMapName);
152 pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pDestinationMapName, 20); 136 pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pDestinationMapName, 20);
153 v0 = pMapStats->GetMapInfo(pDestinationMapName); 137 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background);
154 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background); 138 pRenderer->DrawTextureTransparent(468, 0, &pIcons_LOD->pTextures[uTextureID_right_panel_loop]);
155 pRenderer->DrawTextureTransparent(0x1D4u, 0, &pIcons_LOD->pTextures[uTextureID_right_panel_loop]);
156 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside); 139 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside);
157 pRenderer->DrawTextureIndexed(0x22Cu, 0x1C3u, pIcons_LOD->GetTexture(uTextureID_x_x_u)); 140 pRenderer->DrawTextureIndexed(556, 451, pIcons_LOD->GetTexture(uTextureID_x_x_u));
158 pRenderer->DrawTextureIndexed(0x1DCu, 0x1C3u, pIcons_LOD->GetTexture(uTextureID_x_ok_u)); 141 pRenderer->DrawTextureIndexed(476, 451, pIcons_LOD->GetTexture(uTextureID_x_ok_u));
159 if ( v0 ) 142 if ( pMapStats->GetMapInfo(pDestinationMapName) )
160 { 143 {
161 v1 = &pMapStats->pInfos[v0]; 144 travel_window.uFrameX = 493;
162 v7.uFrameX = 493; 145 travel_window.uFrameWidth = 126;
163 v7.uFrameWidth = 126; 146 travel_window.uFrameZ = 366;
164 v7.uFrameZ = 366; 147 travel_window.DrawTitleText(pFontCreate, 0, 4, 0, pMapStats->pInfos[pMapStats->GetMapInfo(pDestinationMapName)].pName, 3);
165 v7.DrawTitleText(pFontCreate, 0, 4u, 0, v1->pName, 3); 148 travel_window.uFrameX = 483;
166 v7.uFrameX = 483; 149 travel_window.uFrameWidth = 148;
167 v7.uFrameWidth = 148; 150 travel_window.uFrameZ = 334;
168 v7.uFrameZ = 334; 151 if ( GetTravelTime() == 1 )
169 v3 = GetTravelTime(); 152 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[663], 1, pMapStats->pInfos[pMapStats->GetMapInfo(pDestinationMapName)].pName);// "It will take %d day to cross to %s."
170 if ( v3 == 1 )
171 {
172 v6 = 1;
173 v5 = pGlobalTXT_LocalizationStrings[663]; // "It will take %d day to cross to %s."
174 }
175 else 153 else
176 { 154 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[128], GetTravelTime(), pMapStats->pInfos[pMapStats->GetMapInfo(pDestinationMapName)].pName);// "It will take %d days to travel to %s."
177 v6 = v3; 155
178 v5 = pGlobalTXT_LocalizationStrings[128]; // "It will take %d days to travel to %s."
179 }
180 sprintfex(pTmpBuf.data(), v5, v6, v1->pName);
181 strcat(pTmpBuf.data(), "\n \n"); 156 strcat(pTmpBuf.data(), "\n \n");
182 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[126], pMapStats->pInfos[v9].pName); 157 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[126], pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName);
183 strcat(pTmpBuf.data(), pTmpBuf2.data()); 158 strcat(pTmpBuf.data(), pTmpBuf2.data());
184 v4 = pFontCreate->CalcTextHeight(pTmpBuf.data(), &v7, 0, 0); 159 travel_window.DrawTitleText(pFontCreate, 0, (212 - pFontCreate->CalcTextHeight(pTmpBuf.data(), &travel_window, 0, 0)) / 2 + 101, 0, pTmpBuf.data(), 3);
185 v7.DrawTitleText(pFontCreate, 0, (212 - v4) / 2 + 101, 0, pTmpBuf.data(), 3);
186 _unused_5B5924_is_travel_ui_drawn = 1; 160 _unused_5B5924_is_travel_ui_drawn = 1;
187 } 161 }
188 } 162 }
189 163
190 //----- (00444A51) -------------------------------------------------------- 164 //----- (00444A51) --------------------------------------------------------