updated XML

This commit is contained in:
Chr1Z93 2023-04-18 22:49:25 +02:00
parent f2b59a5c7b
commit 8c2d050854
2 changed files with 16 additions and 40 deletions

View File

@ -1086,29 +1086,20 @@ function updateNotificationLoading()
header.value = header.value .. modMeta["latestVersion"]
-- update the release highlights
local releaseHighlightWrapper = find_tag_with_id(ui, 'releaseHighlightWrapper')
releaseHighlightWrapper.children = {}
local highlightText = "• " .. highlights[1]
for _, entry in pairs(highlights) do
table.insert(releaseHighlightWrapper.children,
{ tag = 'Row',
attributes = { class="releaseHighlight" },
children =
{ tag = 'Cell',
attributes = { class="releaseHighlight" },
children =
{ tag = 'Text',
attributes = { class="releaseHighlight" },
value = "• " .. entry,
}
}
}
)
for i, entry in pairs(highlights) do
if i~=1 then
highlightText = highlightText .. "\n• " .. entry
end
end
local releaseHighlightText = find_tag_with_id(ui, 'releaseHighlightText')
releaseHighlightText.value = highlightText
-- set height for amount of highlights
local highlightRow = find_tag_with_id(ui, 'highlightRow')
highlightRow.attributes.preferredHeight = 50*#highlights
highlightRow.attributes.preferredHeight = 20*#highlights
local window = find_tag_with_id(ui, 'updateNotification')
window.attributes.height = highlightRow.attributes.preferredHeight + 100

View File

@ -1,15 +1,5 @@
<!-- Default formatting partly inherented from OptionPanel! -->
<Defaults>
<!-- table entries -->
<Text class="releaseHighlight"
fontSize="16"/>
<Row class="releaseHighlight"
preferredHeight="50"/>
<Cell class="releaseHighlight"
color="#333333"/>
</Defaults>
<!-- Default formatting inherented from OptionPanel! -->
<!-- Window with release highlights -->
<TableLayout id="updateNotification"
active="false"
color="#000000"
@ -26,7 +16,7 @@
<!-- Header -->
<Row preferredHeight="50">
<Cell>
<Panel padding="10 0 0 0">
<Panel padding="10 10 0 0">
<Text id="notificationHeader"
font="font_teutonic-arkham"
fontSize="30"
@ -39,16 +29,11 @@
<Row id="highlightRow"
preferredHeight="100">
<Cell>
<!-- this part will be updated via script -->
<TableLayout id="releaseHighlightWrapper"
autoCalculateHeight="1"
cellPadding="10 15 5 5">
<Row class="releaseHighlight">
<Cell class="releaseHighlight">
<Text class="releaseHighlight">Placeholder</Text>
</Cell>
</Row>
</TableLayout>
<Panel padding="15 15 0 0">
<!-- this part will be updated via script -->
<Text id="releaseHighlightText"
resizeTextForBestFit="true">Placeholder</Text>
</Panel>
</Cell>
</Row>