Make console, ... stay on top of ui elements
This commit is contained in:
parent
9b93c1ccd2
commit
fb90cc22dc
@ -10,6 +10,18 @@
|
||||
|
||||
namespace branding
|
||||
{
|
||||
namespace
|
||||
{
|
||||
void draw_brand()
|
||||
{
|
||||
const auto font = game::R_RegisterFont("fonts/defaultBold.otf", 22);
|
||||
float color[4] = {0.9f, 0.9f, 0.5f, 1.f};
|
||||
|
||||
game::R_AddCmdDrawText("h2-mod", 0x7FFFFFFF, font, 15.f, 15.f + static_cast<float>(font->pixelHeight),
|
||||
1.f, 1.f, 0.0f, color, 0);
|
||||
}
|
||||
}
|
||||
|
||||
class component final : public component_interface
|
||||
{
|
||||
public:
|
||||
@ -17,21 +29,12 @@ namespace branding
|
||||
{
|
||||
localized_strings::override("MENU_SP_CAMPAIGN", "H2-Mod");
|
||||
|
||||
scheduler::loop([]()
|
||||
scheduler::once([]()
|
||||
{
|
||||
const auto x = 15.f;
|
||||
const auto y = 15.f;
|
||||
const auto scale = 1.0f;
|
||||
float color[4] = {0.9f, 0.9f, 0.5f, 1.f};
|
||||
const auto* text = "h2-mod";
|
||||
|
||||
auto* font = game::R_RegisterFont("fonts/defaultBold.otf", 22);
|
||||
|
||||
if (!font) return;
|
||||
|
||||
game::R_AddCmdDrawText(text, 0x7FFFFFFF, font, static_cast<float>(x),
|
||||
y + static_cast<float>(font->pixelHeight) * scale,
|
||||
scale, scale, 0.0f, color, 0);
|
||||
scheduler::loop([]()
|
||||
{
|
||||
draw_brand();
|
||||
}, scheduler::pipeline::renderer);
|
||||
}, scheduler::pipeline::renderer);
|
||||
}
|
||||
};
|
||||
|
@ -262,6 +262,11 @@ namespace fps
|
||||
public:
|
||||
void post_unpack() override
|
||||
{
|
||||
scheduler::once([]()
|
||||
{
|
||||
scheduler::loop(draw, scheduler::pipeline::renderer);
|
||||
}, scheduler::pipeline::renderer);
|
||||
|
||||
cg_drawSpeed = dvars::register_int("cg_drawSpeed", 0, 0, 2, game::DVAR_FLAG_SAVED);
|
||||
cg_drawFps = dvars::register_int("cg_drawFPS", 0, 0, 4, game::DVAR_FLAG_SAVED, false);
|
||||
|
||||
@ -277,7 +282,6 @@ namespace fps
|
||||
cg_speedGraphWidth = dvars::register_int("cg_speedGraphWidth", 200, 0, 1000, game::DVAR_FLAG_SAVED);
|
||||
cg_speedGraphHeight = dvars::register_int("cg_speedGraphHeight", 80, 0, 1000, game::DVAR_FLAG_SAVED);
|
||||
|
||||
scheduler::loop(draw, scheduler::pipeline::renderer);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -683,7 +683,11 @@ namespace game_console
|
||||
public:
|
||||
void post_unpack() override
|
||||
{
|
||||
scheduler::loop(draw_console, scheduler::pipeline::renderer);
|
||||
scheduler::once([]()
|
||||
{
|
||||
scheduler::loop(draw_console, scheduler::pipeline::renderer);
|
||||
}, scheduler::pipeline::renderer);
|
||||
|
||||
|
||||
con.cursor = 0;
|
||||
con.visible_line_count = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user