Skip to content

Commit 6f8c960

Browse files
committed
Make variables local to reduce memory use
Makes Page, backgroundFill, foregroundColor and globalTextOptions local to ui.lua. Removes the global variables from horuspre.lua and does the assignment in ui.lua.
1 parent bbb244d commit 6f8c960

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/SCRIPTS/BF/HORUS/horuspre.lua

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ PageFiles =
1212
"gpspids.lua",
1313
}
1414

15-
backgroundFill = TEXT_BGCOLOR
16-
foregroundColor = LINE_COLOR
17-
globalTextOptions = TEXT_COLOR
18-
1915
MenuBox = { x=120, y=100, w=200, x_offset=68, h_line=20, h_offset=6 }
2016
SaveBox = { x=120, y=100, w=180, x_offset=12, h=60, h_offset=12 }
2117
NoTelem = { 192, LCD_H - 28, "No Telemetry", TEXT_COLOR + INVERS + BLINK }

src/SCRIPTS/BF/ui.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ local lastRunTS = 0
2929
local killEnterBreak = 0
3030
local scrollPixelsY = 0
3131

32-
Page = nil
32+
local Page = nil
3333

34-
backgroundFill = backgroundFill or ERASE
35-
foregroundColor = foregroundColor or SOLID
34+
local backgroundFill = TEXT_BGCOLOR or ERASE
35+
local foregroundColor = LINE_COLOR or SOLID
3636

37-
globalTextOptions = globalTextOptions or 0
37+
local globalTextOptions = TEXT_COLOR or 0
3838

3939
local function saveSettings(new)
4040
if Page.values then

0 commit comments

Comments
 (0)