mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 04:39:18 +02:00
basic text localization system
This commit is contained in:
11
uilayer.cpp
11
uilayer.cpp
@@ -27,8 +27,8 @@ GLint ui_layer::m_textureunit { GL_TEXTURE0 };
|
||||
bool ui_layer::m_cursorvisible { true };
|
||||
|
||||
|
||||
ui_panel::ui_panel( std::string const Name, bool const Isopen )
|
||||
: name( Name ), is_open( Isopen )
|
||||
ui_panel::ui_panel( std::string const Identifier, bool const Isopen )
|
||||
: identifier( Identifier ), is_open( Isopen )
|
||||
{}
|
||||
|
||||
void
|
||||
@@ -48,7 +48,12 @@ ui_panel::render() {
|
||||
if( size_min.x > 0 ) {
|
||||
ImGui::SetNextWindowSizeConstraints( ImVec2( size_min.x, size_min.y ), ImVec2( size_max.x, size_max.y ) );
|
||||
}
|
||||
if( true == ImGui::Begin( name.c_str(), &is_open, flags ) ) {
|
||||
auto const panelname { (
|
||||
name.empty() ?
|
||||
identifier :
|
||||
name )
|
||||
+ "###" + identifier };
|
||||
if( true == ImGui::Begin( panelname.c_str(), &is_open, flags ) ) {
|
||||
for( auto const &line : text_lines ) {
|
||||
ImGui::TextColored( ImVec4( line.color.r, line.color.g, line.color.b, line.color.a ), line.data.c_str() );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user