Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/SCRIPTS/BF/TEMPLATES/800x480.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
return {
margin = 5,
indent = 20,
lineSpacing = 30,
listSpacing = { line = 30, field = 200 },
tableSpacing = { row = 30, col = 80, header = 30 },
}
36 changes: 32 additions & 4 deletions src/SCRIPTS/BF/radios.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local supportedRadios =
{
["128x64"] =
["128x64"] =
{
msp = {
template = "TEMPLATES/128x64.lua",
Expand All @@ -27,7 +27,7 @@ local supportedRadios =
},
},
},
["128x96"] =
["128x96"] =
{
msp = {
template = "TEMPLATES/128x96.lua",
Expand All @@ -54,7 +54,7 @@ local supportedRadios =
},
},
},
["212x64"] =
["212x64"] =
{
msp = {
template = "TEMPLATES/212x64.lua",
Expand All @@ -81,7 +81,7 @@ local supportedRadios =
}
},
},
["480x272"] =
["480x272"] =
{
msp = {
template = "TEMPLATES/480x272.lua",
Expand Down Expand Up @@ -137,6 +137,34 @@ local supportedRadios =
}
},
},
["800x480"] =
{
msp = {
template = "TEMPLATES/800x480.lua",
highRes = true,
MenuBox = { x=300, y=180, w=220, x_offset=88, h_line=25, h_offset=6 },
SaveBox = { x=300, y=180, w=220, x_offset=12, h=80, h_offset=12 },
NoTelem = { (LCD_W-96)/2, LCD_H - 28, "No Telemetry", (COLOR_THEME_SECONDARY1 or TEXT_COLOR or 0) + INVERS + BLINK },
textSize = 0,
yMinLimit = 45,
yMaxLimit = LCD_H - 45,
},
cms = {
rows = 9,
cols = 32,
pixelsPerRow = 28,
pixelsPerChar = 25,
xIndent = 10,
yOffset = 32,
textSize = MIDSIZE,
refresh = {
event = EVT_VIRTUAL_ENTER,
text = "Refresh: [ENT]",
top = 1,
left = 300,
}
},
},
["320x480"] =
{
msp = {
Expand Down
13 changes: 6 additions & 7 deletions src/SCRIPTS/BF/ui.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local template = assert(loadScript(radio.template))()

local uiStatus =
{
init = 1,
Expand Down Expand Up @@ -181,8 +183,8 @@ end

local function drawScreenTitle(screenTitle)
if radio.highRes then
lcd.drawFilledRectangle(0, 0, LCD_W, 30, COLOR_THEME_SECONDARY1 or TITLE_BGCOLOR)
lcd.drawText(5,5,screenTitle, COLOR_THEME_PRIMARY2 or MENU_TITLE_COLOR)
lcd.drawFilledRectangle(0, 0, LCD_W, template.lineSpacing + template.margin, COLOR_THEME_SECONDARY1 or TITLE_BGCOLOR)
lcd.drawText(template.margin,template.margin,screenTitle, COLOR_THEME_PRIMARY2 or MENU_TITLE_COLOR)
else
lcd.drawFilledRectangle(0, 0, LCD_W, 10, FORCE)
lcd.drawText(1,1,screenTitle,INVERS)
Expand Down Expand Up @@ -217,7 +219,7 @@ local function drawScreen()
if pageState == pageStatus.editing then
valueOptions = valueOptions + BLINK
end
end
end
if f.value then
if f.upd and Page.values then
f.upd(Page)
Expand Down Expand Up @@ -319,10 +321,7 @@ local function run_ui(event)
lcd.clear()
local yMinLim = radio.yMinLimit
local yMaxLim = radio.yMaxLimit
local lineSpacing = 10
if radio.highRes then
lineSpacing = 25
end
local lineSpacing = template.lineSpacing
local currentFieldY = (currentPage-1)*lineSpacing + yMinLim
if currentFieldY <= yMinLim then
mainMenuScrollY = 0
Expand Down
Loading