World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Класс GUIWindow_Travel

#include <UITransition.h>

+ Граф наследования:GUIWindow_Travel:
+ Граф связей класса GUIWindow_Travel:

Открытые члены

 GUIWindow_Travel ()
 
virtual ~GUIWindow_Travel ()
 
virtual void Update ()
 
virtual void Release ()
 
- Открытые члены унаследованные от GUIWindow
 GUIWindow ()
 
 GUIWindow (WindowType windowType, unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, int pButton, const String &hint=String())
 
virtual ~GUIWindow ()
 
GUIButtonCreateButton (int x, int y, int width, int height, int a6, int a7, UIMessageType msg, unsigned int msg_param, uint8_t hotkey, const String &label, const std::vector< Image * > &textures=std::vector< Image * >())
 
bool Contains (unsigned int x, unsigned int y)
 
void DrawFlashingInputCursor (int uX, int uY, GUIFont *a2)
 
int DrawTextInRect (GUIFont *font, unsigned int x, unsigned int y, unsigned int color, const char *text, int rect_width, int reverse_text)
 
int DrawTextInRect (GUIFont *font, unsigned int x, unsigned int y, unsigned int color, String &str, int rect_width, int reverse_text)
 
void DrawText (GUIFont *font, int x, int y, unsigned short uFontColor, const char *str, bool present_time_transparency=false, int max_text_height=0, int uFontShadowColor=0)
 
void DrawText (GUIFont *font, int x, int y, unsigned short uFontColor, const String &str, bool present_time_transparency=false, int max_text_height=0, int uFontShadowColor=0)
 
void DrawTitleText (GUIFont *font, int horizontal_margin, int vertical_margin, unsigned __int16 uDefaultColor, const char *pInString, int line_spacing)
 
void DrawTitleText (GUIFont *font, int horizontal_margin, int vertical_margin, unsigned __int16 uDefaultColor, const String &str, int line_spacing)
 
void DrawShops_next_generation_time_string (GameTime time)
 
void HouseDialogManager ()
 
void DrawMessageBox (bool inside_game_viewport)
 
GUIButtonGetControl (unsigned int uID)
 
void _41D08F_set_keyboard_control_group (int num_buttons, int a3, int a4, int a5)
 
void _41D73D_draw_buff_tooltip ()
 
void DeleteButtons ()
 

Дополнительные унаследованные члены

- Открытые статические члены унаследованные от GUIWindow
static void InitializeGUI ()
 
- Открытые атрибуты унаследованные от GUIWindow
unsigned int uFrameX
 
unsigned int uFrameY
 
unsigned int uFrameWidth
 
unsigned int uFrameHeight
 
unsigned int uFrameZ
 
unsigned int uFrameW
 
WindowType eWindowType
 
union {
   void *   ptr_1C
 
   unsigned int   par1C
 
}; 
 
int field_24
 
int pNumPresenceButton
 
int pCurrentPosActiveItem
 
int field_30
 
int field_34
 
int pStartingPosActiveItem
 
int receives_keyboard_input_2
 
bool receives_keyboard_input
 
String sHint
 
std::vector< GUIButton * > vButtons
 
Mousemouse = nullptr
 
Loglog = nullptr
 

Подробное описание

См. определение в файле UITransition.h строка 5

Конструктор(ы)

◆ GUIWindow_Travel()

GUIWindow_Travel::GUIWindow_Travel ( )

См. определение в файле UITransition.cpp строка 183

184  : GUIWindow(WINDOW_ChangeLocation, 0, 0, window->GetWidth(), window->GetHeight(), 0) {
185  String pContainer; // [sp+0h] [bp-28h]@1
186 
187  pEventTimer->Pause();
188 
189  switch (pParty->alignment) {
191  pContainer = "evt02-b";
192  break;
194  pContainer = "evt02";
195  break;
197  pContainer = "evt02-c";
198  break;
199  default:
200  Error("Invalid alignment: %u", pParty->alignment);
201  }
203 
208  .pName.c_str()); // "Leave %s"
209  else
211 
212  String hint = this->sHint = transition_button_label;
213 
217  566, 445, 75, 33, 1, 0, UIMSG_CHANGE_LOCATION_ClickCencelBtn, 0, 'N',
218  localization->GetString(156),
219  {{ui_buttdesc2}}); // Stay in this area / Остаться в этой области
220  pBtn_YES = CreateButton(486, 445, 75, 33, 1, 0, UIMSG_OnTravelByFoot, 0,
221  'Y', hint, {{ui_buttyes2}});
222  CreateButton(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63, 73, 1, 0,
223  UIMSG_OnTravelByFoot, 1, ' ', hint);
224  CreateButton(8, 8, 460, 344, 1, 0, UIMSG_OnTravelByFoot, 1, 0, hint);
225 }

Перекрестные ссылки Party::alignment, assets, GUIWindow::CreateButton(), current_screen_type, Localization::FormatString(), game_ui_dialogue_background, AssetsManager::GetImage_Solid(), MapStats::GetMapInfo(), Localization::GetString(), localization, PartyAlignment_Evil, PartyAlignment_Good, PartyAlignment_Neutral, Timer::Pause(), pBtn_ExitCancel, pCurrentMapName, pEventTimer, MapStats::pInfos, pMapStats, MapInfo::pName, pParty, prev_screen_type, SCREEN_CHANGE_LOCATION, GUIWindow::sHint, transition_button_label, transition_ui_icon и UIMSG_CHANGE_LOCATION_ClickCencelBtn.

+ Граф вызовов:

◆ ~GUIWindow_Travel()

virtual GUIWindow_Travel::~GUIWindow_Travel ( )
inlinevirtual

См. определение в файле UITransition.h строка 8

8 {}

Методы

◆ Update()

void GUIWindow_Travel::Update ( )
virtual

Переопределяет метод предка GUIWindow.

См. определение в файле UITransition.cpp строка 227

227  {
228  char pDestinationMapName[32];
229 
231  pDestinationMapName, 20);
232  render->DrawTextureNew(477 / 640.0f, 0, game_ui_dialogue_background);
233  render->DrawTextureAlphaNew(468 / 640.0f, 0, game_ui_right_panel_frame);
234  render->DrawTextureNew(pNPCPortraits_x[0][0] / 640.0f,
235  pNPCPortraits_y[0][0] / 480.0f, transition_ui_icon);
236  render->DrawTextureAlphaNew(556 / 640.0f, 451 / 480.0f, dialogue_ui_x_x_u);
237  render->DrawTextureAlphaNew(476 / 640.0f, 451 / 480.0f, dialogue_ui_x_ok_u);
238  if (pMapStats->GetMapInfo(pDestinationMapName)) {
239  GUIWindow travel_window = *pPrimaryWindow;
240  travel_window.uFrameX = 493;
241  travel_window.uFrameWidth = 126;
242  travel_window.uFrameZ = 366;
243  travel_window.DrawTitleText(
244  pFontCreate, 0, 4, 0,
245  pMapStats->pInfos[pMapStats->GetMapInfo(pDestinationMapName)].pName,
246  3);
247  travel_window.uFrameX = 483;
248  travel_window.uFrameWidth = 148;
249  travel_window.uFrameZ = 334;
250 
251  String str;
252  if (GetTravelTime() == 1) {
253  str = localization->FormatString(
254  663, 1,
255  pMapStats->pInfos[pMapStats->GetMapInfo(pDestinationMapName)]
256  .pName.c_str()); // It will take %d day to cross to %s.
257  } else {
258  str = localization->FormatString(
259  128, GetTravelTime(),
260  pMapStats->pInfos[pMapStats->GetMapInfo(pDestinationMapName)]
261  .pName.c_str()); // It will take %d days to travel to %s.
262  }
263  str += "\n \n";
264  str += localization->FormatString(
265  126,
267 
268  travel_window.DrawTitleText(
269  pFontCreate, 0,
270  (212 -
271  pFontCreate->CalcTextHeight(str, travel_window.uFrameWidth, 0)) /
272  2 +
273  101,
274  0, str, 3);
276  }
277 }

Перекрестные ссылки _unused_5B5924_is_travel_ui_drawn, GUIFont::CalcTextHeight(), dialogue_ui_x_ok_u, dialogue_ui_x_x_u, GUIWindow::DrawTitleText(), Localization::FormatString(), game_ui_dialogue_background, game_ui_right_panel_frame, MapStats::GetMapInfo(), OutdoorLocation::GetTravelDestination(), GetTravelTime(), localization, pCurrentMapName, pFontCreate, MapStats::pInfos, pMapStats, MapInfo::pName, pNPCPortraits_x, pNPCPortraits_y, pOutdoor, pParty, pPrimaryWindow, render, transition_ui_icon, GUIWindow::uFrameWidth, GUIWindow::uFrameX, GUIWindow::uFrameZ и Party::vPosition.

+ Граф вызовов:

◆ Release()

void GUIWindow_Travel::Release ( )
virtual

Переопределяет метод предка GUIWindow.

См. определение в файле UITransition.cpp строка 32

32  {
33  // -----------------------------------------
34  // 0041C26A void GUIWindow::Release --- part
35  if (transition_ui_icon) {
37  transition_ui_icon = nullptr;
38  }
39 
43  }
44 
46 
48 }

Перекрестные ссылки current_screen_type, game_ui_dialogue_background, prev_screen_type, Image::Release(), GUIWindow::Release() и transition_ui_icon.

+ Граф вызовов:

Объявления и описания членов классов находятся в файлах:
PartyAlignment::PartyAlignment_Good
@ PartyAlignment_Good
transition_button_label
String transition_button_label
Definition: UITransition.cpp:30
Party::vPosition
Vec3_int_ vPosition
Definition: Party.h:250
Localization::GetString
const char * GetString(unsigned int index) const
Definition: Localization.cpp:13
PartyAlignment::PartyAlignment_Neutral
@ PartyAlignment_Neutral
MapStats::pInfos
MapInfo pInfos[77]
Definition: MapInfo.h:79
GUIWindow
Definition: GUIWindow.h:433
AssetsManager::GetImage_Solid
Texture * GetImage_Solid(const String &name)
Definition: AssetsManager.cpp:51
WINDOW_ChangeLocation
@ WINDOW_ChangeLocation
Definition: GUIWindow.h:302
GUIWindow::CreateButton
GUIButton * CreateButton(int x, int y, int width, int height, int a6, int a7, UIMessageType msg, unsigned int msg_param, uint8_t hotkey, const String &label, const std::vector< Image * > &textures=std::vector< Image * >())
Definition: GUIWindow.cpp:717
MapStats::GetMapInfo
MAP_TYPE GetMapInfo(const String &Str2)
Definition: MapInfo.cpp:225
PartyAlignment::PartyAlignment_Evil
@ PartyAlignment_Evil
GUIWindow::GUIWindow
GUIWindow()
Definition: GUIWindow.cpp:765
localization
Localization * localization
Definition: Localization.cpp:11
dialogue_ui_x_x_u
Image * dialogue_ui_x_x_u
Definition: GUIWindow.cpp:92
pNPCPortraits_y
std::array< std::array< int, 6 >, 6 > pNPCPortraits_y
Definition: mm7_data.cpp:290
pNPCPortraits_x
std::array< std::array< int, 6 >, 6 > pNPCPortraits_x
Definition: mm7_data.cpp:282
GUIWindow::DrawTitleText
void DrawTitleText(GUIFont *font, int horizontal_margin, int vertical_margin, unsigned __int16 uDefaultColor, const char *pInString, int line_spacing)
Definition: GUIWindow.cpp:665
GUIWindow::Release
virtual void Release()
Definition: GUIWindow.cpp:292
pFontCreate
GUIFont * pFontCreate
Definition: GUIFont.cpp:22
GUIWindow::uFrameWidth
unsigned int uFrameWidth
Definition: GUIWindow.h:470
GUIWindow::uFrameZ
unsigned int uFrameZ
Definition: GUIWindow.h:472
current_screen_type
enum CURRENT_SCREEN current_screen_type
Definition: GUIWindow.cpp:83
pMapStats
struct MapStats * pMapStats
Definition: mm7_data.cpp:20
pBtn_ExitCancel
GUIButton * pBtn_ExitCancel
Definition: GUIButton.cpp:28
pBtn_YES
GUIButton * pBtn_YES
Definition: GUIButton.cpp:29
pParty
Party * pParty
Definition: Party.cpp:30
prev_screen_type
enum CURRENT_SCREEN prev_screen_type
Definition: GUIWindow.cpp:84
transition_ui_icon
Image * transition_ui_icon
Definition: UITransition.cpp:28
game_ui_right_panel_frame
Image * game_ui_right_panel_frame
Definition: GUIWindow.cpp:90
UIMSG_CHANGE_LOCATION_ClickCencelBtn
@ UIMSG_CHANGE_LOCATION_ClickCencelBtn
Definition: GUIWindow.h:76
GUIFont::CalcTextHeight
unsigned int CalcTextHeight(const String &str, unsigned int width, int x_offset, bool return_on_carriage=false)
Definition: GUIFont.cpp:246
UIMSG_OnTravelByFoot
@ UIMSG_OnTravelByFoot
Definition: GUIWindow.h:75
window
EGLSurface EGLNativeWindowType * window
Definition: SDL_egl.h:1580
f
GLfloat f
Definition: SDL_opengl_glext.h:1873
MapInfo::pName
String pName
Definition: MapInfo.h:38
Timer::Pause
void Pause()
Definition: Time.cpp:19
pCurrentMapName
String pCurrentMapName
Definition: mm7_data.cpp:712
CURRENT_SCREEN::SCREEN_CHANGE_LOCATION
@ SCREEN_CHANGE_LOCATION
GetTravelTime
int GetTravelTime()
Definition: Party.cpp:1171
assets
AssetsManager * assets
Definition: AssetsManager.cpp:12
ui_buttyes2
Image * ui_buttyes2
Definition: GUIWindow.cpp:95
Localization::FormatString
String FormatString(unsigned int index,...) const
Definition: Localization.cpp:17
OutdoorLocation::GetTravelDestination
bool GetTravelDestination(signed int sPartyX, signed int sPartyZ, char *pOut, signed int a5)
Definition: Outdoor.cpp:330
game_ui_dialogue_background
Image * game_ui_dialogue_background
Definition: UIGame.cpp:93
pPrimaryWindow
GUIWindow * pPrimaryWindow
Definition: GUIWindow.cpp:48
GUIWindow::uFrameX
unsigned int uFrameX
Definition: GUIWindow.h:468
GUIWindow::sHint
String sHint
Definition: GUIWindow.h:488
pOutdoor
OutdoorLocation * pOutdoor
Definition: Outdoor.cpp:48
String
std::string String
Definition: Strings.h:10
_unused_5B5924_is_travel_ui_drawn
int _unused_5B5924_is_travel_ui_drawn
Definition: mm7_data.cpp:621
pEventTimer
Timer * pEventTimer
Definition: Time.cpp:8
Image::Release
bool Release()
Definition: Image.cpp:335
dialogue_ui_x_ok_u
Image * dialogue_ui_x_ok_u
Definition: GUIWindow.cpp:91
Party::alignment
PartyAlignment alignment
Definition: Party.h:308
render
std::shared_ptr< IRender > render
Definition: RenderOpenGL.cpp:52