OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Macros | Functions | Variables
UIGame.cpp File Reference
#include <map>
#include <algorithm>
#include <string>
#include "GUI/UI/UIGame.h"
#include "Application/Game.h"
#include "Engine/AssetsManager.h"
#include "Engine/Engine.h"
#include "Engine/EngineGlobals.h"
#include "Engine/Events/Processor.h"
#include "Engine/Graphics/BSPModel.h"
#include "Engine/Objects/DecorationList.h"
#include "Engine/Objects/Decoration.h"
#include "Engine/Graphics/Outdoor.h"
#include "Engine/Graphics/Indoor.h"
#include "Engine/Graphics/Renderer/Renderer.h"
#include "Engine/Graphics/Sprites.h"
#include "Engine/Graphics/Viewport.h"
#include "Engine/Graphics/Vis.h"
#include "Engine/Graphics/Image.h"
#include "Engine/Localization.h"
#include "Engine/MapInfo.h"
#include "Engine/Objects/Actor.h"
#include "Engine/Objects/Chest.h"
#include "Engine/Objects/ObjectList.h"
#include "Engine/Objects/SpriteObject.h"
#include "Engine/Objects/NPC.h"
#include "Engine/OurMath.h"
#include "Engine/Party.h"
#include "Engine/Spells/Spells.h"
#include "Engine/Tables/IconFrameTable.h"
#include "Engine/Tables/PortraitFrameTable.h"
#include "Engine/Time/Timer.h"
#include "Engine/TurnEngine/TurnEngine.h"
#include "GUI/GUIButton.h"
#include "GUI/GUIWindow.h"
#include "GUI/GUIMessageQueue.h"
#include "GUI/UI/Books/LloydsBook.h"
#include "GUI/UI/Books/TownPortalBook.h"
#include "GUI/UI/UICharacter.h"
#include "GUI/UI/UIHouses.h"
#include "GUI/UI/UIStatusBar.h"
#include "GUI/UI/UISpellbook.h"
#include "Io/InputAction.h"
#include "Io/Mouse.h"
#include "Utility/Math/TrigLut.h"
#include "Library/Logger/Logger.h"

Macros

#define RELEASE(img)
 

Functions

void GameUI_LoadPlayerPortraitsAndVoices ()
 
void GameUI_ReloadPlayerPortraits (int player_id, int face_id)
 
static Color GameMenuUI_GetKeyBindingColor (InputAction action)
 
void GameUI_OnPlayerPortraitLeftClick (int uPlayerID)
 
std::string GameUI_GetMinimapHintText ()
 
void GameUI_DrawRightPanelItems ()
 
void GameUI_DrawFoodAndGold ()
 
void GameUI_DrawLifeManaBars ()
 
void GameUI_DrawRightPanel ()
 
void GameUI_DrawRightPanelFrames ()
 
void GameUI_WritePointedObjectStatusString ()
 
void GameUI_DrawCharacterSelectionFrame ()
 
void GameUI_DrawPartySpells ()
 
void GameUI_DrawPortraits ()
 
void GameUI_DrawMinimap (const Recti &rect, int zoom)
 
void GameUI_DrawTorchlightAndWizardEye ()
 
void GameUI_DrawHiredNPCs ()
 
Color UI_GetHealthManaAndOtherQualitiesStringColor (int actual_value, int base_value)
 
Color GetConditionDrawColor (Condition uConditionIdx)
 
std::string GetReputationString (int reputation)
 
void GameUI_handleHintMessage (UIMessageType type, int param)
 

Variables

std::array< int, 4 > pHealthBarPos = {{23, 138, 251, 366}}
 
std::array< int, 4 > pManaBarPos = {{102, 217, 331, 447}}
 
const int pHealthManaBarYPos = 402
 
std::array< unsigned int, 2 > pHiredNPCsIconsOffsetsX = {{489, 559}}
 
std::array< unsigned int, 2 > pHiredNPCsIconsOffsetsY = {{152, 152}}
 
std::array< std::array< int, 2 >, 14 > pPartySpellbuffsUI_XYs
 
std::array< uint8_t, 14 > pPartySpellbuffsUI_smthns
 
std::array< PartyBuff, 14 > spellBuffsAtRightPanel
 
std::array< int, 8 > BtnTurnCoord
 
GraphicsImagegame_ui_statusbar = nullptr
 
GraphicsImagegame_ui_rightframe = nullptr
 
GraphicsImagegame_ui_topframe = nullptr
 
GraphicsImagegame_ui_leftframe = nullptr
 
GraphicsImagegame_ui_bottomframe = nullptr
 
GraphicsImagegame_ui_monster_hp_green = nullptr
 
GraphicsImagegame_ui_monster_hp_yellow = nullptr
 
GraphicsImagegame_ui_monster_hp_red = nullptr
 
GraphicsImagegame_ui_monster_hp_background = nullptr
 
GraphicsImagegame_ui_monster_hp_border_left = nullptr
 
GraphicsImagegame_ui_monster_hp_border_right = nullptr
 
GraphicsImagegame_ui_minimap_frame = nullptr
 
GraphicsImagegame_ui_minimap_compass = nullptr
 
std::array< GraphicsImage *, 8 > game_ui_minimap_dirs
 
GraphicsImagegame_ui_menu_quit = nullptr
 
GraphicsImagegame_ui_menu_resume = nullptr
 
GraphicsImagegame_ui_menu_controls = nullptr
 
GraphicsImagegame_ui_menu_save = nullptr
 
GraphicsImagegame_ui_menu_load = nullptr
 
GraphicsImagegame_ui_menu_new = nullptr
 
GraphicsImagegame_ui_menu_options = nullptr
 
GraphicsImagegame_ui_tome_storyline = nullptr
 
GraphicsImagegame_ui_tome_calendar = nullptr
 
GraphicsImagegame_ui_tome_maps = nullptr
 
GraphicsImagegame_ui_tome_autonotes = nullptr
 
GraphicsImagegame_ui_tome_quests = nullptr
 
GraphicsImagegame_ui_btn_rest = nullptr
 
GraphicsImagegame_ui_btn_cast = nullptr
 
GraphicsImagegame_ui_btn_zoomin = nullptr
 
GraphicsImagegame_ui_btn_zoomout = nullptr
 
GraphicsImagegame_ui_btn_quickref = nullptr
 
GraphicsImagegame_ui_btn_settings = nullptr
 
GraphicsImagegame_ui_dialogue_background = nullptr
 
GraphicsImagegame_ui_menu_options_video_background = nullptr
 
GraphicsImagegame_ui_menu_options_video_bloodsplats = nullptr
 
GraphicsImagegame_ui_menu_options_video_coloredlights = nullptr
 
GraphicsImagegame_ui_menu_options_video_tinting = nullptr
 
std::array< GraphicsImage *, 10 > game_ui_menu_options_video_gamma_positions
 
std::array< GraphicsImage *, 5 > game_ui_options_controls
 
GraphicsImagegame_ui_evtnpc = nullptr
 
std::array< std::array< GraphicsImage *, 56 >, 4 > game_ui_player_faces
 
GraphicsImagegame_ui_player_face_eradicated = nullptr
 
GraphicsImagegame_ui_player_face_dead = nullptr
 
GraphicsImagegame_ui_player_selection_frame = nullptr
 
GraphicsImagegame_ui_player_alert_yellow = nullptr
 
GraphicsImagegame_ui_player_alert_red = nullptr
 
GraphicsImagegame_ui_player_alert_green = nullptr
 
GraphicsImagegame_ui_bar_red = nullptr
 
GraphicsImagegame_ui_bar_yellow = nullptr
 
GraphicsImagegame_ui_bar_green = nullptr
 
GraphicsImagegame_ui_bar_blue = nullptr
 
GraphicsImagegame_ui_playerbuff_pain_reflection = nullptr
 
GraphicsImagegame_ui_playerbuff_hammerhands = nullptr
 
GraphicsImagegame_ui_playerbuff_preservation = nullptr
 
GraphicsImagegame_ui_playerbuff_bless = nullptr
 
int game_ui_wizardEye = -1
 
int game_ui_torchLight = -1
 
bool bFlashHistoryBook
 
bool bFlashAutonotesBook
 
bool bFlashQuestBook
 
static bool bookFlashState = false
 
static Time bookFlashTimer
 
InputAction currently_selected_action_for_binding
 
std::map< InputAction, bool > key_map_conflicted
 
std::map< InputAction, PlatformKeycurr_key_map
 
OptionsMenuSkin options_menu_skin
 

Macro Definition Documentation

◆ RELEASE

#define RELEASE (   img)
Value:
{ \
if (img) { \
img->Release(); \
img = nullptr; \
} \
}

Function Documentation

◆ GameMenuUI_GetKeyBindingColor()

static Color GameMenuUI_GetKeyBindingColor ( InputAction  action)
static

◆ GameUI_DrawCharacterSelectionFrame()

void GameUI_DrawCharacterSelectionFrame ( )

◆ GameUI_DrawFoodAndGold()

void GameUI_DrawFoodAndGold ( )

◆ GameUI_DrawHiredNPCs()

void GameUI_DrawHiredNPCs ( )

◆ GameUI_DrawLifeManaBars()

void GameUI_DrawLifeManaBars ( )

◆ GameUI_DrawMinimap()

void GameUI_DrawMinimap ( const Recti rect,
int  zoom 
)
Parameters
rectScreen rect to draw the minimap at.
zoomThe number of screen pixels a location map should take. Default outdoor zoom level is 512, so that means that an outdoor location map would take 512x512 pixels on screen if not cropped. For indoor locations, this is the number of screen pixels an indoor location the size of a regular outdoor location would take. Note that outdoor location size is 2^16x2^16 in in-game coordinates.

◆ GameUI_DrawPartySpells()

void GameUI_DrawPartySpells ( )

◆ GameUI_DrawPortraits()

void GameUI_DrawPortraits ( )

◆ GameUI_DrawRightPanel()

void GameUI_DrawRightPanel ( )

◆ GameUI_DrawRightPanelFrames()

void GameUI_DrawRightPanelFrames ( )

◆ GameUI_DrawRightPanelItems()

void GameUI_DrawRightPanelItems ( )

◆ GameUI_DrawTorchlightAndWizardEye()

void GameUI_DrawTorchlightAndWizardEye ( )

◆ GameUI_GetMinimapHintText()

std::string GameUI_GetMinimapHintText ( )

◆ GameUI_handleHintMessage()

void GameUI_handleHintMessage ( UIMessageType  type,
int  param 
)

◆ GameUI_LoadPlayerPortraitsAndVoices()

void GameUI_LoadPlayerPortraitsAndVoices ( )

◆ GameUI_OnPlayerPortraitLeftClick()

void GameUI_OnPlayerPortraitLeftClick ( int  uPlayerID)

◆ GameUI_ReloadPlayerPortraits()

void GameUI_ReloadPlayerPortraits ( int  player_id,
int  face_id 
)

◆ GameUI_WritePointedObjectStatusString()

void GameUI_WritePointedObjectStatusString ( )

◆ GetConditionDrawColor()

Color GetConditionDrawColor ( Condition  uConditionIdx)

◆ GetReputationString()

std::string GetReputationString ( int  reputation)

◆ UI_GetHealthManaAndOtherQualitiesStringColor()

Color UI_GetHealthManaAndOtherQualitiesStringColor ( int  actual_value,
int  base_value 
)

Variable Documentation

◆ bFlashAutonotesBook

bool bFlashAutonotesBook

◆ bFlashHistoryBook

bool bFlashHistoryBook

◆ bFlashQuestBook

bool bFlashQuestBook

◆ bookFlashState

bool bookFlashState = false
static

◆ bookFlashTimer

Time bookFlashTimer
static

◆ BtnTurnCoord

std::array<int, 8> BtnTurnCoord
Initial value:
= {
{0xA4, 0x5D, 0x16, 0xB, 0x5, 0xD, 0x7, 0x3B}}

◆ curr_key_map

std::map<InputAction, PlatformKey> curr_key_map
extern

◆ currently_selected_action_for_binding

InputAction currently_selected_action_for_binding
extern

◆ game_ui_bar_blue

GraphicsImage* game_ui_bar_blue = nullptr

◆ game_ui_bar_green

GraphicsImage* game_ui_bar_green = nullptr

◆ game_ui_bar_red

GraphicsImage* game_ui_bar_red = nullptr

◆ game_ui_bar_yellow

GraphicsImage* game_ui_bar_yellow = nullptr

◆ game_ui_bottomframe

GraphicsImage* game_ui_bottomframe = nullptr

◆ game_ui_btn_cast

GraphicsImage* game_ui_btn_cast = nullptr

◆ game_ui_btn_quickref

GraphicsImage* game_ui_btn_quickref = nullptr

◆ game_ui_btn_rest

GraphicsImage* game_ui_btn_rest = nullptr

◆ game_ui_btn_settings

GraphicsImage* game_ui_btn_settings = nullptr

◆ game_ui_btn_zoomin

GraphicsImage* game_ui_btn_zoomin = nullptr

◆ game_ui_btn_zoomout

GraphicsImage* game_ui_btn_zoomout = nullptr

◆ game_ui_dialogue_background

GraphicsImage* game_ui_dialogue_background = nullptr

◆ game_ui_evtnpc

GraphicsImage* game_ui_evtnpc = nullptr

◆ game_ui_leftframe

GraphicsImage* game_ui_leftframe = nullptr

◆ game_ui_menu_controls

GraphicsImage* game_ui_menu_controls = nullptr

◆ game_ui_menu_load

GraphicsImage* game_ui_menu_load = nullptr

◆ game_ui_menu_new

GraphicsImage* game_ui_menu_new = nullptr

◆ game_ui_menu_options

GraphicsImage* game_ui_menu_options = nullptr

◆ game_ui_menu_options_video_background

GraphicsImage* game_ui_menu_options_video_background = nullptr

◆ game_ui_menu_options_video_bloodsplats

GraphicsImage* game_ui_menu_options_video_bloodsplats = nullptr

◆ game_ui_menu_options_video_coloredlights

GraphicsImage* game_ui_menu_options_video_coloredlights = nullptr

◆ game_ui_menu_options_video_gamma_positions

std::array<GraphicsImage *, 10> game_ui_menu_options_video_gamma_positions

◆ game_ui_menu_options_video_tinting

GraphicsImage* game_ui_menu_options_video_tinting = nullptr

◆ game_ui_menu_quit

GraphicsImage* game_ui_menu_quit = nullptr

◆ game_ui_menu_resume

GraphicsImage* game_ui_menu_resume = nullptr

◆ game_ui_menu_save

GraphicsImage* game_ui_menu_save = nullptr

◆ game_ui_minimap_compass

GraphicsImage* game_ui_minimap_compass = nullptr

◆ game_ui_minimap_dirs

std::array<GraphicsImage *, 8> game_ui_minimap_dirs

◆ game_ui_minimap_frame

GraphicsImage* game_ui_minimap_frame = nullptr

◆ game_ui_monster_hp_background

GraphicsImage* game_ui_monster_hp_background = nullptr

◆ game_ui_monster_hp_border_left

GraphicsImage* game_ui_monster_hp_border_left = nullptr

◆ game_ui_monster_hp_border_right

GraphicsImage* game_ui_monster_hp_border_right = nullptr

◆ game_ui_monster_hp_green

GraphicsImage* game_ui_monster_hp_green = nullptr

◆ game_ui_monster_hp_red

GraphicsImage* game_ui_monster_hp_red = nullptr

◆ game_ui_monster_hp_yellow

GraphicsImage* game_ui_monster_hp_yellow = nullptr

◆ game_ui_options_controls

std::array<GraphicsImage *, 5> game_ui_options_controls

◆ game_ui_player_alert_green

GraphicsImage* game_ui_player_alert_green = nullptr

◆ game_ui_player_alert_red

GraphicsImage* game_ui_player_alert_red = nullptr

◆ game_ui_player_alert_yellow

GraphicsImage* game_ui_player_alert_yellow = nullptr

◆ game_ui_player_face_dead

GraphicsImage* game_ui_player_face_dead = nullptr

◆ game_ui_player_face_eradicated

GraphicsImage* game_ui_player_face_eradicated = nullptr

◆ game_ui_player_faces

std::array<std::array<GraphicsImage *, 56>, 4> game_ui_player_faces

◆ game_ui_player_selection_frame

GraphicsImage* game_ui_player_selection_frame = nullptr

◆ game_ui_playerbuff_bless

GraphicsImage* game_ui_playerbuff_bless = nullptr

◆ game_ui_playerbuff_hammerhands

GraphicsImage* game_ui_playerbuff_hammerhands = nullptr

◆ game_ui_playerbuff_pain_reflection

GraphicsImage* game_ui_playerbuff_pain_reflection = nullptr

◆ game_ui_playerbuff_preservation

GraphicsImage* game_ui_playerbuff_preservation = nullptr

◆ game_ui_rightframe

GraphicsImage* game_ui_rightframe = nullptr

◆ game_ui_statusbar

GraphicsImage* game_ui_statusbar = nullptr

◆ game_ui_tome_autonotes

GraphicsImage* game_ui_tome_autonotes = nullptr

◆ game_ui_tome_calendar

GraphicsImage* game_ui_tome_calendar = nullptr

◆ game_ui_tome_maps

GraphicsImage* game_ui_tome_maps = nullptr

◆ game_ui_tome_quests

GraphicsImage* game_ui_tome_quests = nullptr

◆ game_ui_tome_storyline

GraphicsImage* game_ui_tome_storyline = nullptr

◆ game_ui_topframe

GraphicsImage* game_ui_topframe = nullptr

◆ game_ui_torchLight

int game_ui_torchLight = -1

◆ game_ui_wizardEye

int game_ui_wizardEye = -1

◆ key_map_conflicted

std::map<InputAction, bool> key_map_conflicted
extern

◆ options_menu_skin

OptionsMenuSkin options_menu_skin

◆ pHealthBarPos

std::array<int, 4> pHealthBarPos = {{23, 138, 251, 366}}

◆ pHealthManaBarYPos

const int pHealthManaBarYPos = 402
extern

◆ pHiredNPCsIconsOffsetsX

std::array<unsigned int, 2> pHiredNPCsIconsOffsetsX = {{489, 559}}

◆ pHiredNPCsIconsOffsetsY

std::array<unsigned int, 2> pHiredNPCsIconsOffsetsY = {{152, 152}}

◆ pManaBarPos

std::array<int, 4> pManaBarPos = {{102, 217, 331, 447}}

◆ pPartySpellbuffsUI_smthns

std::array<uint8_t, 14> pPartySpellbuffsUI_smthns
Initial value:
= {
{14, 1, 10, 4, 7, 2, 9, 3, 6, 15, 8, 3, 12, 0}}

◆ pPartySpellbuffsUI_XYs

std::array<std::array<int, 2>, 14> pPartySpellbuffsUI_XYs
Initial value:
= {{
{{477, 247}},
{{497, 247}},
{{522, 247}},
{{542, 247}},
{{564, 247}},
{{581, 247}},
{{614, 247}},
{{477, 279}},
{{497, 279}},
{{522, 279}},
{{542, 279}},
{{564, 279}},
{{589, 279}},
{{612, 279}}
}}

◆ spellBuffsAtRightPanel

std::array<PartyBuff, 14> spellBuffsAtRightPanel