mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(ui): implement CSimpleFontString_SetJustifyH
This commit is contained in:
parent
dccca0b63d
commit
fd6d6244ed
@ -2,6 +2,7 @@
|
||||
#include "ui/CSimpleFont.hpp"
|
||||
#include "ui/CSimpleFontString.hpp"
|
||||
#include "util/Lua.hpp"
|
||||
#include "util/StringTo.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
@ -235,7 +236,16 @@ int32_t CSimpleFontString_GetJustifyH(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t CSimpleFontString_SetJustifyH(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
auto type = CSimpleFontString::GetObjectType();
|
||||
auto string = static_cast<CSimpleFontString*>(FrameScript_GetObjectThis(L, type));
|
||||
|
||||
uint32_t justifyH;
|
||||
if (!lua_isstring(L, 2) || !StringToJustify(lua_tostring(L, 2), justifyH)) {
|
||||
return luaL_error(L, "Usage: %s:SetJustifyH(\"justify\")", string->GetDisplayName());
|
||||
}
|
||||
|
||||
string->SetJustifyH(justifyH);
|
||||
string->m_fontableFlags &= ~FLAG_STYLE_UPDATE;
|
||||
}
|
||||
|
||||
int32_t CSimpleFontString_GetJustifyV(lua_State* L) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user