2015-02-15 13:41:51 +01:00
|
|
|
#include "DrawUI.hpp"
|
|
|
|
#include <ai/PlayerController.hpp>
|
2016-10-19 03:22:33 +02:00
|
|
|
#include <data/WeaponData.hpp>
|
2017-11-01 04:36:52 +01:00
|
|
|
#include <engine/GameData.hpp>
|
2018-06-12 20:05:50 +02:00
|
|
|
#include <engine/GameState.hpp>
|
|
|
|
#include <objects/CharacterObject.hpp>
|
2016-09-09 22:13:20 +02:00
|
|
|
#include <render/GameRenderer.hpp>
|
2016-04-10 19:58:34 +02:00
|
|
|
|
2016-08-16 18:53:35 +02:00
|
|
|
#include <glm/gtc/constants.hpp>
|
2016-04-10 06:53:49 +02:00
|
|
|
#include <iomanip>
|
2018-02-10 16:59:07 +01:00
|
|
|
#include <sstream>
|
2016-04-10 06:53:49 +02:00
|
|
|
|
2018-06-12 20:05:50 +02:00
|
|
|
void drawScriptTimer(GameWorld* world, GameRenderer* render) {
|
2018-10-27 22:35:10 +02:00
|
|
|
HUDParameters& hudParams = HUDParameters::getInstance();
|
|
|
|
HUDParameters::Parameters parameters = hudParams.getHUDParameters();
|
|
|
|
|
2018-06-12 20:05:50 +02:00
|
|
|
if (world->state->scriptTimerVariable) {
|
2018-08-30 02:02:02 +02:00
|
|
|
float scriptTimerTextX = static_cast<float>(
|
2018-10-27 22:35:10 +02:00
|
|
|
render->getRenderer()->getViewport().x - parameters.uiOuterMargin);
|
|
|
|
float scriptTimerTextY = parameters.uiScriptTimerHeight;
|
2018-06-12 20:05:50 +02:00
|
|
|
|
|
|
|
TextRenderer::TextInfo ti;
|
2017-09-07 19:00:16 +02:00
|
|
|
ti.font = FONT_PRICEDOWN;
|
2018-10-27 22:35:10 +02:00
|
|
|
ti.size = parameters.uiTextSize;
|
2018-08-06 00:06:33 +02:00
|
|
|
ti.align = TextRenderer::TextInfo::TextAlignment::Right;
|
2018-06-12 20:05:50 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
int32_t seconds = *world->state->scriptTimerVariable / 1000;
|
|
|
|
std::stringstream ss;
|
|
|
|
ss << std::setw(2) << std::setfill('0') << seconds / 60
|
|
|
|
<< std::setw(0) << ":" << std::setw(2) << seconds % 60;
|
|
|
|
|
2017-09-07 19:00:16 +02:00
|
|
|
ti.text = GameStringUtil::fromString(ss.str(), ti.font);
|
2018-06-12 20:05:50 +02:00
|
|
|
}
|
|
|
|
|
2018-10-27 22:35:10 +02:00
|
|
|
ti.baseColour = hudParams.uiShadowColour;
|
2018-06-12 20:05:50 +02:00
|
|
|
ti.screenPosition =
|
|
|
|
glm::vec2(scriptTimerTextX + 1.f, scriptTimerTextY + 1.f);
|
|
|
|
render->text.renderText(ti);
|
|
|
|
|
2018-10-27 22:35:10 +02:00
|
|
|
ti.baseColour = hudParams.uiScriptTimerColour;
|
2018-06-12 20:05:50 +02:00
|
|
|
ti.screenPosition = glm::vec2(scriptTimerTextX, scriptTimerTextY);
|
|
|
|
render->text.renderText(ti);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
void drawMap(ViewCamera& currentView, PlayerController* player,
|
|
|
|
GameWorld* world, GameRenderer* render) {
|
|
|
|
MapRenderer::MapInfo map;
|
2018-10-27 22:35:10 +02:00
|
|
|
HUDParameters& hudParams = HUDParameters::getInstance();
|
|
|
|
HUDParameters::Parameters parameters = hudParams.getHUDParameters();
|
2015-02-15 13:41:51 +01:00
|
|
|
|
2018-06-12 20:05:50 +02:00
|
|
|
if (world->state->hudFlash != HudFlash::FlashRadar ||
|
|
|
|
std::fmod(world->getGameTime(), 0.5f) >= .25f) {
|
2018-01-21 16:44:34 +01:00
|
|
|
glm::quat camRot = currentView.rotation;
|
2016-04-10 06:53:49 +02:00
|
|
|
|
2018-01-21 16:44:34 +01:00
|
|
|
map.rotation = glm::roll(camRot) - glm::half_pi<float>();
|
2018-10-27 22:35:10 +02:00
|
|
|
map.worldSize = hudParams.uiWorldSizeMin;
|
|
|
|
map.worldSize = hudParams.uiWorldSizeMax;
|
2018-01-21 16:44:34 +01:00
|
|
|
if (player) {
|
|
|
|
map.worldCenter = glm::vec2(player->getCharacter()->getPosition());
|
|
|
|
}
|
2016-04-10 06:53:49 +02:00
|
|
|
|
2018-01-21 16:44:34 +01:00
|
|
|
const glm::ivec2& vp = render->getRenderer()->getViewport();
|
2016-04-10 06:53:49 +02:00
|
|
|
|
2018-01-21 16:44:34 +01:00
|
|
|
glm::vec2 mapTop =
|
2018-10-27 22:35:10 +02:00
|
|
|
glm::vec2(parameters.uiOuterMargin, vp.y - (parameters.uiOuterMargin + parameters.uiMapSize));
|
2018-01-21 16:44:34 +01:00
|
|
|
glm::vec2 mapBottom =
|
2018-10-27 22:35:10 +02:00
|
|
|
glm::vec2(parameters.uiOuterMargin + parameters.uiMapSize, vp.y - parameters.uiOuterMargin);
|
2016-09-01 23:44:35 +02:00
|
|
|
|
2018-01-21 16:44:34 +01:00
|
|
|
map.screenPosition = (mapTop + mapBottom) / 2.f;
|
2018-10-27 22:35:10 +02:00
|
|
|
map.screenSize = parameters.uiMapSize * 0.95f;
|
2016-04-10 06:53:49 +02:00
|
|
|
|
2018-01-21 16:44:34 +01:00
|
|
|
render->map.draw(world, map);
|
|
|
|
}
|
2016-09-09 22:13:20 +02:00
|
|
|
}
|
2016-04-10 19:58:34 +02:00
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
void drawPlayerInfo(PlayerController* player, GameWorld* world,
|
|
|
|
GameRenderer* render) {
|
2018-10-27 22:35:10 +02:00
|
|
|
HUDParameters& hudParams = HUDParameters::getInstance();
|
|
|
|
HUDParameters::Parameters parameters = hudParams.getHUDParameters();
|
|
|
|
|
2018-08-30 02:02:02 +02:00
|
|
|
float infoTextX = static_cast<float>(render->getRenderer()->getViewport().x -
|
2018-10-27 22:35:10 +02:00
|
|
|
(parameters.uiOuterMargin + parameters.uiWeaponSize + parameters.uiInfoMargin));
|
|
|
|
float infoTextY = 0.f + parameters.uiOuterMargin;
|
2018-08-30 02:02:02 +02:00
|
|
|
float iconX = static_cast<float>(render->getRenderer()->getViewport().x -
|
2018-10-27 22:35:10 +02:00
|
|
|
(parameters.uiOuterMargin + parameters.uiWeaponSize));
|
|
|
|
float iconY = parameters.uiOuterMargin;
|
|
|
|
float wantedX = static_cast<float>(render->getRenderer()->getViewport().x - parameters.uiOuterMargin);
|
|
|
|
float wantedY = parameters.uiWantedLevelHeight;
|
2016-09-09 22:13:20 +02:00
|
|
|
|
|
|
|
TextRenderer::TextInfo ti;
|
2017-09-07 19:00:16 +02:00
|
|
|
ti.font = FONT_PRICEDOWN;
|
2018-10-27 22:35:10 +02:00
|
|
|
ti.size = parameters.uiTextSize;
|
2018-08-06 00:06:33 +02:00
|
|
|
ti.align = TextRenderer::TextInfo::TextAlignment::Right;
|
2016-09-09 22:13:20 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
std::stringstream ss;
|
|
|
|
ss << std::setw(2) << std::setfill('0') << world->getHour()
|
|
|
|
<< std::setw(0) << ":" << std::setw(2) << world->getMinute();
|
|
|
|
|
2017-09-07 19:00:16 +02:00
|
|
|
ti.text = GameStringUtil::fromString(ss.str(), ti.font);
|
2016-09-09 22:13:20 +02:00
|
|
|
}
|
2018-06-12 20:05:50 +02:00
|
|
|
|
2018-10-27 22:35:10 +02:00
|
|
|
ti.baseColour = hudParams.uiShadowColour;
|
2016-09-09 22:13:20 +02:00
|
|
|
ti.screenPosition = glm::vec2(infoTextX + 1.f, infoTextY + 1.f);
|
|
|
|
render->text.renderText(ti);
|
|
|
|
|
2018-10-27 22:35:10 +02:00
|
|
|
ti.baseColour = hudParams.uiTimeColour;
|
2016-09-09 22:13:20 +02:00
|
|
|
ti.screenPosition = glm::vec2(infoTextX, infoTextY);
|
2018-06-12 20:05:50 +02:00
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
render->text.renderText(ti);
|
|
|
|
|
2018-10-27 22:35:10 +02:00
|
|
|
infoTextY += parameters.uiTextHeight;
|
2016-09-09 22:13:20 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
std::stringstream ss;
|
|
|
|
ss << std::setw(8) << std::setfill('0')
|
|
|
|
<< world->state->playerInfo.displayedMoney;
|
|
|
|
|
2017-09-07 19:00:16 +02:00
|
|
|
ti.text = GameSymbols::Money + GameStringUtil::fromString(ss.str(), ti.font);
|
2016-09-09 22:13:20 +02:00
|
|
|
}
|
2018-06-12 20:05:50 +02:00
|
|
|
|
2018-10-27 22:35:10 +02:00
|
|
|
ti.baseColour = hudParams.uiShadowColour;
|
2016-09-09 22:13:20 +02:00
|
|
|
ti.screenPosition = glm::vec2(infoTextX + 1.f, infoTextY + 1.f);
|
|
|
|
render->text.renderText(ti);
|
|
|
|
|
2018-10-27 22:35:10 +02:00
|
|
|
ti.baseColour = hudParams.uiMoneyColour;
|
2018-06-12 20:05:50 +02:00
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
ti.screenPosition = glm::vec2(infoTextX, infoTextY);
|
|
|
|
render->text.renderText(ti);
|
|
|
|
|
2018-10-27 22:35:10 +02:00
|
|
|
infoTextY += parameters.uiTextHeight;
|
2016-09-09 22:13:20 +02:00
|
|
|
|
2018-06-12 20:05:50 +02:00
|
|
|
if ((world->state->hudFlash != HudFlash::FlashHealth &&
|
2018-10-27 22:35:10 +02:00
|
|
|
player->getCharacter()->getCurrentState().health > hudParams.uiLowHealth) ||
|
2018-06-12 20:05:50 +02:00
|
|
|
std::fmod(world->getGameTime(), 0.5f) >=
|
|
|
|
.25f) { // UI: Blinking health indicator if health is low
|
2016-09-09 22:13:20 +02:00
|
|
|
std::stringstream ss;
|
|
|
|
ss << std::setw(3) << std::setfill('0')
|
2018-07-27 22:53:35 +02:00
|
|
|
<< static_cast<int>(
|
|
|
|
player->getCharacter()->getCurrentState().health);
|
2017-09-07 19:00:16 +02:00
|
|
|
ti.text = GameSymbols::Heart + GameStringUtil::fromString(ss.str(), ti.font);
|
2018-06-12 20:05:50 +02:00
|
|
|
|
2018-10-27 22:35:10 +02:00
|
|
|
ti.baseColour = hudParams.uiShadowColour;
|
2017-02-15 01:30:28 +01:00
|
|
|
ti.screenPosition = glm::vec2(infoTextX + 1.f, infoTextY + 1.f);
|
2018-06-12 20:05:50 +02:00
|
|
|
|
2017-02-15 01:30:28 +01:00
|
|
|
render->text.renderText(ti);
|
2016-09-09 22:13:20 +02:00
|
|
|
|
2018-10-27 22:35:10 +02:00
|
|
|
ti.baseColour = hudParams.uiHealthColour;
|
2017-02-15 01:30:28 +01:00
|
|
|
ti.screenPosition = glm::vec2(infoTextX, infoTextY);
|
|
|
|
render->text.renderText(ti);
|
|
|
|
}
|
2016-09-09 22:13:20 +02:00
|
|
|
|
|
|
|
if (player->getCharacter()->getCurrentState().armour > 0) {
|
|
|
|
std::stringstream ss;
|
|
|
|
ss << std::setw(3) << std::setfill('0')
|
2018-07-27 22:53:35 +02:00
|
|
|
<< static_cast<int>(
|
|
|
|
player->getCharacter()->getCurrentState().armour);
|
2017-09-07 19:00:16 +02:00
|
|
|
ti.text = GameSymbols::Armour + GameStringUtil::fromString(ss.str(), ti.font);
|
2018-06-12 20:05:50 +02:00
|
|
|
|
2018-10-27 22:35:10 +02:00
|
|
|
ti.baseColour = hudParams.uiShadowColour;
|
2016-09-09 22:13:20 +02:00
|
|
|
ti.screenPosition =
|
2018-10-27 22:35:10 +02:00
|
|
|
glm::vec2(infoTextX + 1.f - parameters.uiArmourOffset, infoTextY + 1.f);
|
2016-09-09 22:13:20 +02:00
|
|
|
render->text.renderText(ti);
|
|
|
|
|
2018-10-27 22:35:10 +02:00
|
|
|
ti.baseColour = hudParams.uiArmourColour;
|
|
|
|
ti.screenPosition = glm::vec2(infoTextX - parameters.uiArmourOffset, infoTextY);
|
2016-09-09 22:13:20 +02:00
|
|
|
render->text.renderText(ti);
|
|
|
|
}
|
|
|
|
|
|
|
|
GameString s;
|
2018-10-27 22:35:10 +02:00
|
|
|
for (size_t i = 0; i < hudParams.uiMaxWantedLevel; ++i) {
|
2016-09-09 22:13:20 +02:00
|
|
|
s += GameSymbols::Star;
|
|
|
|
}
|
|
|
|
ti.text = s;
|
2018-10-27 22:35:10 +02:00
|
|
|
ti.baseColour = hudParams.uiShadowColour;
|
2016-09-09 22:13:20 +02:00
|
|
|
ti.screenPosition = glm::vec2(wantedX + 1.f, wantedY + 1.f);
|
|
|
|
render->text.renderText(ti);
|
|
|
|
|
|
|
|
#if 0 // Useful for debugging
|
2016-04-10 19:58:34 +02:00
|
|
|
ti.text = "ABCDEFGHIJKLMANOQRTSWXYZ\nM0123456789";
|
|
|
|
ti.size = 30;
|
|
|
|
ti.align = TextRenderer::TextInfo::Left;
|
|
|
|
ti.baseColour = glm::vec3(0.f, 0.f, 0.f);
|
|
|
|
ti.screenPosition = glm::vec2(101.f, 202.f);
|
|
|
|
render->text.renderText(ti);
|
|
|
|
ti.baseColour = glm::vec3(1.f, 1.f, 1.f);
|
|
|
|
ti.screenPosition = glm::vec2(100.f, 200.f);
|
|
|
|
render->text.renderText(ti);
|
|
|
|
#endif
|
|
|
|
|
2016-10-19 03:22:33 +02:00
|
|
|
auto item = player->getCharacter()->getActiveItem();
|
|
|
|
auto weapon = world->data->weaponData[item];
|
2016-09-09 22:13:20 +02:00
|
|
|
std::string itemTextureName = "fist";
|
2016-10-19 03:22:33 +02:00
|
|
|
if (weapon && weapon->modelID > 0) {
|
|
|
|
auto model =
|
|
|
|
world->data->findModelInfo<SimpleModelInfo>(weapon->modelID);
|
|
|
|
if (model != nullptr) {
|
|
|
|
itemTextureName = model->name;
|
2016-09-09 22:13:20 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// Urgh
|
|
|
|
if (itemTextureName == "colt45") {
|
|
|
|
itemTextureName = "pistol";
|
2017-02-18 00:01:38 +01:00
|
|
|
} else if (itemTextureName == "bomb") {
|
|
|
|
itemTextureName = "detonator";
|
2016-09-09 22:13:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
TextureData::Handle itemTexture =
|
2016-12-03 22:18:28 +01:00
|
|
|
render->getData()->findSlotTexture("hud", itemTextureName);
|
2016-09-09 22:13:20 +02:00
|
|
|
RW_CHECK(itemTexture != nullptr, "Item has 0 texture");
|
|
|
|
if (itemTexture != nullptr) {
|
|
|
|
RW_CHECK(itemTexture->getName() != 0, "Item has 0 texture");
|
|
|
|
render->drawTexture(
|
|
|
|
itemTexture.get(),
|
2018-10-27 22:35:10 +02:00
|
|
|
glm::vec4(iconX, iconY, parameters.uiWeaponSize, parameters.uiWeaponSize));
|
2016-09-09 22:13:20 +02:00
|
|
|
}
|
|
|
|
|
2016-10-19 03:22:33 +02:00
|
|
|
if (weapon->fireType != WeaponData::MELEE) {
|
|
|
|
const CharacterState& cs = player->getCharacter()->getCurrentState();
|
|
|
|
const CharacterWeaponSlot& slotInfo = cs.weapons[cs.currentWeapon];
|
2017-02-18 00:57:56 +01:00
|
|
|
|
2017-02-19 06:13:31 +01:00
|
|
|
// In weapon.dat clip size of 0 or 1000+ indicates no reload
|
|
|
|
// Clip size of 1 is being visually omitted as well
|
|
|
|
bool noClip = weapon->clipSize < 2 || weapon->clipSize > 999;
|
|
|
|
|
|
|
|
uint32_t displayBulletsTotal = slotInfo.bulletsTotal;
|
2017-02-18 00:57:56 +01:00
|
|
|
|
|
|
|
if (noClip) {
|
2017-02-19 06:13:31 +01:00
|
|
|
// The clip is actually there, but it holds just one shot/charge
|
|
|
|
displayBulletsTotal += slotInfo.bulletsClip;
|
|
|
|
|
2018-06-12 20:05:50 +02:00
|
|
|
ti.text =
|
2017-09-07 19:00:16 +02:00
|
|
|
GameStringUtil::fromString(std::to_string(displayBulletsTotal), ti.font);
|
2017-02-18 00:57:56 +01:00
|
|
|
} else {
|
2017-02-19 06:13:31 +01:00
|
|
|
// Limit the maximal displayed length for the total bullet count
|
|
|
|
if (slotInfo.bulletsTotal > 9999) {
|
|
|
|
displayBulletsTotal = 9999;
|
|
|
|
}
|
|
|
|
|
2017-02-18 00:57:56 +01:00
|
|
|
ti.text = GameStringUtil::fromString(
|
2017-02-19 06:13:31 +01:00
|
|
|
std::to_string(displayBulletsTotal) + "-" +
|
2017-09-07 19:00:16 +02:00
|
|
|
std::to_string(slotInfo.bulletsClip), ti.font);
|
2017-02-18 00:57:56 +01:00
|
|
|
}
|
2016-10-19 03:22:33 +02:00
|
|
|
|
2018-10-27 22:35:10 +02:00
|
|
|
ti.baseColour = hudParams.uiShadowColour;
|
2017-09-07 19:00:16 +02:00
|
|
|
ti.font = FONT_ARIAL;
|
2018-10-27 22:35:10 +02:00
|
|
|
ti.size = parameters.uiAmmoSize;
|
2018-08-06 00:06:33 +02:00
|
|
|
ti.align = TextRenderer::TextInfo::TextAlignment::Center;
|
2018-10-27 22:35:10 +02:00
|
|
|
ti.screenPosition = glm::vec2(iconX + parameters.uiWeaponSize / 2.f,
|
|
|
|
iconY + parameters.uiWeaponSize - parameters.uiAmmoHeight);
|
2016-10-19 03:22:33 +02:00
|
|
|
render->text.renderText(ti);
|
2016-09-09 22:13:20 +02:00
|
|
|
}
|
2016-04-10 06:53:49 +02:00
|
|
|
}
|
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
void drawHUD(ViewCamera& currentView, PlayerController* player,
|
|
|
|
GameWorld* world, GameRenderer* render) {
|
|
|
|
if (player && player->getCharacter()) {
|
|
|
|
drawMap(currentView, player, world, render);
|
|
|
|
drawPlayerInfo(player, world, render);
|
2018-06-12 20:05:50 +02:00
|
|
|
drawScriptTimer(world, render);
|
2016-09-09 22:13:20 +02:00
|
|
|
}
|
2015-02-15 13:41:51 +01:00
|
|
|
}
|
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
void drawOnScreenText(GameWorld* world, GameRenderer* renderer) {
|
2018-10-27 22:35:10 +02:00
|
|
|
HUDParameters::Parameters parameters = HUDParameters::getInstance().getHUDParameters();
|
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
const auto vp = glm::vec2(renderer->getRenderer()->getViewport());
|
|
|
|
|
|
|
|
TextRenderer::TextInfo ti;
|
2017-09-07 19:00:16 +02:00
|
|
|
ti.font = FONT_ARIAL;
|
2016-09-09 22:13:20 +02:00
|
|
|
ti.screenPosition = glm::vec2(10.f, 10.f);
|
|
|
|
ti.size = 20.f;
|
|
|
|
|
|
|
|
auto& alltext = world->state->text.getAllText();
|
|
|
|
|
|
|
|
for (auto& l : alltext) {
|
|
|
|
for (auto& t : l) {
|
2018-10-27 22:35:10 +02:00
|
|
|
ti.size = static_cast<float>(t.size * parameters.hudScale);
|
2016-09-09 22:13:20 +02:00
|
|
|
ti.font = t.font;
|
|
|
|
ti.text = t.text;
|
|
|
|
ti.wrapX = t.wrapX;
|
|
|
|
ti.screenPosition = (t.position / glm::vec2(640.f, 480.f)) * vp;
|
|
|
|
switch (t.alignment) {
|
|
|
|
case 0:
|
2018-08-06 00:06:33 +02:00
|
|
|
ti.align = TextRenderer::TextInfo::TextAlignment::Left;
|
2016-09-09 22:13:20 +02:00
|
|
|
break;
|
|
|
|
case 1:
|
2018-08-06 00:06:33 +02:00
|
|
|
ti.align = TextRenderer::TextInfo::TextAlignment::Center;
|
2016-09-09 22:13:20 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2018-08-06 00:06:33 +02:00
|
|
|
ti.align = TextRenderer::TextInfo::TextAlignment::Right;
|
2016-09-09 22:13:20 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check for the background type
|
|
|
|
if (t.colourBG.a == 0) {
|
2018-07-27 22:53:35 +02:00
|
|
|
glm::vec2 shadowPosition(static_cast<int8_t>(t.colourBG.x),
|
|
|
|
static_cast<int8_t>(t.colourBG.y));
|
2016-09-09 22:13:20 +02:00
|
|
|
|
|
|
|
ti.baseColour = glm::vec3(0.f);
|
|
|
|
ti.screenPosition += shadowPosition;
|
|
|
|
ti.backgroundColour = {0, 0, 0, 0};
|
|
|
|
|
|
|
|
renderer->text.renderText(ti, true);
|
|
|
|
|
|
|
|
ti.screenPosition -= shadowPosition;
|
|
|
|
} else if (t.colourBG.a > 0) {
|
|
|
|
ti.backgroundColour = t.colourBG;
|
|
|
|
}
|
|
|
|
|
|
|
|
ti.baseColour = t.colourFG;
|
|
|
|
renderer->text.renderText(ti);
|
|
|
|
}
|
|
|
|
}
|
2015-02-15 13:41:51 +01:00
|
|
|
}
|
2018-10-26 22:04:09 +02:00
|
|
|
|
2018-10-27 22:35:10 +02:00
|
|
|
void HUDParameters::scaleHUD(float scale) {
|
|
|
|
hudParameters.hudScale = scale;
|
|
|
|
hudParameters.uiTextSize = uiTextSize * scale;
|
|
|
|
hudParameters.uiTextHeight = uiTextHeight * scale;
|
|
|
|
hudParameters.uiElementMargin = uiElementMargin * scale;
|
|
|
|
hudParameters.uiOuterMargin = uiOuterMargin * scale;
|
|
|
|
hudParameters.uiInfoMargin = uiInfoMargin * scale;
|
|
|
|
hudParameters.uiWeaponSize = uiWeaponSize * scale;
|
|
|
|
hudParameters.uiAmmoSize = uiAmmoSize * scale;
|
|
|
|
hudParameters.uiAmmoHeight = uiAmmoHeight * scale;
|
|
|
|
hudParameters.uiWantedLevelHeight = uiWantedLevelHeight * scale;
|
|
|
|
hudParameters.uiScriptTimerHeight = uiScriptTimerHeight * scale;
|
|
|
|
hudParameters.uiArmourOffset = uiArmourOffset * scale;
|
|
|
|
hudParameters.uiMapSize = uiMapSize * scale;
|
|
|
|
}
|
|
|
|
|
|
|
|
HUDParameters::Parameters HUDParameters::getHUDParameters() {
|
|
|
|
return hudParameters;
|
2018-10-26 22:04:09 +02:00
|
|
|
}
|