mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Changed the code to support Moose Color Enumeration
This commit is contained in:
parent
824431ae94
commit
473735dcd7
@ -327,31 +327,24 @@ do -- TASK_CARGO
|
|||||||
self:__RouteToDeploy( 1.0, DeployZone )
|
self:__RouteToDeploy( 1.0, DeployZone )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- ¤TASL_CARGP
|
--- ¤TASK_CARGO
|
||||||
--@return SmokeCole
|
--@return SmokeColor
|
||||||
function TASK_CARGO:GetSmokeColor ()
|
function TASK_CARGO:GetSmokeColor ()
|
||||||
return self.SmokeColor
|
return self.SmokeColor
|
||||||
end
|
end
|
||||||
|
|
||||||
---#TASK_CARGO
|
---#TASK_CARGO
|
||||||
--@param Color Might be Blue, Red or Green
|
--@param Color Might be Blue, Red or Green
|
||||||
function TASK_CARGO:SetSmokeColor(Color)
|
function TASK_CARGO:SetSmokeColor(SmokeColor)
|
||||||
-- Makes sure Coloe is set
|
-- Makes sure Coloe is set
|
||||||
if Color == nil then
|
if SmokeColor == nil then
|
||||||
Color = "Red" -- Make sure a default color is exist
|
self:F2(SmokeColor)
|
||||||
else
|
self.SmokeColor = SMOKECOLOR.Red -- Make sure a default color is exist
|
||||||
local ValidColors = {"Red", "Blue", "Green"}
|
elseif type(SmokeColor) == "number" then
|
||||||
for index,value in ipairs (ValidColors) do
|
if SmokeColor > 0 and SmokeColor <=5 then -- Make sure number is within ragne, assuming first enum is one
|
||||||
if value == Color then
|
self.SmokeColor = SMOKECOLOR.SmokeColor
|
||||||
self.SmokeColor = value
|
|
||||||
break
|
|
||||||
end
|
|
||||||
-- Color is invalid, set it green as signal
|
|
||||||
self.SmokeColor = "Green"
|
|
||||||
BASE:E("Invalid color is set using GREEN")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.SmokeColor = Color
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user