World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Структура GUIWindow_LloydsBook

#include <LloydsBook.h>

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

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

 GUIWindow_LloydsBook ()
 
virtual ~GUIWindow_LloydsBook ()
 
virtual void Update ()
 
- Открытые члены унаследованные от GUIWindow_Book
 GUIWindow_Book ()
 
virtual ~GUIWindow_Book ()
 
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
 
- Защищенные члены унаследованные от GUIWindow_Book
void BasicBookInitialization ()
 

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

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

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

◆ GUIWindow_LloydsBook()

GUIWindow_LloydsBook::GUIWindow_LloydsBook ( )

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

23  : GUIWindow_Book() {
24  this->ptr_1C = (void *)WINDOW_LloydsBeacon; // inherited from GUIWindow::GUIWindow
26 
28  if (!ui_book_lloyds_border) {
29  ui_book_lloyds_border = assets->GetImage_ColorKey("lb_bordr", 0x7FF);
30  }
31 
36 
37  pBtn_Book_1 =
38  CreateButton(415, 13, 39, 36, 1, 0, UIMSG_LloydsBeacon_FlippingBtn, 0,
39  0, localization->GetString(375)); // Set Beacon
40  pBtn_Book_2 =
41  CreateButton(415, 48, 39, 36, 1, 0, UIMSG_LloydsBeacon_FlippingBtn, 1,
42  0, localization->GetString(523)); // Recall Beacon
43 
44  int max_beacons = 1;
46  .pActiveSkills[PLAYER_SKILL_WATER];
47  if (water_skill & 0x100 || (water_skill & 0x80))
48  max_beacons = 5;
49  else if (water_skill & 0x40)
50  max_beacons = 3;
51 
52  for (int i = 0; i < max_beacons; ++i) {
54  68, 1, UIMSG_HintBeaconSlot, UIMSG_InstallBeacon, i, 0, "");
55  }
56 
58 }

Перекрестные ссылки _506348_current_lloyd_playerid, _506360_installing_beacon, assets, GUIWindow_Book::BasicBookInitialization(), GUIWindow::CreateButton(), AssetsManager::GetImage_Alpha(), AssetsManager::GetImage_ColorKey(), Localization::GetString(), localization, pBtn_Book_1, pBtn_Book_2, PLAYER_SKILL_WATER, pLloydsBeaconsPreviewXs, pLloydsBeaconsPreviewYs, pParty, Party::pPlayers, GUIWindow::ptr_1C, ui_book_button1_off, ui_book_button1_on, ui_book_lloyds_backgrounds, ui_book_lloyds_border, UIMSG_HintBeaconSlot, UIMSG_InstallBeacon, UIMSG_LloydsBeacon_FlippingBtn и WINDOW_LloydsBeacon.

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

◆ ~GUIWindow_LloydsBook()

virtual GUIWindow_LloydsBook::~GUIWindow_LloydsBook ( )
inlinevirtual

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

6 {}

Методы

◆ Update()

void GUIWindow_LloydsBook::Update ( )
virtual

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

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

60  {
61  render->DrawTextureAlphaNew(471 / 640.0f, 445 / 480.0f, ui_exit_cancel_button_background);
62 
64  render->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, ui_book_lloyds_backgrounds[bRecallingBeacon ? 1 : 0]);
65  String pText = localization->GetString(523); // Recall Beacon
66 
67  GUIWindow pWindow;
68  pWindow.uFrameX = game_viewport_x;
69  pWindow.uFrameY = game_viewport_y;
70  pWindow.uFrameWidth = 428;
72  pWindow.uFrameZ = 435;
73  pWindow.uFrameW = game_viewport_w;
74  if (!bRecallingBeacon) {
75  pText = localization->GetString(375); // Set Beacon
76  }
77 
78  pWindow.DrawTitleText(pBook2Font, 0, 22, 0, pText, 3);
79  if (bRecallingBeacon) {
80  render->DrawTextureAlphaNew(pBtn_Book_1->uX / 640.0f,
81  pBtn_Book_1->uY / 480.0f,
83  render->DrawTextureAlphaNew(pBtn_Book_2->uX / 640.0f,
84  pBtn_Book_2->uY / 480.0f,
86  } else {
87  render->DrawTextureAlphaNew(pBtn_Book_1->uX / 640.0f,
88  pBtn_Book_1->uY / 480.0f,
90  render->DrawTextureAlphaNew(pBtn_Book_2->uX / 640.0f,
91  pBtn_Book_2->uY / 480.0f,
93  }
94  int uNumMaxBeacons = 1;
95  if ((pPlayer->pActiveSkills[PLAYER_SKILL_WATER] & 0x100) ||
96  (pPlayer->pActiveSkills[PLAYER_SKILL_WATER] & 0x80)) {
97  uNumMaxBeacons = 5;
98  } else if (pPlayer->pActiveSkills[PLAYER_SKILL_WATER] & 0x40) {
99  uNumMaxBeacons = 3;
100  }
101 
102  if (uNumMaxBeacons > 0) {
103  for (size_t BeaconID = 0; BeaconID < uNumMaxBeacons; BeaconID++) {
104  if ((BeaconID >= pPlayer->vBeacons.size()) && bRecallingBeacon) {
105  break;
106  }
107 
108  pWindow.uFrameWidth = 92;
109  pWindow.uFrameHeight = 68;
110  pWindow.uFrameY = pLloydsBeaconsPreviewYs[BeaconID];
111  pWindow.uFrameX = pLloydsBeaconsPreviewXs[BeaconID];
112  pWindow.uFrameW = pWindow.uFrameY + 67;
113  pWindow.uFrameZ = pLloydsBeaconsPreviewXs[BeaconID] + 91;
114 
115  render->DrawTextureAlphaNew(
116  pLloydsBeacons_SomeXs[BeaconID] / 640.0f,
117  pLloydsBeacons_SomeYs[BeaconID] / 480.0f,
119 
120  if (BeaconID < pPlayer->vBeacons.size()) {
121  LloydBeacon &beacon = pPlayer->vBeacons[BeaconID];
122  render->DrawTextureNew(
123  pLloydsBeaconsPreviewXs[BeaconID] / 640.0f,
124  pLloydsBeaconsPreviewYs[BeaconID] / 480.0f,
125  beacon.image);
127  unsigned int pTextHeight = pSpellFont->CalcTextHeight(Str, pWindow.uFrameWidth, 0);
128  pWindow.uFrameY -= 6 + pTextHeight;
129  pWindow.DrawTitleText(pSpellFont, 0, 0, 1, Str, 3);
130 
131  pWindow.uFrameY = pLloydsBeaconsPreviewYs[BeaconID];
132  GameTime RemainingTime = beacon.uBeaconTime - pParty->GetPlayingTime();
133  unsigned int pHours = RemainingTime.GetHoursOfDay();
134  unsigned int pDays = RemainingTime.GetDays();
135  String str;
136  if (pDays > 1) {
137  str = StringPrintf("%lu %s", pDays + 1, localization->GetString(57)); // days
138  } else if (pHours + 1 <= 23) {
139  str = StringPrintf("%lu %s", pHours + 1, localization->GetString((pHours < 1) ? 109 : 110));
140  } else {
141  str = StringPrintf("%lu %s", pDays + 1, localization->GetString(56)); // Day
142  }
143  pWindow.uFrameY = pWindow.uFrameY + pWindow.uFrameHeight + 4;
144  pWindow.DrawTitleText(pSpellFont, 0, 0, 1, str, 3);
145  } else {
146  unsigned int pTextHeight = pSpellFont->CalcTextHeight(localization->GetString(19), pWindow.uFrameWidth, 0);
147  pWindow.DrawTitleText(pSpellFont, 0,
148  (int)pWindow.uFrameHeight / 2 - pTextHeight / 2, 1,
149  localization->GetString(19), 3); // Доступно
150  }
151  }
152  }
153 
156  }
157 }

Перекрестные ссылки _506348_current_lloyd_playerid, _506360_installing_beacon, bRecallingBeacon, GUIFont::CalcTextHeight(), GUIWindow::DrawTitleText(), game_viewport_height, game_viewport_w, game_viewport_x, game_viewport_y, GameTime::GetDays(), GameTime::GetHoursOfDay(), Party::GetPlayingTime(), Localization::GetString(), LloydBeacon::image, localization, Player::pActiveSkills, pBook2Font, pBtn_Book_1, pBtn_Book_2, MapStats::pInfos, PLAYER_SKILL_WATER, pLloydsBeacons_SomeXs, pLloydsBeacons_SomeYs, pLloydsBeaconsPreviewXs, pLloydsBeaconsPreviewYs, pMapStats, pMessageQueue_50CBD0, MapInfo::pName, pParty, Party::pPlayers, pSpellFont, render, LloydBeacon::SaveFileID, StringPrintf(), MapStats::sub_410D99_get_map_index(), LloydBeacon::uBeaconTime, GUIWindow::uFrameHeight, GUIWindow::uFrameW, GUIWindow::uFrameWidth, GUIWindow::uFrameX, GUIWindow::uFrameY, GUIWindow::uFrameZ, ui_book_button1_off, ui_book_button1_on, ui_book_lloyds_backgrounds, ui_book_lloyds_border, ui_exit_cancel_button_background, UIMSG_CloseAfterInstallBeacon, GUIButton::uX, GUIButton::uY и Player::vBeacons.

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

Объявления и описания членов структур находятся в файлах:
Player
Definition: Player.h:401
GUIWindow::uFrameW
unsigned int uFrameW
Definition: GUIWindow.h:473
Localization::GetString
const char * GetString(unsigned int index) const
Definition: Localization.cpp:13
MapStats::pInfos
MapInfo pInfos[77]
Definition: MapInfo.h:79
Party::GetPlayingTime
GameTime & GetPlayingTime()
Definition: Party.h:230
GameTime::GetDays
int GetDays() const
Definition: Time.h:32
UIMSG_HintBeaconSlot
@ UIMSG_HintBeaconSlot
Definition: GUIWindow.h:147
GUIWindow
Definition: GUIWindow.h:433
ui_exit_cancel_button_background
Image * ui_exit_cancel_button_background
Definition: GUIWindow.cpp:89
UIMSG_LloydsBeacon_FlippingBtn
@ UIMSG_LloydsBeacon_FlippingBtn
Definition: GUIWindow.h:145
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
ui_book_button1_on
Image * ui_book_button1_on
Definition: UIBooks.cpp:34
pBtn_Book_1
GUIButton * pBtn_Book_1
Definition: GUIButton.cpp:23
localization
Localization * localization
Definition: Localization.cpp:11
game_viewport_x
int game_viewport_x
Definition: mm7_data.cpp:196
Party::pPlayers
std::array< Player, 4 > pPlayers
Definition: Party.h:310
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
Player::pActiveSkills
std::array< unsigned __int16, 37 > pActiveSkills
Definition: Player.h:711
GUIWindow::uFrameWidth
unsigned int uFrameWidth
Definition: GUIWindow.h:470
game_viewport_height
unsigned int game_viewport_height
Definition: mm7_data.cpp:195
GUIWindow::uFrameZ
unsigned int uFrameZ
Definition: GUIWindow.h:472
pMapStats
struct MapStats * pMapStats
Definition: mm7_data.cpp:20
game_viewport_y
int game_viewport_y
Definition: mm7_data.cpp:197
pParty
Party * pParty
Definition: Party.cpp:30
pSpellFont
GUIFont * pSpellFont
Definition: GUIFont.cpp:17
WINDOW_LloydsBeacon
@ WINDOW_LloydsBeacon
Definition: GUIWindow.h:334
_506360_installing_beacon
bool _506360_installing_beacon
Definition: LloydsBook.cpp:18
AssetsManager::GetImage_ColorKey
Texture * GetImage_ColorKey(const String &name, uint16_t colorkey)
Definition: AssetsManager.cpp:34
GUIWindow::uFrameHeight
unsigned int uFrameHeight
Definition: GUIWindow.h:471
pBook2Font
GUIFont * pBook2Font
Definition: GUIFont.cpp:20
pBtn_Book_2
GUIButton * pBtn_Book_2
Definition: GUIButton.cpp:22
GUIFont::CalcTextHeight
unsigned int CalcTextHeight(const String &str, unsigned int width, int x_offset, bool return_on_carriage=false)
Definition: GUIFont.cpp:246
f
GLfloat f
Definition: SDL_opengl_glext.h:1873
PLAYER_SKILL_WATER
@ PLAYER_SKILL_WATER
Definition: Player.h:185
GameTime::GetHoursOfDay
int GetHoursOfDay() const
Definition: Time.h:39
MapInfo::pName
String pName
Definition: MapInfo.h:38
_506348_current_lloyd_playerid
int _506348_current_lloyd_playerid
Definition: mm7_data.cpp:517
UIMSG_InstallBeacon
@ UIMSG_InstallBeacon
Definition: GUIWindow.h:146
GUIWindow::uFrameY
unsigned int uFrameY
Definition: GUIWindow.h:469
GUIButton::uX
unsigned int uX
Definition: GUIButton.h:21
game_viewport_w
int game_viewport_w
Definition: mm7_data.cpp:199
ui_book_button1_off
Image * ui_book_button1_off
Definition: UIBooks.cpp:33
ui_book_lloyds_backgrounds
std::array< Image *, 2 > ui_book_lloyds_backgrounds
Definition: LloydsBook.cpp:21
MapStats::sub_410D99_get_map_index
int sub_410D99_get_map_index(int a1)
Definition: MapInfo.cpp:213
UIMSG_CloseAfterInstallBeacon
@ UIMSG_CloseAfterInstallBeacon
Definition: GUIWindow.h:148
GUIWindow_Book::BasicBookInitialization
void BasicBookInitialization()
Definition: UIBooks.cpp:67
Player::vBeacons
std::vector< LloydBeacon > vBeacons
Definition: Player.h:794
LloydBeacon::image
Image * image
Definition: Player.h:279
assets
AssetsManager * assets
Definition: AssetsManager.cpp:12
GUIWindow_Book::GUIWindow_Book
GUIWindow_Book()
Definition: UIBooks.cpp:64
GUIButton::uY
unsigned int uY
Definition: GUIButton.h:22
pLloydsBeaconsPreviewXs
std::array< unsigned int, 5 > pLloydsBeaconsPreviewXs
Definition: LloydsBook.cpp:12
ui_book_lloyds_border
Image * ui_book_lloyds_border
Definition: LloydsBook.cpp:20
pLloydsBeaconsPreviewYs
std::array< unsigned int, 5 > pLloydsBeaconsPreviewYs
Definition: LloydsBook.cpp:14
LloydBeacon::SaveFileID
uint16_t SaveFileID
Definition: Player.h:278
GUIWindow::ptr_1C
void * ptr_1C
Definition: GUIWindow.h:476
AssetsManager::GetImage_Alpha
Texture * GetImage_Alpha(const String &name)
Definition: AssetsManager.cpp:66
bRecallingBeacon
bool bRecallingBeacon
Definition: mm7_data.cpp:533
GUIWindow::uFrameX
unsigned int uFrameX
Definition: GUIWindow.h:468
LloydBeacon
Definition: Player.h:254
pMessageQueue_50CBD0
struct GUIMessageQueue * pMessageQueue_50CBD0
Definition: GUIWindow.cpp:86
pLloydsBeacons_SomeXs
std::array< unsigned int, 5 > pLloydsBeacons_SomeXs
Definition: LloydsBook.cpp:15
LloydBeacon::uBeaconTime
GameTime uBeaconTime
Definition: Player.h:271
StringPrintf
String StringPrintf(const char *fmt,...)
Definition: Strings.cpp:9
String
std::string String
Definition: Strings.h:10
pLloydsBeacons_SomeYs
std::array< unsigned int, 5 > pLloydsBeacons_SomeYs
Definition: LloydsBook.cpp:16
GameTime
Definition: Time.h:14
render
std::shared_ptr< IRender > render
Definition: RenderOpenGL.cpp:52