From c34e913ff8844eec27a8db2ee5ecc702d146dece Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Wed, 27 Nov 2013 15:41:36 +0100 Subject: POuet poUET --- scripts/gugus/digits.lua | 93 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 64 insertions(+), 29 deletions(-) (limited to 'scripts/gugus/digits.lua') diff --git a/scripts/gugus/digits.lua b/scripts/gugus/digits.lua index 27bde1d..cfaab0e 100644 --- a/scripts/gugus/digits.lua +++ b/scripts/gugus/digits.lua @@ -12,13 +12,13 @@ require("scripts/gugus/functions") function leftDigitsEvent(swFunction) lPanel = DigitsEvent(swFunction, "L") - if lPanel == nil then lPanel = "-.--.---" end + if lPanel == nil then lPanel = "}.{~._]-" end SetLeftDigits( lPanel ) return 1 end function rightDigitsEvent(swFunction) rPanel = DigitsEvent(swFunction, "R") - if rPanel == nil then rPanel = "-:--.---" end + if rPanel == nil then rPanel = "-[_.~}.{" end SetRightDigits( rPanel ) return 1 end @@ -65,6 +65,13 @@ function DigitsEvent(swFunction, where) elseif swValue == 48 then qi = false ; swValue = 47 end end + if qi then + if where == "L" then + swValue = 36 -- last lap time + else + swValue = 48 -- last sector + end + end local NotQI = qi == false -- 1.speed [ rpm/gear ] @@ -77,7 +84,11 @@ function DigitsEvent(swFunction, where) -- 3.rpm/gear elseif swValue == 3 then - Output = GetString("rpm", where .. "l") .. ":" .. GetString("gear", where .. "r") + if where == "R" then + Output = GetString("rpm", where .. "l") .. ":" .. GetString("gear", where .. "r") + else + Output = GetString("gear", where .. "r") .. ":" .. GetString("rpm", where .. "l") + end -- 4.position/speed elseif swValue == 4 then @@ -142,57 +153,57 @@ function DigitsEvent(swFunction, where) -- 17.wheels temp L/R FRONT [ L/R REAR ] elseif swValue == 17 then if NotQI then - Output = GetString("wtfl", where .. "l") .. lr .. GetString("wtfr", where .. "r") + Output = GetString("wtfl", where .. "l") .. "." .. GetString("wtfr", where .. "r") else - Output = GetString("wtrl", where .. "l") .. lr .. GetString("wtrr", where .. "r") + Output = GetString("wtrl", where .. "l") .. "." .. GetString("wtrr", where .. "r") end - -- 18.wheels temp L/R FRONT [ wheels press L/R FRONT ] + -- 18.wheels temp L/R FRONT [ wheels press L/R FRONT"." elseif swValue == 18 then if NotQI then - Output = GetString("wtfl", where .. "l") .. lr .. GetString("wtfr", where .. "r") + Output = GetString("wtfl", where .. "l") .. "." .. GetString("wtfr", where .. "r") else - Output = GetString("wpfl", where .. "l") .. lr .. GetString("wpfr", where .. "r") + Output = GetString("wpfl", where .. "l") .. "." .. GetString("wpfr", where .. "r") end - -- 19.wheels temp L/R REAR [ wheels press L/R REAR ] + -- 19.wheels temp L/R REAR [ wheels press L/R REAR ]"." elseif swValue == 19 then if NotQI then - Output = GetString("wtrl", where .. "l") .. lr .. GetString("wtrr", where .. "r") + Output = GetString("wtrl", where .. "l") .. "." .. GetString("wtrr", where .. "r") else - Output = GetString("wprl", where .. "l") .. lr .. GetString("wprr", where .. "r") + Output = GetString("wprl", where .. "l") .. "." .. GetString("wprr", where .. "r") end -- 20.wheels/brake temp left FRONT [ REAR ] elseif swValue == 20 then if NotQI then - Output = GetString("wtfl", where .. "l") .. lr .. GetString("btfl", where .. "r") + Output = GetString("wtfl", where .. "l") .. "." .. GetString("btfl", where .. "r") else - Output = GetString("wtrl", where .. "l") .. lr .. GetString("btrl", where .. "r") + Output = GetString("wtrl", where .. "l") .. "." .. GetString("btrl", where .. "r") end -- 21.brake/wheels temp right FRONT [ REAR ] elseif swValue == 21 then if NotQI then - Output = GetString("btfr", where .. "l") .. lr .. GetString("wtfr", where .. "r") + Output = GetString("btfr", where .. "l") .. "." .. GetString("wtfr", where .. "r") else - Output = GetString("btrr", where .. "l") .. lr .. GetString("wtrr", where .. "r") + Output = GetString("btrr", where .. "l") .. "." .. GetString("wtrr", where .. "r") end -- 22.wheels temp FL/ press FL [ RL/RL ] elseif swValue == 22 then if NotQI then - Output = GetString("wtfl", where .. "l") .. lr .. GetString("wpfl", where .. "r") + Output = GetString("wtfl", where .. "l") .. "." .. GetString("wpfl", where .. "r") else - Output = GetString("wtrl", where .. "l") .. lr .. GetString("wprl", where .. "r") + Output = GetString("wtrl", where .. "l") .. "." .. GetString("wprl", where .. "r") end -- 23.wheels press FR/ temp FR [ RR/RR ] elseif swValue == 23 then if NotQI then - Output = GetString("wpfr", where .. "l") .. lr .. GetString("wtfr", where .. "r") + Output = GetString("wpfr", where .. "l") .. "." .. GetString("wtfr", where .. "r") else - Output = GetString("wprr", where .. "l") .. lr .. GetString("wtrr", where .. "r") + Output = GetString("wprr", where .. "l") .. "." .. GetString("wtrr", where .. "r") end -- 24.wheels press FL [ RL ] @@ -214,9 +225,9 @@ function DigitsEvent(swFunction, where) -- 26.wheels press L/R FRONT [ L/R REAR ] elseif swValue == 26 then if NotQI then - Output = GetString("wpfl", where .. "l") .. lr .. GetString("wpfr", where .. "r") + Output = GetString("wpfl", where .. "l") .. "." .. GetString("wpfr", where .. "r") else - Output = GetString("wprl", where .. "l") .. lr .. GetString("wprr", where .. "r") + Output = GetString("wprl", where .. "l") .. "." .. GetString("wprr", where .. "r") end -- 27.brakes temp FL [ RL ] @@ -238,9 +249,9 @@ function DigitsEvent(swFunction, where) -- 29.brakes temp L/R FRONT [ L/R REAR ] elseif swValue == 29 then if NotQI then - Output = GetString("btfl", where .. "l") .. lr .. GetString("btfr", where .. "r") + Output = GetString("btfl", where .. "l") .. "." .. GetString("btfr", where .. "r") else - Output = GetString("btrl", where .. "l") .. lr .. GetString("btrr", where .. "r") + Output = GetString("btrl", where .. "l") .. "." .. GetString("btrr", where .. "r") end -- 30.track percent [ track size ] @@ -253,7 +264,7 @@ function DigitsEvent(swFunction, where) -- 31.total distance elseif swValue == 31 then - Output = GetString("distance", where) + Output = GetString("trip", where) -- 32.kers elseif swValue == 32 then @@ -301,24 +312,47 @@ function DigitsEvent(swFunction, where) -- 41.last lap time [ last sector ] elseif swValue == 41 then + Output = GetTimeString("lastlaptime", where) -- 42.last lap time + sector splits [ last sector ] elseif swValue == 42 then + if displaysectorsplit == false then + Output = GetTimeString("lastlaptime", where) + else + Output = GetTimeString("lastsectorsplitVSbest", where) + end -- 43.real time diff vs best [ bestlap time ] elseif swValue == 43 then + Output = GetTimeString("realdiffbest", where) -- 44.real time diff vs best + best sector split [ best sector time ] elseif swValue == 44 then + if displaysectorsplit == false then + Output = GetTimeString("realdiffbest", where) + else + Output = GetTimeString("lastsectorsplitVSbest", where) + end -- 45.real time diff vs best + bestlap sector split [ bestlap sector time ] elseif swValue == 45 then + if displaysectorsplit == false then + Output = GetTimeString("realdiffbest", where) + else + Output = GetTimeString("lastsectorsplitVSbestlap", where) + end -- 46.real time diff vs last [ last lap time ] elseif swValue == 46 then + Output = GetTimeString("realdifflast", where) -- 47.real time diff vs last + sector split [ last sector time ] elseif swValue == 47 then + if displaysectorsplit == false then + Output = GetTimeString("realdifflast", where) + else + Output = GetTimeString("lastsectorsplitVSlast", where) + end -- 48.last sector time [ last sector best time ] elseif swValue == 48 then @@ -326,10 +360,11 @@ function DigitsEvent(swFunction, where) -- 49.sector split [ last sector time ] elseif swValue == 49 then + Output = GetTimeString("lastsectorsplitVSlast", where) -- 50.last sector best time elseif swValue == 50 then - Output = GetTimeString("lastsectorbest", where) + Output = GetTimeString("bestsector", where) -- 51.best sector split [ best sector time ] elseif swValue == 51 then @@ -354,17 +389,17 @@ function DigitsEvent(swFunction, where) -- 56.PIT elseif swValue == 56 then if GetContextInfo("inpits") then - Output = " Pits " + Output = "{Pits}" else - Output = " " + Output = "{ }" end -- 57.Safety Car elseif swValue == 57 then if GetContextInfo("safetycar") then - Output = "Safety" + Output = "[SafE]" else - Output = " " + Output = "[ ]" end end -- cgit v1.2.3