split release notes into separate window
This commit is contained in:
parent
387145ca19
commit
ace11ed2b2
@ -1071,9 +1071,11 @@ function compareVersion(request)
|
|||||||
-- updating the XML notification
|
-- updating the XML notification
|
||||||
local ui = UI.getXmlTable()
|
local ui = UI.getXmlTable()
|
||||||
|
|
||||||
-- update the header
|
-- update the headers
|
||||||
local header = find_tag_with_id(ui, 'versionHeader')
|
local header = find_tag_with_id(ui, 'notificationHeader')
|
||||||
header.value = "New Version available: " .. modMeta["latestVersion"] .. " (current: " .. MOD_VERSION .. ")"
|
header.value = "New Version available: " .. modMeta["latestVersion"] .. " (current: " .. MOD_VERSION .. ")"
|
||||||
|
local header2 = find_tag_with_id(ui, 'versionHeader')
|
||||||
|
header2.value = "Release Notes for " .. modMeta["latestVersion"]
|
||||||
|
|
||||||
-- update the release notes
|
-- update the release notes
|
||||||
local releaseNoteWrapper = find_tag_with_id(ui, 'releaseNoteWrapper')
|
local releaseNoteWrapper = find_tag_with_id(ui, 'releaseNoteWrapper')
|
||||||
@ -1081,9 +1083,17 @@ function compareVersion(request)
|
|||||||
|
|
||||||
for _, entry in pairs(releaseNotes["Details"]) do
|
for _, entry in pairs(releaseNotes["Details"]) do
|
||||||
table.insert(releaseNoteWrapper.children,
|
table.insert(releaseNoteWrapper.children,
|
||||||
|
{ tag = 'Row',
|
||||||
|
attributes = { class="releaseNote" },
|
||||||
|
children =
|
||||||
|
{ tag = 'Cell',
|
||||||
|
attributes = { class="releaseNote" },
|
||||||
|
children =
|
||||||
{ tag = 'Text',
|
{ tag = 'Text',
|
||||||
value = entry,
|
attributes = { class="releaseNote" },
|
||||||
attributes = { class="releaseNote" }
|
value = "• " .. entry,
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
UI.setXmlTable(ui)
|
UI.setXmlTable(ui)
|
||||||
@ -1097,6 +1107,13 @@ end
|
|||||||
function onClick_notification(_, parameter)
|
function onClick_notification(_, parameter)
|
||||||
if parameter == "dontNotify" then
|
if parameter == "dontNotify" then
|
||||||
dontNotify[modMeta["latestVersion"]] = true
|
dontNotify[modMeta["latestVersion"]] = true
|
||||||
|
elseif parameter == "details" then
|
||||||
|
UI.show("releaseNotes")
|
||||||
end
|
end
|
||||||
|
|
||||||
UI.hide("updateNotification")
|
UI.hide("updateNotification")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function onClick_releaseNotes()
|
||||||
|
UI.hide("releaseNotes")
|
||||||
|
end
|
||||||
|
@ -123,3 +123,4 @@
|
|||||||
|
|
||||||
<Include src="OptionPanel.xml"/>
|
<Include src="OptionPanel.xml"/>
|
||||||
<Include src="UpdateNotification.xml"/>
|
<Include src="UpdateNotification.xml"/>
|
||||||
|
<Include src="ReleaseNotes.xml"/>
|
||||||
|
65
xml/ReleaseNotes.xml
Normal file
65
xml/ReleaseNotes.xml
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<Defaults>
|
||||||
|
<!-- table entries -->
|
||||||
|
<Text class="releaseNote"
|
||||||
|
fontSize="16"/>
|
||||||
|
<Row class="releaseNote"
|
||||||
|
preferredHeight="50"/>
|
||||||
|
<Cell class="releaseNote"
|
||||||
|
color="#333333"/>
|
||||||
|
</Defaults>
|
||||||
|
|
||||||
|
<TableLayout id="releaseNotes"
|
||||||
|
active="false"
|
||||||
|
color="#000000"
|
||||||
|
outlineSize="2 2"
|
||||||
|
outline="grey"
|
||||||
|
showAnimation="Grow"
|
||||||
|
hideAnimation="Shrink"
|
||||||
|
animationDuration="0.2"
|
||||||
|
rectAlignment="MiddleCenter"
|
||||||
|
height="300"
|
||||||
|
width="450">
|
||||||
|
|
||||||
|
<!-- Header -->
|
||||||
|
<Row preferredHeight="50">
|
||||||
|
<Cell>
|
||||||
|
<Panel padding="10 0 0 0">
|
||||||
|
<Text id="versionHeader"
|
||||||
|
font="font_teutonic-arkham"
|
||||||
|
fontSize="30"
|
||||||
|
alignment="MiddleCenter">Release Notes for </Text>
|
||||||
|
</Panel>
|
||||||
|
</Cell>
|
||||||
|
</Row>
|
||||||
|
|
||||||
|
<!-- Scrollable part with release notes -->
|
||||||
|
<Row preferredHeight="200">
|
||||||
|
<Cell>
|
||||||
|
<VerticalScrollView horizontalScrollbarVisibility="AutohideAndExpandViewport">
|
||||||
|
<!-- this part will be updated via script -->
|
||||||
|
<TableLayout id="releaseNoteWrapper"
|
||||||
|
autoCalculateHeight="1"
|
||||||
|
cellPadding="10 15 5 5">
|
||||||
|
<Row class="releaseNote">
|
||||||
|
<Cell class="releaseNote">
|
||||||
|
<Text class="releaseNote">Placeholder</Text>
|
||||||
|
</Cell>
|
||||||
|
</Row>
|
||||||
|
</TableLayout>
|
||||||
|
</VerticalScrollView>
|
||||||
|
</Cell>
|
||||||
|
</Row>
|
||||||
|
|
||||||
|
<!-- Buttons: "Close" -->
|
||||||
|
<Row preferredHeight="50">
|
||||||
|
<Cell>
|
||||||
|
<HorizontalLayout minHeight="55"
|
||||||
|
flexibleHeight="0"
|
||||||
|
padding="10 10 5 10"
|
||||||
|
spacing="100">
|
||||||
|
<Button class="bottomButtons"
|
||||||
|
onClick="onClick_releaseNotes">Close</Button>
|
||||||
|
</HorizontalLayout>
|
||||||
|
</Cell>
|
||||||
|
</Row>
|
||||||
|
</TableLayout>
|
@ -1,25 +1,4 @@
|
|||||||
<Defaults>
|
<!-- Default formatting inherented from OptionPanel! -->
|
||||||
<Text color="#FFFFFF"
|
|
||||||
alignment="MiddleLeft" />
|
|
||||||
<Text class="releaseNote"
|
|
||||||
fontSize="18"/>
|
|
||||||
|
|
||||||
<!-- buttons at the bottom -->
|
|
||||||
<Button class="bottomButtons"
|
|
||||||
hoverClass="hover"
|
|
||||||
pressClass="press"
|
|
||||||
selectClass="select"
|
|
||||||
color="#888888"
|
|
||||||
minHeight="35"
|
|
||||||
fontSize="24"
|
|
||||||
font="font_teutonic-arkham"/>
|
|
||||||
<Button class="hover"
|
|
||||||
color="grey"/>
|
|
||||||
<Button class="press"
|
|
||||||
color="white"/>
|
|
||||||
<Button class="select"
|
|
||||||
color="white"/>
|
|
||||||
</Defaults>
|
|
||||||
|
|
||||||
<TableLayout id="updateNotification"
|
<TableLayout id="updateNotification"
|
||||||
active="false"
|
active="false"
|
||||||
@ -29,47 +8,34 @@
|
|||||||
showAnimation="SlideIn_Top"
|
showAnimation="SlideIn_Top"
|
||||||
hideAnimation="SlideOut_Top"
|
hideAnimation="SlideOut_Top"
|
||||||
animationDuration="0.2"
|
animationDuration="0.2"
|
||||||
rectAlignment="UpperCenter"
|
rectAlignment="UpperLeft"
|
||||||
offsetXY="0 -60"
|
offsetXY="60 -5"
|
||||||
height="300"
|
height="100"
|
||||||
width="450">
|
width="500">
|
||||||
|
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<Row preferredHeight="50">
|
<Row preferredHeight="50">
|
||||||
<Cell>
|
<Cell>
|
||||||
<Panel padding="10 0 0 0">
|
<Panel padding="10 0 0 0">
|
||||||
<Text id="versionHeader"
|
<Text id="notificationHeader"
|
||||||
font="font_teutonic-arkham"
|
font="font_teutonic-arkham"
|
||||||
fontSize="30"
|
fontSize="30"
|
||||||
alignment="MiddleCenter">New Version available: </Text>
|
alignment="MiddleCenter">New version available: </Text>
|
||||||
</Panel>
|
</Panel>
|
||||||
</Cell>
|
</Cell>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<!-- Scrollable part with release notes -->
|
<!-- Buttons: "Don't show again", "Details" and "Close" -->
|
||||||
<Row preferredHeight="200">
|
|
||||||
<Cell>
|
|
||||||
<VerticalScrollView horizontalScrollbarVisibility="AutohideAndExpandViewport">
|
|
||||||
<!-- this part will be updated via script -->
|
|
||||||
<VerticalLayout id="releaseNoteWrapper"
|
|
||||||
padding="10 0 0 0"
|
|
||||||
spacing="5">
|
|
||||||
<Text class="releaseNote">Entry 1</Text>
|
|
||||||
<Text class="releaseNote">Entry 2</Text>
|
|
||||||
</VerticalLayout>
|
|
||||||
</VerticalScrollView>
|
|
||||||
</Cell>
|
|
||||||
</Row>
|
|
||||||
|
|
||||||
<!-- Buttons: "Don't show again" and "Close" -->
|
|
||||||
<Row preferredHeight="50">
|
<Row preferredHeight="50">
|
||||||
<Cell>
|
<Cell>
|
||||||
<HorizontalLayout minHeight="55"
|
<HorizontalLayout minHeight="55"
|
||||||
flexibleHeight="0"
|
flexibleHeight="0"
|
||||||
padding="10 10 5 10"
|
padding="10 10 5 10"
|
||||||
spacing="100">
|
spacing="10">
|
||||||
<Button class="bottomButtons"
|
<Button class="bottomButtons"
|
||||||
onClick="onClick_notification(dontNotify)">Don't show again</Button>
|
onClick="onClick_notification(dontNotify)">Don't show again</Button>
|
||||||
|
<Button class="bottomButtons"
|
||||||
|
onClick="onClick_notification(details)">Show details</Button>
|
||||||
<Button class="bottomButtons"
|
<Button class="bottomButtons"
|
||||||
onClick="onClick_notification(close)">Close</Button>
|
onClick="onClick_notification(close)">Close</Button>
|
||||||
</HorizontalLayout>
|
</HorizontalLayout>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user