2021-09-06 18:40:37 -04:00
|
|
|
#include <std_include.hpp>
|
2021-08-29 14:48:38 -04:00
|
|
|
#include "loader/component_loader.hpp"
|
|
|
|
#include "localized_strings.hpp"
|
|
|
|
#include "scheduler.hpp"
|
|
|
|
#include "command.hpp"
|
|
|
|
#include "game/game.hpp"
|
|
|
|
|
2022-02-02 17:58:46 -05:00
|
|
|
#include "game/ui_scripting/execution.hpp"
|
|
|
|
|
2021-08-29 14:48:38 -04:00
|
|
|
#include <utils/hook.hpp>
|
|
|
|
#include <utils/string.hpp>
|
2022-02-02 17:58:46 -05:00
|
|
|
#include <version.h>
|
2021-08-29 14:48:38 -04:00
|
|
|
|
|
|
|
namespace branding
|
|
|
|
{
|
2022-02-02 17:58:46 -05:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
float color[4] = {0.9f, 0.9f, 0.5f, 1.f};
|
|
|
|
|
|
|
|
int get_build_number_stub(game::hks::lua_State* s)
|
|
|
|
{
|
|
|
|
ui_scripting::push_value(VERSION);
|
|
|
|
return 1;
|
|
|
|
}
|
2021-12-28 20:29:22 -05:00
|
|
|
|
2022-02-06 15:36:49 -05:00
|
|
|
void draw()
|
|
|
|
{
|
|
|
|
const auto font = game::R_RegisterFont("fonts/defaultBold.otf", 22);
|
|
|
|
game::R_AddCmdDrawText("h2-mod", 0x7FFFFFFF, font, 15.f,
|
|
|
|
15.f + static_cast<float>(font->pixelHeight),
|
|
|
|
1.f, 1.f, 0.f, color, 0);
|
|
|
|
}
|
2021-09-19 12:20:15 -04:00
|
|
|
}
|
|
|
|
|
2021-08-29 14:48:38 -04:00
|
|
|
class component final : public component_interface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void post_unpack() override
|
|
|
|
{
|
2022-02-06 15:36:49 -05:00
|
|
|
scheduler::loop(draw, scheduler::pipeline::renderer);
|
|
|
|
|
2021-09-21 18:57:41 -04:00
|
|
|
localized_strings::override("MENU_SP_CAMPAIGN", "H2-MOD");
|
2022-02-02 17:58:46 -05:00
|
|
|
|
2022-03-18 17:02:44 -04:00
|
|
|
utils::hook::jump(0x14033D550, get_build_number_stub, true);
|
2021-08-29 14:48:38 -04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
REGISTER_COMPONENT(branding::component)
|