2022-05-20 21:59:24 +03:00
|
|
|
#include <std_include.hpp>
|
|
|
|
#include "loader/component_loader.hpp"
|
|
|
|
|
|
|
|
#include "localized_strings.hpp"
|
|
|
|
#include "scheduler.hpp"
|
|
|
|
#include "version.hpp"
|
|
|
|
|
|
|
|
#include "game/game.hpp"
|
|
|
|
|
2022-05-25 14:48:49 +03:00
|
|
|
// Fonts used in game:
|
2022-05-24 04:34:44 +03:00
|
|
|
// fonts/blender_pro_bold.ttf, fonts/blender_pro_book.ttf, fonts/blender_pro_heavy.ttf, fonts/blender_pro_medium.ttf
|
|
|
|
// fonts/changelingneo-regular.ttf, fonts/dev.ttf, fonts/fira_mono_bold.ttf, fonts/fira_mono_regular.ttf, fonts/iw6_digital.ttf
|
2022-05-20 21:59:24 +03:00
|
|
|
|
|
|
|
namespace branding
|
|
|
|
{
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
float color[4] = { 0.666f, 0.666f, 0.666f, 0.666f };
|
|
|
|
|
2022-05-25 14:48:49 +03:00
|
|
|
game::dvar_t* branding;
|
2022-05-20 21:59:24 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
class component final : public component_interface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void post_unpack() override
|
|
|
|
{
|
2022-05-25 14:48:49 +03:00
|
|
|
localized_strings::override("LUA_MENU_LEGAL_COPYRIGHT", "IW7-MOD");
|
|
|
|
|
2022-05-20 21:59:24 +03:00
|
|
|
localized_strings::override("LUA_MENU_MULTIPLAYER_CAPS", "IW7-MOD: MULTIPLAYER");
|
|
|
|
localized_strings::override("LUA_MENU_ALIENS_CAPS", "IW7-MOD: ZOMBIES");
|
|
|
|
|
2022-05-25 14:49:34 +03:00
|
|
|
branding = game::Dvar_RegisterBool("branding", true, game::DvarFlags::DVAR_FLAG_SAVED, "Show branding in the top left corner");
|
2022-05-20 21:59:24 +03:00
|
|
|
|
|
|
|
scheduler::loop([]()
|
|
|
|
{
|
2022-05-25 14:48:49 +03:00
|
|
|
if (branding && branding->current.enabled)
|
2022-05-20 21:59:24 +03:00
|
|
|
{
|
2022-05-25 14:48:49 +03:00
|
|
|
const auto font = game::R_RegisterFont("fonts/fira_mono_bold.ttf", 20);
|
|
|
|
if (font)
|
|
|
|
{
|
|
|
|
game::R_AddCmdDrawText("IW7-Mod: " VERSION, 0x7FFFFFFF, font, 10.f,
|
|
|
|
5.f + static_cast<float>(font->pixelHeight), 1.f, 1.f, 0.0f, color, 0);
|
|
|
|
}
|
2022-05-20 21:59:24 +03:00
|
|
|
}
|
|
|
|
}, scheduler::pipeline::renderer);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
REGISTER_COMPONENT(branding::component)
|