summaryrefslogtreecommitdiff
path: root/scripts/global.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/global.lua')
-rwxr-xr-xscripts/global.lua39
1 files changed, 37 insertions, 2 deletions
diff --git a/scripts/global.lua b/scripts/global.lua
index fef9ac6..9cfc573 100755
--- a/scripts/global.lua
+++ b/scripts/global.lua
@@ -262,8 +262,8 @@ function GetSLIMaxInfo()
if mOSPBlinkTime < 1 or mOSPBlinkTime > 48 then mOSPBlinkTime = 32 end
-- get current Power LED index
- mPowerLED = GetContextInfo("ledpowerindex")
- if mPowerLED == nil then mPowerLED = 11 end
+ --mPowerLED = GetContextInfo("ledpowerindex")
+ --if mPowerLED == nil then mPowerLED = 11 end
-- get current speed Limiter LED index
mSpeedLimiterLED = GetContextInfo("ledspeedlimiterindex")
@@ -441,6 +441,41 @@ function GetCurrentGear()
return result
end
+-- marquee
+function Marquee(mString, mDelay)
+ local length = string.len(mString)
+
+ for i = 1,length+12 do
+
+ local mRight = ""
+ local mIddle = " "
+ local mLeft = ""
+
+ -- right
+ for j = i-5,i do
+ if j <= 0 then mRight = mRight .. " " end
+ if j > 0 and j <= length then mRight = mRight .. string.sub(mString, j, j) end
+ if j > length then mRight = mRight .. " " end
+ end
+ -- middle
+ j = i - 6
+ if j > 0 and j <= length then mIddle = string.sub(mString, j , j) end
+ -- left
+ for j = i-12,i-7 do
+ if j <= 0 then mLeft = mLeft .. " " end
+ if j > 0 and j <= length then mLeft = mLeft .. string.sub(mString, j, j) end
+ if j > length then mLeft = mLeft .. " " end
+ end
+
+
+ SetRightDigits(mRight)
+ SetGearDigit(mIddle)
+ SetLeftDigits(mLeft)
+
+ SLISendReport(1)
+ SLISleep(mDelay)
+ end
+end
--==============================================
require "scripts/slidevice"