World of Might and Magic
0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
|
См. документацию.
35 if ((pNPCInfo->
uFlags & 3) != 2) {
61 int pNumberContacts = 0;
65 (pNumberContacts = pNPCInfo->
uFlags & 0xFFFFFF7F,
66 (pNumberContacts & 0x80000000u) != 0)) {
69 if (pNumberContacts > 1) {
70 if (pNumberContacts == 2) {
73 if (pNumberContacts != 3) {
74 if (pNumberContacts != 4) v9 = 1;
79 }
else if (pNPCInfo->
rep) {
128 int button,
const String &hint)
135 {{ui_exit_cancel_button_background}});
137 int num_menu_buttons = 0;
142 if (speakingNPC->
joins) {
143 CreateButton(480, 130, 140, v11, 1, 0,
145 num_menu_buttons = 1;
147 if (speakingNPC->
evt_A) {
148 if (num_menu_buttons < 4) {
150 if (v14 == 1 || v14 == 2)
152 0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11,
156 if (speakingNPC->
evt_B) {
157 if (num_menu_buttons < 4) {
159 if (v16 == 1 || v16 == 2)
161 0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11,
165 if (speakingNPC->
evt_C) {
166 if (num_menu_buttons < 4) {
168 if (v18 == 1 || v18 == 2)
170 0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11,
174 if (speakingNPC->
evt_D) {
175 if (num_menu_buttons < 4) {
177 if (v20 == 1 || v20 == 2)
179 0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11,
183 if (speakingNPC->
evt_E) {
184 if (num_menu_buttons < 4) {
186 if (v22 == 1 || v22 == 2)
188 0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11,
192 if (speakingNPC->
evt_F) {
193 if (num_menu_buttons < 4) {
195 if (v24 == 1 || v24 == 2)
197 0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11,
202 if (speakingNPC->
joins) {
203 CreateButton(0x1E0u, 0x82u, 0x8Cu, v11, 1, 0,
206 if (speakingNPC->
Hired()) {
208 0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0,
212 speakingNPC->
pName));
214 CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0,
218 num_menu_buttons = 2;
221 _41D08F_set_keyboard_control_group(num_menu_buttons, 1, 0, 1);
267 }
else if (pNPC->
pName) {
291 else if (pNPC->
Hired())
331 }
else if (pGreetType == 1) {
333 if ((pNPC->
uFlags & 3) == 2)
340 }
else if (pGreetType == 2) {
357 if (!dialogue_string.empty()) {
364 if (352 - pTextHeight < 8) {
372 render->DrawTextureCustomHeight(8 / 640.0
f,
373 (352 - pTextHeight) / 480.0
f,
376 render->DrawTextureAlphaNew(8 / 640.0
f, (347 - pTextHeight) / 480.0
f,
379 font, 13, 354 - pTextHeight, 0,
389 for (
int i =
window.pStartingPosActiveItem;
390 i <
window.pStartingPosActiveItem +
window.pNumPresenceButton; ++i) {
474 int num_dead_actors = 0;
481 int sumonner_type = PID_TYPE(
pActors[i].uSummonerID);
494 int all_text_height = 0;
507 int v45 = (174 - all_text_height) /
index;
508 if (v45 > 32) v45 = 32;
509 int v42 = (174 - v45 *
index - all_text_height) / 2 - v45 / 2 + 138;
516 pButton->
uY = (
unsigned int)(v45 + v42);
519 pButton->
uHeight = pTextHeight;
520 v42 = pButton->
uY + pTextHeight - 1;
529 render->DrawTextureAlphaNew(471 / 640.0
f, 445 / 480.0
f,
536 unsigned int x,
unsigned int y,
unsigned int width,
unsigned int height,
537 int button,
const String &hint
562 BranchlessDlg_window.
uFrameZ = 452;
567 if (352 - pTextHeight < 8) {
575 render->DrawTextureCustomHeight(8 / 640.0
f, (352 - pTextHeight) / 480.0
f,
577 render->DrawTextureAlphaNew(8 / 640.0
f, (347 - pTextHeight) / 480.0
f,
580 pFont, 12, 354 - pTextHeight, 0,
670 if (speakingNPC->
Hired()) {
675 !strcmp(speakingNPC->
pName,
713 speakingNPC->
uFlags |= 0x80u;
723 strcpy(v13, speakingNPC->
pName);
733 (
int)newDialogueType <=
748 if (!speakingNPC->
Hired()) {
754 !strcmp(speakingNPC->
pName,
772 switch (newDialogueType) {
774 npc_event_id = speakingNPC->
evt_A;
777 npc_event_id = speakingNPC->
evt_B;
780 npc_event_id = speakingNPC->
evt_C;
783 npc_event_id = speakingNPC->
evt_D;
786 npc_event_id = speakingNPC->
evt_E;
789 npc_event_id = speakingNPC->
evt_F;
792 if ((npc_event_id >= 200) && (npc_event_id <= 310)) {
794 }
else if ((npc_event_id >= 400) && (npc_event_id <= 410)) {
798 switch (npc_event_id) {
int uNumDialogueNPCPortraits
unsigned __int16 uint16_t
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)
NPCData * GetNPCData(signed int npcid)
void EnterText(int a2, int max_string_len, GUIWindow *pWindow)
const char * GetString(unsigned int index) const
Texture * GetImage_Solid(const String &name)
Image * ui_exit_cancel_button_background
@ DIALOGUE_PROFESSION_DETAILS
void sub_4451A8_press_any_key(int a1, int a2, int a4)
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 * >())
int gold_transaction_amount
EGLSurface EGLint EGLint EGLint EGLint height
int GetGreetType(signed int SpeakingNPC_ID)
unsigned __int8 hirelingScrollPosition
std::array< NPCTopic, 789 > pNPCTopics
char field_7B5_in_arena_quest
std::shared_ptr< Engine > engine
unsigned int game_viewport_width
struct LevelDecoration * _591094_decoration
Localization * localization
unsigned int ui_game_dialogue_option_normal_color
unsigned int uCurrentHour
std::array< std::array< int, 6 >, 6 > pNPCPortraits_y
struct Actor * pDialogue_SpeakingActor
std::array< std::array< int, 6 >, 6 > pNPCPortraits_x
unsigned int GetLineWidth(const String &str)
void GameUI_StatusBar_ClearInputString()
unsigned int GetHeight() const
@ DIALOGUE_ARENA_SELECT_CHAMPION
NZIArray< struct Player *, 5 > pPlayers
const char * GetProfessionActionText(int a1)
int receives_keyboard_input_2
enum CURRENT_SCREEN current_screen_type
unsigned int GetPartyFame()
int pStartingPosActiveItem
void _41D08F_set_keyboard_control_group(int num_buttons, int a3, int a4, int a5)
@ DIALOGUE_ARENA_FIGHT_NOT_OVER_YET
GUIWindow_GenericDialogue(unsigned int x, unsigned int y, unsigned int width, unsigned int height, int button, const String &hint=String())
EGLSurface EGLint EGLint y
@ SCREEN_BRANCHLESS_NPC_DIALOG
int NPC_EventProcessor(int npc_event_id, int entry_line)
LevelDecoration * activeLevelDecoration
String GameUI_StatusBar_GetInput()
int pCurrentPosActiveItem
enum CURRENT_SCREEN prev_screen_type
NPCProfession pProfessions[59]
NPCGreeting pNPCGreetings[205]
Texture * GetImage_ColorKey(const String &name, uint16_t colorkey)
char pPressedKeysBuffer[257]
Image * game_ui_right_panel_frame
EGLSurface EGLint EGLint EGLint width
unsigned int ui_game_dialogue_option_highlight_color
static void TakeGold(int amount)
char dialogue_show_profession_details
void StopChannels(int uStartChannel, int uEndChannel)
unsigned int CalcTextHeight(const String &str, unsigned int width, int x_offset, bool return_on_carriage=false)
std::array< Actor, 500 > pActors
void DrawJoinGuildWindow(int pEventCode)
EGLSurface EGLNativeWindowType * window
String branchless_dialogue_str
void Arena_SelectionFightLevel()
void OnSelectNPCDialogueOption(DIALOGUE_TYPE newDialogueType)
void GameUI_StatusBar_OnInput(const String &str)
@ DIALOGUE_ARENA_ALREADY_WON
void SetWindowInputStatus(int a2)
void DrawFlashingInputCursor(int uX, int uY, GUIFont *a2)
String BuildDialogueString(const char *lpsz, unsigned __int8 uPlayerID, ItemGen *a3, char *a4, int a5, GameTime *a6)
std::array< NPCData, 2 > pHirelings
std::array< class Image *, 6 > pDialogueNPCPortraits
unsigned int uDialogueType
struct KeyboardActionMapping * pKeyActionMap
Image * game_ui_statusbar
void CheckBountyRespawnAndAward()
unsigned int uActiveCharacter
String FormatString(unsigned int index,...) const
void __cdecl __debugbreak(void)
String FitTextInAWindow(const String &inString, unsigned int width, int uX, bool return_on_carriage=false)
struct NPCStats * pNPCStats
void GameUI_StatusBar_OnEvent(const String &str, unsigned int num_seconds)
void _4B3FE5_training_dialogue(int a4)
const char * GetNpcProfessionName(unsigned int index) const
unsigned int ui_game_dialogue_npc_name_color
void EventProcessor(int uEventID, int targetObj, int canShowMessages, int entry_line)
Image * game_ui_dialogue_background
GUIButton * GetControl(unsigned int uID)
static int dword_AE336C_LastMispronouncedNameFirstLetter
AudioPlayer * pAudioPlayer
struct GUIMessageQueue * pMessageQueue_50CBD0
GUIWindow * pDialogueWindow
int UseNPCSkill(NPCProf profession)
String StringPrintf(const char *fmt,...)
GUIWindow_Dialogue(unsigned int x, unsigned int y, unsigned int width, unsigned int height, int button, const String &hint=String())
void GameUI_InitializeDialogue(Actor *actor, int bPlayerSaysHello)
@ DIALOGUE_USE_NPC_ABILITY
@ UIMSG_SelectNPCDialogueOption
int sDialogue_SpeakingActorNPC_ID
std::shared_ptr< IRender > render