Dont render console twice
This commit is contained in:
parent
c3e61b5e6d
commit
949a0821f8
@ -27,11 +27,26 @@ namespace branding
|
|||||||
const auto* const build_num = ui_get_formatted_build_number_hook.invoke<const char*>();
|
const auto* const build_num = ui_get_formatted_build_number_hook.invoke<const char*>();
|
||||||
return utils::string::va("%s (%s)", VERSION, build_num);
|
return utils::string::va("%s (%s)", VERSION, build_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void draw_branding()
|
||||||
|
{
|
||||||
|
const auto font = game::R_RegisterFont("fonts/fira_mono_bold.ttf", 20);
|
||||||
|
if (font)
|
||||||
|
{
|
||||||
|
game::R_AddCmdDrawText("H1-Mod: " VERSION, 0x7FFFFFFF, font, 10.f,
|
||||||
|
5.f + static_cast<float>(font->pixelHeight), 1.f, 1.f, 0.0f, color, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class component final : public component_interface
|
class component final : public component_interface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
void post_start() override
|
||||||
|
{
|
||||||
|
scheduler::loop(draw_branding, scheduler::pipeline::renderer);
|
||||||
|
}
|
||||||
|
|
||||||
void post_unpack() override
|
void post_unpack() override
|
||||||
{
|
{
|
||||||
if (game::environment::is_dedi())
|
if (game::environment::is_dedi())
|
||||||
@ -49,16 +64,6 @@ namespace branding
|
|||||||
|
|
||||||
ui_get_formatted_build_number_hook.create(
|
ui_get_formatted_build_number_hook.create(
|
||||||
SELECT_VALUE(0x0, 0x1DF300_b), ui_get_formatted_build_number_stub);
|
SELECT_VALUE(0x0, 0x1DF300_b), ui_get_formatted_build_number_stub);
|
||||||
|
|
||||||
scheduler::loop([]()
|
|
||||||
{
|
|
||||||
const auto font = game::R_RegisterFont("fonts/fira_mono_bold.ttf", 20);
|
|
||||||
if (font)
|
|
||||||
{
|
|
||||||
game::R_AddCmdDrawText("H1-Mod: " VERSION, 0x7FFFFFFF, font, 10.f,
|
|
||||||
5.f + static_cast<float>(font->pixelHeight), 1.f, 1.f, 0.0f, color, 0);
|
|
||||||
}
|
|
||||||
}, scheduler::pipeline::renderer);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -723,19 +723,17 @@ namespace game_console
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
scheduler::loop(draw_console, scheduler::pipeline::renderer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void post_unpack() override
|
void post_unpack() override
|
||||||
{
|
{
|
||||||
scheduler::loop(draw_console, scheduler::pipeline::renderer);
|
|
||||||
|
|
||||||
if (game::environment::is_dedi())
|
if (game::environment::is_dedi())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scheduler::loop(draw_console, scheduler::pipeline::renderer);
|
||||||
|
|
||||||
// initialize our structs
|
// initialize our structs
|
||||||
con.cursor = 0;
|
con.cursor = 0;
|
||||||
con.visible_line_count = 0;
|
con.visible_line_count = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user