1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 09:49:55 +00:00
openmw-tes3mp/files/mygui/tes3mp_dialog_list.layout
Koncord adb49b7c7d Add New GUI dialog: ListBox
Example:

local GUI_LISTBOX = 42

function OnPlayerSendMessage(pid, message)
    if message == "/lb" then
        local items = "consectetur adipiscing elit\nsed do eiusmod tempor incididunt ut labore\net dolore magna aliqua." -- items can be separated through newline
        local label = "Lorem ipsum dolor sit amet"
        tes3mp.ListBox(pid, GUI_LISTBOX, label, items)
    end
end

function OnGUIAction(pid, idGui, data)
    if idGui == GUI_LISTBOX then
        print("ID: " .. idGui .. " data: " .. tostring(data)) -- if value higher than last item id
    end
end
2016-11-04 00:24:16 +08:00

32 lines
1.3 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 300 300" name="_Main">
<Property key="Visible" value="false"/>
<Widget type="EditBox" skin="MW_TextEditClient" position="16 8 268 48" name="Message" align="Center Top">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Top HCenter"/>
<Property key="Static" value="true"/>
<Property key="WordWrap" value="true"/>
<Property key="MultiLine" value="true"/>
</Widget>
<Widget type="ListBox" skin="MW_List" position="16 56 268 170" align="Left Top" name="ListBox"/>
<Widget type="VBox" position="0 262 292 24" align="Right Bottom">
<Widget type="HBox">
<Property key="Spacing" value="8"/>
<Widget type="AutoSizedButton" skin="MW_Button" name="OkButton" align="Right Bottom">
<Property key="Caption" value="#{sYes}"/>
</Widget>
<!--<Widget type="AutoSizedButton" skin="MW_Button" name="CancelButton" align="Right Bottom">
<Property key="Caption" value="#{sNo}"/>
</Widget>-->
</Widget>
<Widget type="Widget"/>
</Widget>
</Widget>
</MyGUI>