From 581c3f48829983cedea3f072a3194ce2be9270b3 Mon Sep 17 00:00:00 2001 From: uramer Date: Sun, 6 Feb 2022 20:22:38 +0000 Subject: [PATCH] Update and document Lua Text and TextEdit widget types, fix some issues with Lua UI --- apps/openmw/mwlua/uibindings.cpp | 7 + components/CMakeLists.txt | 2 +- components/lua_ui/alignment.cpp | 18 +++ components/lua_ui/alignment.hpp | 18 +++ components/lua_ui/container.hpp | 4 +- components/lua_ui/element.cpp | 2 + components/lua_ui/image.cpp | 4 +- components/lua_ui/image.hpp | 2 +- components/lua_ui/properties.hpp | 11 ++ components/lua_ui/text.cpp | 28 +++- components/lua_ui/text.hpp | 9 +- components/lua_ui/textedit.cpp | 34 ++++- components/lua_ui/textedit.hpp | 8 +- components/lua_ui/widget.cpp | 37 +++-- components/lua_ui/widget.hpp | 7 +- components/lua_ui/window.cpp | 7 +- components/lua_ui/window.hpp | 4 +- .../lua-scripting/user_interface.rst | 137 ++++++------------ .../reference/lua-scripting/widgets/text.rst | 44 ++++++ .../lua-scripting/widgets/textedit.rst | 51 +++++++ files/lua_api/openmw/ui.lua | 26 +++- files/mygui/CMakeLists.txt | 1 + files/mygui/core.skin | 4 - files/mygui/core.xml | 1 + files/mygui/openmw_lua.xml | 15 ++ 25 files changed, 338 insertions(+), 143 deletions(-) create mode 100644 components/lua_ui/alignment.cpp create mode 100644 components/lua_ui/alignment.hpp create mode 100644 docs/source/reference/lua-scripting/widgets/text.rst create mode 100644 docs/source/reference/lua-scripting/widgets/textedit.rst create mode 100644 files/mygui/openmw_lua.xml diff --git a/apps/openmw/mwlua/uibindings.cpp b/apps/openmw/mwlua/uibindings.cpp index 6f1d34072a..4333ae5072 100644 --- a/apps/openmw/mwlua/uibindings.cpp +++ b/apps/openmw/mwlua/uibindings.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "context.hpp" #include "actions.hpp" @@ -239,6 +240,12 @@ namespace MWLua typeTable.set(it.second, it.first); api["TYPE"] = LuaUtil::makeReadOnly(typeTable); + api["ALIGNMENT"] = LuaUtil::makeReadOnly(context.mLua->tableFromPairs({ + { "Start", LuaUi::Alignment::Start }, + { "Center", LuaUi::Alignment::Center }, + { "End", LuaUi::Alignment::End } + })); + api["registerSettingsPage"] = &LuaUi::registerSettingsPage; return LuaUtil::makeReadOnly(api); diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 9a1ffc847c..b6d40931be 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -166,7 +166,7 @@ add_component_dir (queries add_component_dir (lua_ui registerscriptsettings scriptsettings - properties widget element util layers content + properties widget element util layers content alignment adapter text textedit window image container ) diff --git a/components/lua_ui/alignment.cpp b/components/lua_ui/alignment.cpp new file mode 100644 index 0000000000..dfd09b752d --- /dev/null +++ b/components/lua_ui/alignment.cpp @@ -0,0 +1,18 @@ +#include "alignment.hpp" + +namespace LuaUi +{ + MyGUI::Align alignmentToMyGui(Alignment horizontal, Alignment vertical) + { + MyGUI::Align align(MyGUI::Align::Center); + if (horizontal == Alignment::Start) + align |= MyGUI::Align::Left; + if (horizontal == Alignment::End) + align |= MyGUI::Align::Right; + if (horizontal == Alignment::Start) + align |= MyGUI::Align::Top; + if (horizontal == Alignment::End) + align |= MyGUI::Align::Bottom; + return align; + } +} diff --git a/components/lua_ui/alignment.hpp b/components/lua_ui/alignment.hpp new file mode 100644 index 0000000000..8503ffba03 --- /dev/null +++ b/components/lua_ui/alignment.hpp @@ -0,0 +1,18 @@ +#ifndef OPENMW_LUAUI_ALIGNMENT +#define OPENMW_LUAUI_ALIGNMENT + +#include + +namespace LuaUi +{ + enum class Alignment + { + Start = 0, + Center = 1, + End = 2 + }; + + MyGUI::Align alignmentToMyGui(Alignment horizontal, Alignment vertical); +} + +#endif // !OPENMW_LUAUI_PROPERTIES diff --git a/components/lua_ui/container.hpp b/components/lua_ui/container.hpp index a005b7ae53..664fb08ea2 100644 --- a/components/lua_ui/container.hpp +++ b/components/lua_ui/container.hpp @@ -10,8 +10,8 @@ namespace LuaUi MYGUI_RTTI_DERIVED(LuaContainer) protected: - virtual void updateChildren() override; - virtual MyGUI::IntSize childScalingSize() override; + void updateChildren() override; + MyGUI::IntSize childScalingSize() override; private: void updateSizeToFit(); diff --git a/components/lua_ui/element.cpp b/components/lua_ui/element.cpp index 59a3b13d55..d2074ecfc2 100644 --- a/components/lua_ui/element.cpp +++ b/components/lua_ui/element.cpp @@ -130,6 +130,8 @@ namespace LuaUi void updateWidget(WidgetExtension* ext, const sol::table& layout) { + ext->resetSlot(); // otherwise if template gets changed, all non-template children will get destroyed + ext->setLayout(layout); ext->setExternal(layout.get(LayoutKeys::external)); setTemplate(ext, layout.get(LayoutKeys::templateLayout)); diff --git a/components/lua_ui/image.cpp b/components/lua_ui/image.cpp index c8fdafbb66..c72bac21e9 100644 --- a/components/lua_ui/image.cpp +++ b/components/lua_ui/image.cpp @@ -19,9 +19,9 @@ namespace LuaUi // mCoord could be zero, prevent division by 0 // use arbitrary large numbers to prevent performance issues - if (mTileSize.width == 0) + if (mTileSize.width <= 0) mTileSize.width = 1e7; - if (mTileSize.height == 0) + if (mTileSize.height <= 0) mTileSize.height = 1e7; } diff --git a/components/lua_ui/image.hpp b/components/lua_ui/image.hpp index 4073d1bd2a..e841e55fdb 100644 --- a/components/lua_ui/image.hpp +++ b/components/lua_ui/image.hpp @@ -29,7 +29,7 @@ namespace LuaUi LuaImage(); protected: - virtual void updateProperties() override; + void updateProperties() override; LuaTileRect* mTileRect; }; } diff --git a/components/lua_ui/properties.hpp b/components/lua_ui/properties.hpp index 7c47291b84..ade25156e3 100644 --- a/components/lua_ui/properties.hpp +++ b/components/lua_ui/properties.hpp @@ -6,6 +6,7 @@ #include #include +#include namespace LuaUi { @@ -18,6 +19,12 @@ namespace LuaUi std::is_same(); } + template + constexpr bool isMyGuiColor() + { + return std::is_same(); + } + template sol::optional parseValue( sol::object table, @@ -41,6 +48,8 @@ namespace LuaUi LuaT luaT = opt.as(); if constexpr (isMyGuiVector()) return T(luaT.x(), luaT.y()); + else if constexpr (isMyGuiColor()) + return T(luaT.r(), luaT.g(), luaT.b(), luaT.a()); else return luaT; } @@ -53,6 +62,8 @@ namespace LuaUi { if constexpr (isMyGuiVector()) return parseValue(table, field, errorPrefix); + else if constexpr (isMyGuiColor()) + return parseValue(table, field, errorPrefix); else return parseValue(table, field, errorPrefix); } diff --git a/components/lua_ui/text.cpp b/components/lua_ui/text.cpp index 47e2b574cc..3a56ad68af 100644 --- a/components/lua_ui/text.cpp +++ b/components/lua_ui/text.cpp @@ -1,18 +1,40 @@ - #include "text.hpp" +#include "alignment.hpp" + namespace LuaUi { LuaText::LuaText() : mAutoSized(true) + {} + + void LuaText::initialize() { - changeWidgetSkin("NormalText"); + changeWidgetSkin("SandText"); + setEditStatic(true); + setVisibleHScroll(false); + setVisibleVScroll(false); + + WidgetExtension::initialize(); } void LuaText::updateProperties() { - setCaption(propertyValue("caption", std::string())); mAutoSized = propertyValue("autoSize", true); + + setCaption(propertyValue("text", std::string())); + setFontHeight(propertyValue("textSize", 10)); + setTextColour(propertyValue("textColor", MyGUI::Colour(0, 0, 0, 1))); + setEditMultiLine(propertyValue("multiline", false)); + setEditWordWrap(propertyValue("wordWrap", false)); + + Alignment horizontal(propertyValue("textAlignH", Alignment::Start)); + Alignment vertical(propertyValue("textAlignV", Alignment::Start)); + setTextAlign(alignmentToMyGui(horizontal, vertical)); + + setTextShadow(propertyValue("textShadow", false)); + setTextShadowColour(propertyValue("textShadowColor", MyGUI::Colour(0, 0, 0, 1))); + WidgetExtension::updateProperties(); } diff --git a/components/lua_ui/text.hpp b/components/lua_ui/text.hpp index c435f6687a..e42b6f9935 100644 --- a/components/lua_ui/text.hpp +++ b/components/lua_ui/text.hpp @@ -1,26 +1,27 @@ #ifndef OPENMW_LUAUI_TEXT #define OPENMW_LUAUI_TEXT -#include +#include #include "widget.hpp" namespace LuaUi { - class LuaText : public MyGUI::TextBox, public WidgetExtension + class LuaText : public MyGUI::EditBox, public WidgetExtension { MYGUI_RTTI_DERIVED(LuaText) public: LuaText(); - virtual void updateProperties() override; + void initialize() override; + void updateProperties() override; void setCaption(const MyGUI::UString& caption) override; private: bool mAutoSized; protected: - virtual MyGUI::IntSize calculateSize() override; + MyGUI::IntSize calculateSize() override; }; } diff --git a/components/lua_ui/textedit.cpp b/components/lua_ui/textedit.cpp index 5fbdf3e6d8..ac44872f21 100644 --- a/components/lua_ui/textedit.cpp +++ b/components/lua_ui/textedit.cpp @@ -1,11 +1,43 @@ #include "textedit.hpp" +#include "alignment.hpp" + namespace LuaUi { + void LuaTextEdit::initialize() + { + changeWidgetSkin("LuaTextEdit"); + + eventEditTextChange += MyGUI::newDelegate(this, &LuaTextEdit::textChange); + + WidgetExtension::initialize(); + } + + void LuaTextEdit::deinitialize() + { + eventEditTextChange -= MyGUI::newDelegate(this, &LuaTextEdit::textChange); + WidgetExtension::deinitialize(); + } + void LuaTextEdit::updateProperties() { - setCaption(propertyValue("caption", std::string())); + setCaption(propertyValue("text", std::string())); + setFontHeight(propertyValue("textSize", 10)); + setTextColour(propertyValue("textColor", MyGUI::Colour(0, 0, 0, 1))); + setEditMultiLine(propertyValue("multiline", false)); + setEditWordWrap(propertyValue("wordWrap", false)); + + Alignment horizontal(propertyValue("textAlignH", Alignment::Start)); + Alignment vertical(propertyValue("textAlignV", Alignment::Start)); + setTextAlign(alignmentToMyGui(horizontal, vertical)); + + setEditStatic(propertyValue("readOnly", false)); WidgetExtension::updateProperties(); } + + void LuaTextEdit::textChange(MyGUI::EditBox*) + { + triggerEvent("textChanged", sol::make_object(lua(), getCaption().asUTF8())); + } } diff --git a/components/lua_ui/textedit.hpp b/components/lua_ui/textedit.hpp index dfc649994a..208240283c 100644 --- a/components/lua_ui/textedit.hpp +++ b/components/lua_ui/textedit.hpp @@ -11,7 +11,13 @@ namespace LuaUi { MYGUI_RTTI_DERIVED(LuaTextEdit) - virtual void updateProperties() override; + protected: + void initialize() override; + void deinitialize() override; + void updateProperties() override; + + private: + void textChange(MyGUI::EditBox*); }; } diff --git a/components/lua_ui/widget.cpp b/components/lua_ui/widget.cpp index 70ed6b64fe..4364a0c362 100644 --- a/components/lua_ui/widget.cpp +++ b/components/lua_ui/widget.cpp @@ -10,14 +10,13 @@ namespace LuaUi { WidgetExtension::WidgetExtension() - : mForcedCoord() - , mAbsoluteCoord() - , mRelativeCoord() - , mAnchor() - , mLua(nullptr) + : mLua(nullptr) , mWidget(nullptr) , mSlot(this) , mLayout(sol::nil) + , mProperties(sol::nil) + , mTemplateProperties(sol::nil) + , mExternal(sol::nil) , mParent(nullptr) {} @@ -80,16 +79,22 @@ namespace LuaUi ext->updateCoord(); } - WidgetExtension* WidgetExtension::findFirst(std::string_view flagName) + void WidgetExtension::attachTemplate(WidgetExtension* ext) + { + ext->widget()->attachToWidget(widget()); + ext->updateCoord(); + } + + WidgetExtension* WidgetExtension::findDeep(std::string_view flagName) { - if (externalValue(flagName, false)) - return this; for (WidgetExtension* w : mChildren) { - WidgetExtension* result = w->findFirst(flagName); + WidgetExtension* result = w->findDeep(flagName); if (result != nullptr) return result; } + if (externalValue(flagName, false)) + return this; return nullptr; } @@ -101,11 +106,11 @@ namespace LuaUi w->findAll(flagName, result); } - WidgetExtension* WidgetExtension::findFirstInTemplates(std::string_view flagName) + WidgetExtension* WidgetExtension::findDeepInTemplates(std::string_view flagName) { for (WidgetExtension* w : mTemplateChildren) { - WidgetExtension* result = w->findFirst(flagName); + WidgetExtension* result = w->findDeep(flagName); if (result != nullptr) return result; } @@ -163,7 +168,7 @@ namespace LuaUi for (size_t i = 0; i < children.size(); ++i) { mTemplateChildren[i] = children[i]; - mTemplateChildren[i]->widget()->attachToWidget(mWidget); + attachTemplate(mTemplateChildren[i]); } updateTemplate(); } @@ -171,9 +176,11 @@ namespace LuaUi void WidgetExtension::updateTemplate() { WidgetExtension* oldSlot = mSlot; - mSlot = findFirstInTemplates("slot"); - if (mSlot == nullptr) + WidgetExtension* slot = findDeepInTemplates("slot"); + if (slot == nullptr) mSlot = this; + else + mSlot = slot->mSlot; if (mSlot != oldSlot) for (WidgetExtension* w : mChildren) attach(w); @@ -281,7 +288,7 @@ namespace LuaUi MyGUI::IntSize WidgetExtension::childScalingSize() { - return widget()->getSize(); + return mSlot->widget()->getSize(); } void WidgetExtension::triggerEvent(std::string_view name, const sol::object& argument = sol::nil) const diff --git a/components/lua_ui/widget.hpp b/components/lua_ui/widget.hpp index 63af5b3cae..9037443676 100644 --- a/components/lua_ui/widget.hpp +++ b/components/lua_ui/widget.hpp @@ -50,6 +50,7 @@ namespace LuaUi const sol::table& getLayout() { return mLayout; } void setLayout(const sol::table& layout) { mLayout = layout; } + void resetSlot() { mSlot = this; } template T externalValue(std::string_view name, const T& defaultValue) @@ -80,13 +81,14 @@ namespace LuaUi return parseProperty(mProperties, mTemplateProperties, name, defaultValue); } - WidgetExtension* findFirstInTemplates(std::string_view flagName); + WidgetExtension* findDeepInTemplates(std::string_view flagName); std::vector findAllInTemplates(std::string_view flagName); virtual void updateTemplate(); virtual void updateProperties(); virtual void updateChildren() {}; + lua_State* lua() { return mLua; } void triggerEvent(std::string_view name, const sol::object& argument) const; // offsets the position and size, used only in C++ widget code @@ -114,8 +116,9 @@ namespace LuaUi WidgetExtension* mParent; void attach(WidgetExtension* ext); + void attachTemplate(WidgetExtension* ext); - WidgetExtension* findFirst(std::string_view name); + WidgetExtension* findDeep(std::string_view name); void findAll(std::string_view flagName, std::vector& result); void updateChildrenCoord(); diff --git a/components/lua_ui/window.cpp b/components/lua_ui/window.cpp index 6e6b80bf22..41281208d4 100644 --- a/components/lua_ui/window.cpp +++ b/components/lua_ui/window.cpp @@ -5,10 +5,7 @@ namespace LuaUi { LuaWindow::LuaWindow() - : mCaption() - , mPreviousMouse() - , mChangeScale() - , mMoveResize() + : mCaption(nullptr) {} void LuaWindow::updateTemplate() @@ -20,7 +17,7 @@ namespace LuaUi } mActionWidgets.clear(); - WidgetExtension* captionWidget = findFirstInTemplates("caption"); + WidgetExtension* captionWidget = findDeepInTemplates("caption"); mCaption = dynamic_cast(captionWidget); if (mCaption) diff --git a/components/lua_ui/window.hpp b/components/lua_ui/window.hpp index be3b3e2c23..8c466e73d1 100644 --- a/components/lua_ui/window.hpp +++ b/components/lua_ui/window.hpp @@ -14,8 +14,8 @@ namespace LuaUi public: LuaWindow(); - virtual void updateTemplate() override; - virtual void updateProperties() override; + void updateTemplate() override; + void updateProperties() override; private: LuaText* mCaption; diff --git a/docs/source/reference/lua-scripting/user_interface.rst b/docs/source/reference/lua-scripting/user_interface.rst index 13420d318c..bb4a3a3d53 100644 --- a/docs/source/reference/lua-scripting/user_interface.rst +++ b/docs/source/reference/lua-scripting/user_interface.rst @@ -1,11 +1,6 @@ User interface reference ======================== -.. toctree:: - :hidden: - - widgets/widget - Layouts ------- @@ -79,103 +74,57 @@ Events Widget types ------------ -.. list-table:: - :widths: 30 70 +.. toctree:: + :maxdepth: 1 - * - :ref:`Widget` - - Base widget type, all the other widget inherit its properties and events. - * - `Text` - - Displays text. - * - EditText - - Accepts text input from the user. - * - Window - - Can be moved and resized by the user. + Widget: Base widget type, all the other widgets inherit its properties and events. + Text: Displays text. + TextEdit: Accepts text input from the user. Example ------- -*scripts/requirePassword.lua* +*scripts/clock.lua* .. code-block:: Lua - local core = require('openmw.core') - local async = require('openmw.async') - local ui = require('openmw.ui') - local v2 = require('openmw.util').vector2 - - local layout = { - layers = 'Windows', - type = ui.TYPE.Window, - template = { skin = 'MW_Window' }, -- TODO: replace all skins here when they are re-implemented in Lua - props = { - size = v2(200, 250), - -- put the window in the middle of the screen - relativePosition = v2(0.5, 0.5), - anchor = v2(0.5, 0.5), - }, - content = ui.content { - { - type = ui.TYPE.Text, - template = { skin = 'SandText' }, - props = { - caption = 'Input password', - relativePosition = v2(0.5, 0), - anchor = v2(0.5, 0), - }, - }, - { - name = 'input', - type = ui.TYPE.TextEdit, - template = { skin = "MW_TextEdit" }, - props = { - caption = '', - relativePosition = v2(0.5, 0.5), - anchor = v2(0.5, 0.5), - size = v2(125, 50), - }, - events = {} - }, - { - name = 'submit', - type = ui.TYPE.Text, -- TODO: replace with button when implemented - template = { skin = "MW_Button" }, - props = { - caption = 'Submit', - -- position at the bottom - relativePosition = v2(0.5, 1.0), - anchor = v2(0.5, 1.0), - autoSize = false, - size = v2(75, 50), - }, - events = {}, - }, - }, - } - - local element = nil - - local input = layout.content.input - -- TODO: replace with a better event when TextEdit is finished - input.events.textInput = async:callback(function(text) - input.props.caption = input.props.caption .. text - end) - - local submit = layout.content.submit - submit.events.mouseClick = async:callback(function() - if input.props.caption == 'very secret password' then - if element then - element:destroy() - end - else - print('wrong password', input.props.caption) - core.quit() - end - end) - - element = ui.create(layout) - -*requirePassword.omwscripts* + local ui = require('openmw.ui') + local util = require('openmw.util') + local calendar = require('openmw_aux.calendar') + local time = require('openmw_aux.time') + + local element = ui.create { + -- important not to forget the layer + -- by default widgets are not attached to any layer and are not visible + layer = 'HUD', + type = ui.TYPE.Text, + props = { + -- position in the top right corner + relativePosition = util.vector2(1, 0), + -- position is for the top left corner of the widget by default + -- change it to align exactly to the top right corner of the screen + anchor = util.vector2(1, 0), + text = calendar.formatGameTime('%H:%M'), + textSize = 24, + -- default black text color isn't always visible + textColor = util.color.rgb(0, 1, 0), + }, + } + + local function updateTime() + -- formatGameTime uses current time by default + -- otherwise we could get it by calling `core.getGameTime()` + element.layout.props.text = calendar.formatGameTime('%H:%M') + -- the layout changes won't affect the widget unless we request an update + element:update() + end + + -- we are showing game time in hours and minutes + -- so no need to update more often than ones a game minute + time.runRepeatedly(updateTime, 1 * time.minute, { type = time.GameTime }) + +*clock.omwscripts* :: - PLAYER: scripts/requirePassword.lua + PLAYER: scripts/clock.lua diff --git a/docs/source/reference/lua-scripting/widgets/text.rst b/docs/source/reference/lua-scripting/widgets/text.rst new file mode 100644 index 0000000000..074100577a --- /dev/null +++ b/docs/source/reference/lua-scripting/widgets/text.rst @@ -0,0 +1,44 @@ +Text Widget +=========== + +Properties +---------- + +.. list-table:: + :header-rows: 1 + :widths: 20 20 60 + + * - name + - type (default value) + - description + * - autoSize + - boolean (true) + - | Adjusts this widget's size to fit the text exactly. + | Ignores `size` and `relativeSize`. + * - text + - string ('') + - The text to display. + * - textSize + - number (10) + - The size of the text. + * - textColor + - util.color (0, 0, 0, 1) + - The color of the text. + * - multiline + - boolean (false) + - Whether to render text on multiple lines. + * - wordWrap + - boolean (false) + - Whether to break text into lines to fit the widget's width. + * - textAlignH + - ui.ALIGNMENT (Start) + - Horizontal alignment of the text. + * - textAlignV + - ui.ALIGNMENT (Start) + - Vertical alignment of the text. + * - textShadow + - boolean (false) + - Whether to render a shadow behind the text. + * - textShadowColor + - util.color (0, 0, 0, 1) + - The color of the text shadow. diff --git a/docs/source/reference/lua-scripting/widgets/textedit.rst b/docs/source/reference/lua-scripting/widgets/textedit.rst new file mode 100644 index 0000000000..16e640d1b0 --- /dev/null +++ b/docs/source/reference/lua-scripting/widgets/textedit.rst @@ -0,0 +1,51 @@ +TextEdit Widget +=============== + +Properties +---------- + +.. list-table:: + :header-rows: 1 + :widths: 20 20 60 + + * - name + - type (default value) + - description + * - text + - string ('') + - The text to display. + * - textSize + - number (10) + - The size of the text. + * - textColor + - util.color (0, 0, 0, 1) + - The color of the text. + * - multiline + - boolean (false) + - Whether to render text on multiple lines. + * - wordWrap + - boolean (false) + - Whether to break text into lines to fit the widget's width. + * - textAlignH + - ui.ALIGNMENT (Start) + - Horizontal alignment of the text. + * - textAlignV + - ui.ALIGNMENT (Start) + - Vertical alignment of the text. + * - readOnly + - boolean (false) + - Whether the text can be edited. + +Events +------ + +.. list-table:: + :header-rows: 1 + :widths: 20 20 60 + + * - name + - first argument type + - description + * - textChanged + - string + - Displayed text changed (e. g. by user input) diff --git a/files/lua_api/openmw/ui.lua b/files/lua_api/openmw/ui.lua index 8049df860a..d4f305b96e 100644 --- a/files/lua_api/openmw/ui.lua +++ b/files/lua_api/openmw/ui.lua @@ -6,18 +6,32 @@ -- local ui = require('openmw.ui') --- --- @field [parent=#ui] #WIDGET_TYPE WIDGET_TYPE +-- Widget types +-- @field [parent=#ui] #TYPE TYPE + +--- +-- Alignment values (left to right, top to bottom) +-- @field [parent=#ui] #ALIGNMENT ALIGNMENT --- -- Tools for working with layers -- @field [parent=#ui] #Layers layers --- --- @type WIDGET_TYPE --- @field [parent=#WIDGET_TYPE] Widget Base widget type --- @field [parent=#WIDGET_TYPE] Text Display text --- @field [parent=#WIDGET_TYPE] TextEdit Accepts user text input --- @field [parent=#WIDGET_TYPE] Window Can be moved and resized by the user +-- All available widget types +-- @type TYPE +-- @field Widget Base widget type +-- @field Text Display text +-- @field TextEdit Accepts user text input +-- @field Window Can be moved and resized by the user + +--- +-- Alignment values (details depend on the specific property). +-- For horizontal alignment the order is left to right, for vertical alignment the order is top to bottom. +-- @type ALIGNMENT +-- @field Start +-- @field Center +-- @field End --- -- Shows given message at the bottom of the screen. diff --git a/files/mygui/CMakeLists.txt b/files/mygui/CMakeLists.txt index bdf7558cf7..1edfbca806 100644 --- a/files/mygui/CMakeLists.txt +++ b/files/mygui/CMakeLists.txt @@ -43,6 +43,7 @@ set(MYGUI_FILES openmw_journal.layout openmw_journal.skin.xml openmw_layers.xml + openmw_lua.xml openmw_list.skin.xml openmw_mainmenu.layout openmw_mainmenu.skin.xml diff --git a/files/mygui/core.skin b/files/mygui/core.skin index 5cf02a99e5..ee9135554e 100644 --- a/files/mygui/core.skin +++ b/files/mygui/core.skin @@ -15,8 +15,4 @@ - - - - diff --git a/files/mygui/core.xml b/files/mygui/core.xml index 23697890dc..54e2aecd27 100644 --- a/files/mygui/core.xml +++ b/files/mygui/core.xml @@ -5,6 +5,7 @@ + diff --git a/files/mygui/openmw_lua.xml b/files/mygui/openmw_lua.xml new file mode 100644 index 0000000000..cb0af2b4a9 --- /dev/null +++ b/files/mygui/openmw_lua.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file