Skip to content

Commit bddf481

Browse files
authored
Merge pull request #540 from pfeerick/pfeerick/tx16mk3
feat: add 800x480 template
2 parents c93054d + c96f68d commit bddf481

3 files changed

Lines changed: 45 additions & 11 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
return {
2+
margin = 5,
3+
indent = 20,
4+
lineSpacing = 30,
5+
listSpacing = { line = 30, field = 200 },
6+
tableSpacing = { row = 30, col = 80, header = 30 },
7+
}

src/SCRIPTS/BF/radios.lua

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
local supportedRadios =
22
{
3-
["128x64"] =
3+
["128x64"] =
44
{
55
msp = {
66
template = "TEMPLATES/128x64.lua",
@@ -27,7 +27,7 @@ local supportedRadios =
2727
},
2828
},
2929
},
30-
["128x96"] =
30+
["128x96"] =
3131
{
3232
msp = {
3333
template = "TEMPLATES/128x96.lua",
@@ -54,7 +54,7 @@ local supportedRadios =
5454
},
5555
},
5656
},
57-
["212x64"] =
57+
["212x64"] =
5858
{
5959
msp = {
6060
template = "TEMPLATES/212x64.lua",
@@ -81,7 +81,7 @@ local supportedRadios =
8181
}
8282
},
8383
},
84-
["480x272"] =
84+
["480x272"] =
8585
{
8686
msp = {
8787
template = "TEMPLATES/480x272.lua",
@@ -137,6 +137,34 @@ local supportedRadios =
137137
}
138138
},
139139
},
140+
["800x480"] =
141+
{
142+
msp = {
143+
template = "TEMPLATES/800x480.lua",
144+
highRes = true,
145+
MenuBox = { x=300, y=180, w=220, x_offset=88, h_line=25, h_offset=6 },
146+
SaveBox = { x=300, y=180, w=220, x_offset=12, h=80, h_offset=12 },
147+
NoTelem = { (LCD_W-96)/2, LCD_H - 28, "No Telemetry", (COLOR_THEME_SECONDARY1 or TEXT_COLOR or 0) + INVERS + BLINK },
148+
textSize = 0,
149+
yMinLimit = 45,
150+
yMaxLimit = LCD_H - 45,
151+
},
152+
cms = {
153+
rows = 9,
154+
cols = 32,
155+
pixelsPerRow = 28,
156+
pixelsPerChar = 25,
157+
xIndent = 10,
158+
yOffset = 32,
159+
textSize = MIDSIZE,
160+
refresh = {
161+
event = EVT_VIRTUAL_ENTER,
162+
text = "Refresh: [ENT]",
163+
top = 1,
164+
left = 300,
165+
}
166+
},
167+
},
140168
["320x480"] =
141169
{
142170
msp = {

src/SCRIPTS/BF/ui.lua

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
local template = assert(loadScript(radio.template))()
2+
13
local uiStatus =
24
{
35
init = 1,
@@ -181,8 +183,8 @@ end
181183

182184
local function drawScreenTitle(screenTitle)
183185
if radio.highRes then
184-
lcd.drawFilledRectangle(0, 0, LCD_W, 30, COLOR_THEME_SECONDARY1 or TITLE_BGCOLOR)
185-
lcd.drawText(5,5,screenTitle, COLOR_THEME_PRIMARY2 or MENU_TITLE_COLOR)
186+
lcd.drawFilledRectangle(0, 0, LCD_W, template.lineSpacing + template.margin, COLOR_THEME_SECONDARY1 or TITLE_BGCOLOR)
187+
lcd.drawText(template.margin,template.margin,screenTitle, COLOR_THEME_PRIMARY2 or MENU_TITLE_COLOR)
186188
else
187189
lcd.drawFilledRectangle(0, 0, LCD_W, 10, FORCE)
188190
lcd.drawText(1,1,screenTitle,INVERS)
@@ -217,7 +219,7 @@ local function drawScreen()
217219
if pageState == pageStatus.editing then
218220
valueOptions = valueOptions + BLINK
219221
end
220-
end
222+
end
221223
if f.value then
222224
if f.upd and Page.values then
223225
f.upd(Page)
@@ -319,10 +321,7 @@ local function run_ui(event)
319321
lcd.clear()
320322
local yMinLim = radio.yMinLimit
321323
local yMaxLim = radio.yMaxLimit
322-
local lineSpacing = 10
323-
if radio.highRes then
324-
lineSpacing = 25
325-
end
324+
local lineSpacing = template.lineSpacing
326325
local currentFieldY = (currentPage-1)*lineSpacing + yMinLim
327326
if currentFieldY <= yMinLim then
328327
mainMenuScrollY = 0

0 commit comments

Comments
 (0)