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

#include <UITransition.h>

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

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

 GUIWindow_Transition (uint32_t anim_id, uint32_t exit_pic_id, int x, int y, int z, int directiony, int directionx, int a8, const char *pLocationName)
 
virtual ~GUIWindow_Transition ()
 
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 строка 14

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

◆ GUIWindow_Transition()

GUIWindow_Transition::GUIWindow_Transition ( uint32_t  anim_id,
uint32_t  exit_pic_id,
int  x,
int  y,
int  z,
int  directiony,
int  directionx,
int  a8,
const char *  pLocationName 
)

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

74  : GUIWindow(WINDOW_Transition, 0, 0, window->GetWidth(), window->GetHeight(), 0) {
78  Party_Teleport_Cam_Yaw = directiony;
79  Party_Teleport_Cam_Pitch = directionx;
81  Party_Teleport_Map_Name = (char *)pLocationName;
82  uCurrentHouse_Animation = anim_id;
83  pEventTimer->Pause();
84  pAudioPlayer->StopChannels(-1, -1);
85 
86  String filename;
87  switch (pParty->alignment) {
89  filename = "evt02-b";
90  break;
92  filename = "evt02";
93  break;
95  filename = "evt02-c";
96  break;
97  default:
98  Error("Invalid alignment: %u", pParty->alignment);
99  }
101 
104  if (anim_id) {
105  if (!IndoorLocation::GetLocationIndex(pLocationName))
107  pAnimatedRooms[p2DEvents[anim_id - 1].uAnimationID].video_name,
108  1);
109 
110  String v15 = pLocationName;
111  if (*pLocationName == 48) {
112  v15 = pCurrentMapName;
113  }
114  if (pMapStats->GetMapInfo(v15)) {
116  411, pMapStats->pInfos[pMapStats->GetMapInfo(v15)]
117  .pName.c_str()); // Enter %s Войти в ^Pv[%s]
118 
120  pParty->uFlags & 0x30)
121  pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
122  if (IndoorLocation::GetLocationIndex(pLocationName))
124  IndoorLocation::GetLocationIndex(pLocationName);
125  } else {
127  73); // Enter Войти
128  // if (
129  // pAnimatedRooms[p2DEvents[anim_id].uAnimationID].uRoomSoundId
130  // )
131  // PlayHouseSound(anim_id, HouseSound_Greeting);
133  pParty->uFlags & 0x30)
134  pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
135  if (IndoorLocation::GetLocationIndex(pLocationName))
137  IndoorLocation::GetLocationIndex(pLocationName);
138  }
139  } else if (!IndoorLocation::GetLocationIndex(pLocationName)) {
142  410,
144  .pName.c_str()); // "Leave %s"
145  // if (
146  // pAnimatedRooms[p2DEvents[anim_id].uAnimationID].uRoomSoundId
147  // ) PlayHouseSound(anim_id, HouseSound_Greeting);
149  pParty->uFlags & 0x30)
150  pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
151  if (IndoorLocation::GetLocationIndex(pLocationName))
153  IndoorLocation::GetLocationIndex(pLocationName);
154  } else {
156  // if ( pAnimatedRooms[p2DEvents[anim_id].uAnimationID].uRoomSoundId
157  // ) PlayHouseSound(anim_id, HouseSound_Greeting);
159  pParty->uFlags & 0x30)
160  pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
161  if (IndoorLocation::GetLocationIndex(pLocationName))
163  IndoorLocation::GetLocationIndex(pLocationName);
164  }
165  }
166 
167  String hint = this->sHint = transition_button_label;
168 
172  0x236u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_TransitionWindowCloseBtn, 0,
173  'N', localization->GetString(34), {{ui_buttdesc2}}); // Cancel / Отмена
174  pBtn_YES =
175  CreateButton(0x1E6u, 0x1BDu, 0x4Bu, 0x21u, 1, 0,
176  UIMSG_TransitionUI_Confirm, 0, 'Y', hint, {{ui_buttyes2}});
177  CreateButton(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 0x3Fu, 0x49u, 1,
178  0, UIMSG_TransitionUI_Confirm, 1, 0x20u, hint);
179  CreateButton(8, 8, 0x1CCu, 0x158u, 1, 0, UIMSG_TransitionUI_Confirm, 1u, 0,
180  hint);
181 }

Перекрестные ссылки Party::alignment, assets, GUIWindow::CreateButton(), current_screen_type, Localization::FormatString(), game_ui_dialogue_background, AssetsManager::GetImage_Solid(), IndoorLocation::GetLocationIndex(), MapStats::GetMapInfo(), Localization::GetString(), LEVEL_Indoor, localization, MPlayer::OpenHouseMovie(), p2DEvents, pAnimatedRooms, Party_Teleport_Cam_Pitch, Party_Teleport_Cam_Yaw, Party_Teleport_Map_Name, Party_Teleport_X_Pos, Party_Teleport_Y_Pos, Party_Teleport_Z_Pos, Party_Teleport_Z_Speed, PartyAlignment_Evil, PartyAlignment_Good, PartyAlignment_Neutral, pAudioPlayer, Timer::Pause(), pBtn_ExitCancel, pCurrentMapName, pEventTimer, pHouse_ExitPictures, MapStats::pInfos, pMapStats, pMediaPlayer, MapInfo::pName, pParty, pPlayers, prev_screen_type, SCREEN_INPUT_BLV, GUIWindow::sHint, SPEECH_47, AudioPlayer::StopChannels(), transition_button_label, transition_ui_icon, uActiveCharacter, uCurrentHouse_Animation, uCurrentlyLoadedLevelType, Party::uFlags и UIMSG_TransitionWindowCloseBtn.

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

◆ ~GUIWindow_Transition()

virtual GUIWindow_Transition::~GUIWindow_Transition ( )
inlinevirtual

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

17 {}

Методы

◆ Update()

void GUIWindow_Transition::Update ( )
virtual

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

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

279  {
280  unsigned int v9 =
282  render->DrawTextureNew(477 / 640.0f, 0, game_ui_dialogue_background);
283  render->DrawTextureAlphaNew((pNPCPortraits_x[0][0] - 4) / 640.0f,
284  (pNPCPortraits_y[0][0] - 4) / 480.0f,
286  render->DrawTextureNew(pNPCPortraits_x[0][0] / 640.0f,
287  pNPCPortraits_y[0][0] / 480.0f, transition_ui_icon);
288 
289  render->DrawTextureAlphaNew(468 / 640.0f, 0, game_ui_right_panel_frame);
290  render->DrawTextureAlphaNew(556 / 640.0f, 451 / 480.0f, dialogue_ui_x_x_u);
291  render->DrawTextureAlphaNew(476 / 640.0f, 451 / 480.0f, dialogue_ui_x_ok_u);
292  unsigned int map_id = pMapStats->GetMapInfo(pCurrentMapName);
293  if ((pMovie_Track || v9) && *Party_Teleport_Map_Name != ' ') {
295  }
296 
297  GUIWindow transition_window = *pPrimaryWindow;
298  transition_window.uFrameX = 493;
299  transition_window.uFrameWidth = 126;
300  transition_window.uFrameZ = 366;
301  transition_window.DrawTitleText(pFontCreate, 0, 5, 0,
302  pMapStats->pInfos[map_id].pName, 3);
303  transition_window.uFrameX = 483;
304  transition_window.uFrameWidth = 148;
305  transition_window.uFrameZ = 334;
306 
308  unsigned int v4 =
309  (212 - pFontCreate->CalcTextHeight(
311  transition_window.uFrameWidth, 0)) /
312  2 +
313  101;
314  transition_window.DrawTitleText(
316  3);
317  } else if (map_id) {
319  409, pMapStats->pInfos[map_id].pName.c_str()); // Do you wish to leave %s?
320  unsigned int v4 = (212 - pFontCreate->CalcTextHeight(
321  str, transition_window.uFrameWidth, 0)) /
322  2 +
323  101;
324  transition_window.DrawTitleText(pFontCreate, 0, v4, 0, str, 3);
325  } else {
326  Error("Troubles in da house");
327  }
328 
330 }

Перекрестные ссылки _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_evtnpc, game_ui_right_panel_frame, IndoorLocation::GetLocationIndex(), MapStats::GetMapInfo(), localization, Party_Teleport_Map_Name, pCurrentMapName, pFontCreate, MapStats::pInfos, pMapStats, pMovie_Track, MapInfo::pName, pNPCPortraits_x, pNPCPortraits_y, pPrimaryWindow, pTransitionStrings, render, transition_ui_icon, uCurrentHouse_Animation, GUIWindow::uFrameWidth, GUIWindow::uFrameX и GUIWindow::uFrameZ.

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

◆ Release()

void GUIWindow_Transition::Release ( )
virtual

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

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

50  {
51  // -----------------------------------------
52  // 0041C26A void GUIWindow::Release --- part
53  // pVideoPlayer->Unload();
54  if (transition_ui_icon) {
56  transition_ui_icon = nullptr;
57  }
58 
62  }
63 
65 
67 }

Перекрестные ссылки 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
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
Party_Teleport_Y_Pos
int Party_Teleport_Y_Pos
Definition: mm7_data.cpp:623
z
GLdouble GLdouble z
Definition: SDL_opengl_glext.h:407
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
pTransitionStrings
std::array< char *, 465 > pTransitionStrings
Definition: mm7_data.cpp:309
GUIWindow::GUIWindow
GUIWindow()
Definition: GUIWindow.cpp:765
pHouse_ExitPictures
std::array< const char *, 11 > pHouse_ExitPictures
Definition: mm7_data.cpp:298
localization
Localization * localization
Definition: Localization.cpp:11
pAnimatedRooms
std::array< const stru159, 196 > pAnimatedRooms
Definition: UIHouses.cpp:132
dialogue_ui_x_x_u
Image * dialogue_ui_x_x_u
Definition: GUIWindow.cpp:92
pMediaPlayer
MPlayer * pMediaPlayer
Definition: MediaPlayer.cpp:43
UIMSG_TransitionWindowCloseBtn
@ UIMSG_TransitionWindowCloseBtn
Definition: GUIWindow.h:199
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
pMovie_Track
PMovie pMovie_Track
Definition: MediaPlayer.cpp:44
pPlayers
NZIArray< struct Player *, 5 > pPlayers
Definition: Player.cpp:46
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
p2DEvents
_2devent p2DEvents[525]
Definition: Events.cpp:57
SPEECH_47
@ SPEECH_47
Definition: Player.h:93
pMapStats
struct MapStats * pMapStats
Definition: mm7_data.cpp:20
IndoorLocation::GetLocationIndex
static unsigned int GetLocationIndex(const char *Str1)
Definition: Indoor.cpp:839
MPlayer::OpenHouseMovie
void OpenHouseMovie(const std::string &pMovieName, bool bLoop)
Definition: MediaPlayer.cpp:633
y
EGLSurface EGLint EGLint y
Definition: SDL_egl.h:1596
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
Party_Teleport_Cam_Pitch
int Party_Teleport_Cam_Pitch
Definition: mm7_data.cpp:626
WINDOW_Transition
@ WINDOW_Transition
Definition: GUIWindow.h:310
prev_screen_type
enum CURRENT_SCREEN prev_screen_type
Definition: GUIWindow.cpp:84
x
EGLSurface EGLint x
Definition: SDL_egl.h:1596
transition_ui_icon
Image * transition_ui_icon
Definition: UITransition.cpp:28
Party_Teleport_Map_Name
char * Party_Teleport_Map_Name
Definition: mm7_data.cpp:608
Party_Teleport_X_Pos
int Party_Teleport_X_Pos
Definition: mm7_data.cpp:622
game_ui_right_panel_frame
Image * game_ui_right_panel_frame
Definition: GUIWindow.cpp:90
game_ui_evtnpc
Image * game_ui_evtnpc
Definition: UIGame.cpp:102
AudioPlayer::StopChannels
void StopChannels(int uStartChannel, int uEndChannel)
Definition: AudioPlayer.cpp:331
GUIFont::CalcTextHeight
unsigned int CalcTextHeight(const String &str, unsigned int width, int x_offset, bool return_on_carriage=false)
Definition: GUIFont.cpp:246
Party_Teleport_Cam_Yaw
int Party_Teleport_Cam_Yaw
Definition: mm7_data.cpp:625
uCurrentHouse_Animation
int uCurrentHouse_Animation
Definition: mm7_data.cpp:607
window
EGLSurface EGLNativeWindowType * window
Definition: SDL_egl.h:1580
Party::uFlags
unsigned int uFlags
Definition: Party.h:313
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_INPUT_BLV
@ SCREEN_INPUT_BLV
LEVEL_Indoor
@ LEVEL_Indoor
Definition: Indoor.h:286
Party_Teleport_Z_Speed
int Party_Teleport_Z_Speed
Definition: mm7_data.cpp:627
UIMSG_TransitionUI_Confirm
@ UIMSG_TransitionUI_Confirm
Definition: GUIWindow.h:198
assets
AssetsManager * assets
Definition: AssetsManager.cpp:12
ui_buttyes2
Image * ui_buttyes2
Definition: GUIWindow.cpp:95
uActiveCharacter
unsigned int uActiveCharacter
Definition: mm7_data.cpp:555
Localization::FormatString
String FormatString(unsigned int index,...) const
Definition: Localization.cpp:17
game_ui_dialogue_background
Image * game_ui_dialogue_background
Definition: UIGame.cpp:93
uCurrentlyLoadedLevelType
LEVEL_TYPE uCurrentlyLoadedLevelType
Definition: Indoor.cpp:52
pPrimaryWindow
GUIWindow * pPrimaryWindow
Definition: GUIWindow.cpp:48
GUIWindow::uFrameX
unsigned int uFrameX
Definition: GUIWindow.h:468
GUIWindow::sHint
String sHint
Definition: GUIWindow.h:488
pAudioPlayer
AudioPlayer * pAudioPlayer
Definition: AudioPlayer.cpp:20
Party_Teleport_Z_Pos
int Party_Teleport_Z_Pos
Definition: mm7_data.cpp:624
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