Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onSave()
- local data_to_save = {
- ["SarweenToolsState"]=SarweenTools,
- ["MuaatWarSunState"]=MuaatWarSun,
- ["RegulatedConscriptionState"]=RegulatedConscription
- }
- saved_data = JSON.encode(data_to_save)
- --print(tostring(saved_data).." is saved data.")
- return saved_data
- end
- function onload(saved_data)
- --print(tostring(saved_data).." is saved data.")
- if string.find(self.getName(), "1") then
- CountingArea = getObjectFromGUID('7666f1')
- ShipBag = getObjectFromGUID('b5edda')
- end
- if string.find(self.getName(), "2") then
- CountingArea = getObjectFromGUID('1282f2')
- ShipBag = getObjectFromGUID('57f5ec')
- end
- if string.find(self.getName(), "3") then
- CountingArea = getObjectFromGUID('669da8')
- ShipBag = getObjectFromGUID('62980e')
- end
- if string.find(self.getName(), "4") then
- CountingArea = getObjectFromGUID('a8965e')
- ShipBag = getObjectFromGUID('b26a33')
- end
- if string.find(self.getName(), "5") then
- CountingArea = getObjectFromGUID('c9944a')
- ShipBag = getObjectFromGUID('38beb1')
- end
- if string.find(self.getName(), "6") then
- CountingArea = getObjectFromGUID('750ef2')
- ShipBag = getObjectFromGUID('b306be')
- end
- --ShipBag.interactable = false
- ColorButtonsExist = 0
- -----------------------
- ShipTable = {}
- BloccTable = {}
- CreateShipObjects()
- SpawnShipCubes()
- Timer.create({identifier = "LockBloccs"..self.getGUID(), function_name = 'LoccBloccs', delay = 1.3})
- SarweenTools = false
- RegulatedConscription = false
- MuaatWarSun = false
- PassedColor = nil
- ColorSwitch = false
- ButtonHeight = 0.6
- EvaluateSwitch = false
- self.createButton({
- label=ShipCost, click_function='Nada', function_owner=self,
- position={-10,ButtonHeight,-1.455}, height=500, width=1300, font_size=400, alignment=2
- })
- self.createButton({
- label="Resource Cost", click_function='Nada', function_owner=self,
- position={-13.5,ButtonHeight,-1.455}, height=500, width=2200, font_size=300, alignment=2
- })
- self.createButton({
- label="ProdNum", click_function='Nada', function_owner=self,
- position={-10,ButtonHeight,-0.255}, height=500, width=1300, font_size=400, alignment=2
- })
- self.createButton({
- label="Production", click_function='Nada', function_owner=self,
- position={-13.5,ButtonHeight,-0.255}, height=500, width=2200, font_size=300, alignment=2
- })
- self.createButton({
- label="Sarween Off", click_function='ToggleSarween', function_owner=self,
- position={-13,ButtonHeight+0.1,0.4}, height=200, width=600, font_size=100, alignment=2
- })
- self.createButton({
- label="Regulated Conscription Off", click_function='ToggleRegulatedConscription', function_owner=self,
- position={-13,ButtonHeight+0.1,0.8}, height=200, width=600, font_size=40, alignment=2
- })
- self.createButton({
- label="Muaat Upgraded War Sun Off", click_function='ToggleMuaatWarSun', function_owner=self,
- position={-13,ButtonHeight+0.1,1.2}, height=200, width=600, font_size=40, alignment=2
- })
- self.createButton({
- label="Recolour", click_function='SpawnColorButtons', function_owner=self,
- position={-15,ButtonHeight+0.1,0.4}, height=200, width=600, font_size=100, alignment=2
- })
- SortSelfOut()
- Timer.create({identifier = "EvalShips"..self.getGUID(), function_name = 'EvaluateShips', delay = 0.1})
- if saved_data ~= nil and saved_data ~= "" then
- loaded_data = JSON.decode(saved_data)
- --print(tostring(loaded_data.MuaatWarSunState).." is MuaatWarSunState.")
- if loaded_data.MuaatWarSunState then
- ToggleMuaatWarSun()
- end
- if loaded_data.RegulatedConscriptionState then
- ToggleRegulatedConscription()
- end
- if loaded_data.SarweenToolsState then
- ToggleSarween()
- end
- end
- end
- function onDestroy()
- for i,j in pairs(BloccTable) do
- destroyObject(j)
- end
- local DestroyThese = CountingArea.getObjects()
- for i,j in pairs(DestroyThese ) do
- destroyObject(j)
- end
- end
- function ToggleMuaatWarSun()
- MuaatWarSun = not MuaatWarSun
- if MuaatWarSun == true then
- self.editButton({index = 6, label = "Muaat Upgraded War Sun On", color = {0.2,0.8,0.2}})
- warsun.Cost = 10
- else
- self.editButton({index = 6, label = "Muaat Upgraded War Sun Off", color = {0.05, 0.05, 0.05}})
- warsun.Cost = 12
- end
- EvaluateShips()
- end
- function update()
- if EvaluateSwitch == true then
- EvaluateShips()
- EvaluateSwitch = false
- --print ("Evaluated ships from switch.")
- end
- if ColorSwitch == true then
- ChangeMyColor(PassedColor)
- ColorSwitch = false
- end
- end
- function ToggleRegulatedConscription()
- RegulatedConscription = not RegulatedConscription
- if RegulatedConscription == true then
- self.editButton({index = 5, label = "Regulated Conscription On", color = {0.2,0.8,0.2}})
- fighter.Cost = 1
- infantry.Cost = 1
- else
- self.editButton({index = 5, label = "Regulated Conscription Off", color = {0.2,0.8,0.2}})
- fighter.Cost = 0.5
- infantry.Cost = 0.5
- end
- EvaluateShips()
- end
- function ToggleRegulatedConscription()
- RegulatedConscription = not RegulatedConscription
- if RegulatedConscription == true then
- self.editButton({index = 5, label = "Regulated Conscription On", color = {0.2,0.8,0.2}})
- fighter.Cost = 1
- infantry.Cost = 1
- else
- self.editButton({index = 5, label = "Regulated Conscription Off", color = {0.05, 0.05, 0.05}})
- fighter.Cost = 0.5
- infantry.Cost = 0.5
- end
- EvaluateShips()
- end
- function ToggleSarween()
- SarweenTools = not SarweenTools
- if SarweenTools == true then
- self.editButton({index = 4, label = "Sarween On", color = {0.2,0.8,0.2}})
- else
- self.editButton({index = 4, label = "Sarween Off", color = {0.05, 0.05, 0.05}})
- end
- EvaluateShips()
- end
- function SortSelfOut()
- for i=0,7,1 do
- self.editButton({index = i, font_color = ShipBag.getColorTint(), color = {0.05, 0.05, 0.05}})
- end
- -- self.removeButton(5)
- -- self.removeButton(6)
- self.setColorTint({0,0,0})
- end
- function SetBloccColor(blocc)
- blocc.editButton({index = 0, font_color = ShipBag.getColorTint()})
- blocc.editButton({index = 1, font_color = ShipBag.getColorTint()})
- blocc.editButton({index = 2, font_color = ShipBag.getColorTint()})
- blocc.editButton({index = 3, font_color = ShipBag.getColorTint()})
- blocc.setColorTint({0,0,0})
- end
- function EvaluateShips(extra)
- local TC = 0
- if SarweenTools == true then
- TC = -1
- end
- local TotalShips = 0
- local ShipsToEvaluate = FindShipsInCountingArea()
- --print("ShipsToEvaluate is length "..#ShipsToEvaluate)
- if extra ~= nil then
- table.insert(ShipsToEvaluate, extra)
- end
- for i, j in pairs(ShipsToEvaluate) do
- if IdentifyShip(j) ~= nil then
- --print(IdentifyShip(j).Name.." is what IdentifyShip returned.")
- TC = TC + IdentifyShip(j).Cost
- TotalShips = TotalShips + 1
- end
- end
- self.editButton({index = 0, label = tostring(TC)})
- self.editButton({index = 2, label = tostring(TotalShips)})
- end
- function onObjectDestroyed(obj)
- --print("Object destroyed, evaluating...")
- if HasShipName(obj) then
- --print("HasShipName true.")
- if HasMyShipbagColorTint(obj) then
- --print("HasMyShipbagColorTint true.")
- Timer.create({identifier = tostring(math.random(1,9999999)..self.getGUID()), function_name = 'EvaluateShips', delay = 0.1})
- end
- end
- end
- function HasShipName(j)
- if
- string.find(j.getName(), "Destroyer") or
- string.find(j.getName(), "Cruiser") or
- string.find(j.getName(), "Dreadnought") or
- string.find(j.getName(), "Carrier") or
- string.find(j.getName(), "Fighter") or
- string.find(j.getName(), "Infantry") or
- string.find(j.getName(), "Flagship") or
- string.find(j.getName(), "War Sun")
- then return true
- else
- return false
- end
- end
- function HasMyShipbagColorTint(obj)
- --print(obj.getColorTint()[1])
- --print(ShipBag.getColorTint()[1])
- --print(obj.getColorTint()[2])
- --print(ShipBag.getColorTint()[2])
- if
- math.floor(obj.getColorTint()[1]*100) == math.floor(ShipBag.getColorTint()[1]*100) and
- math.floor(obj.getColorTint()[2]*100) == math.floor(ShipBag.getColorTint()[2]*100) and
- math.floor(obj.getColorTint()[3]*100) == math.floor(ShipBag.getColorTint()[3]*100)
- then return true
- else
- return false
- end
- end
- --function onObjectEnterScriptingZone(zone, obj)
- --print("Evaluating as zone was entered.")
- -- if zone == CountingArea then
- -- EvaluateShips(obj)
- -- end
- --end
- function onObjectLeaveScriptingZone(zone, obj)
- --print("Evaluating as zone was left.")
- if zone == CountingArea then
- EvaluateShips()
- end
- end
- function IdentifyShip(ShipTTSObject)
- --print("Identified "..ShipTTSObject.getName())
- for v = 1, 8, 1 do
- if string.find(ShipTTSObject.getName(), ShipTable[v].Name) then
- --print("Returning ShipTable[v]")
- return ShipTable[v]
- end
- end
- end
- function FindShipsInCountingArea()
- local ShipsInArea = {}
- for i, j in pairs(CountingArea.getObjects()) do
- if
- string.find(j.getName(), "Destroyer") or
- string.find(j.getName(), "Cruiser") or
- string.find(j.getName(), "Dreadnought") or
- string.find(j.getName(), "Carrier") or
- string.find(j.getName(), "Fighter") or
- string.find(j.getName(), "Infantry") or
- string.find(j.getName(), "Flagship") or
- string.find(j.getName(), "War Sun")
- then
- table.insert(ShipsInArea, j)
- end
- end
- return ShipsInArea
- end
- function Nada()
- end
- function SpawnShipCubes()
- BloccParams = {}
- BloccParams.type = 'Custom_Model'
- BloccParams.callback_owner = self
- BloccParams.mesh = 'https://pastebin.com/Q5ZH0cS2'
- BloccParams.diffuse = nil
- BloccParams.position = s
- BloccParams.normal = nil
- BloccParams.collider = 'https://pastebin.com/7iRf6cWE'
- BloccParams.material = 1
- BloccParams.scale = {0.7, 0.7, 0.7}
- BloccParams.sound = false
- for i, j in pairs(ShipTable) do
- SetSpawnPosition(i)
- Blocc = spawnObject(BloccParams)
- table.insert(BloccTable,Blocc)
- Blocc.setCustomObject(BloccParams)
- Blocc.setDescription(j.Name)
- Blocc.setLuaScript([[
- function Nada()
- end
- function onload()
- SettedUp = false
- SeppukuPassed = false
- Timer.create({identifier = 'Seppuku:'..self.getGUID(), function_name = 'Seppuku', delay = 0.1})
- Timer.create({identifier = 'ShipUpdate'..self.getGUID(), function_name='UpdateShipNumber', delay = 0.2})
- end
- function Seppuku()
- if MySpawner == nil then
- self.Destruct()
- else
- SeppukuPassed = true
- end
- end
- function onSave()
- end
- function update()
- if SpawnTrigger == true then
- --print("SpawnTrigger is true for me, "..self.getDescription())
- SetUp()
- SpawnTrigger = false
- end
- end
- function SetUp()
- --print(self.getDescription().." is setting up!")
- ShipTable = {}
- MyShip = nil
- CreateShipObjects()
- AssignMyShipName()
- CreateShipButtons()
- SettedUp = true
- end
- function CreateShipButtons()
- local Pos = {0, 0.1, -0.05}
- local QuantPos = Pos
- QuantPos = {QuantPos[1], QuantPos[2], QuantPos[3] + 1}
- local PlusPos = Pos
- PlusPos = {PlusPos[1]+1, PlusPos[2], PlusPos[3] + 1}
- local NegPos = Pos
- NegPos = {NegPos[1]-1, NegPos[2], NegPos[3] + 1}
- ButtonHeight = 520
- ButtonWidth = 520
- ButtonColour = {0.05, 0.05, 0.05}
- self.createButton({
- label=MyShip.Name, click_function='Nada', function_owner=self,
- position=Pos, height=550, width=1500, font_size=250, alignment=2, color = ButtonColour
- })
- self.createButton({
- label="x", click_function='Nada', function_owner=self,
- position=QuantPos, height=ButtonHeight, width=ButtonWidth, font_size=170, alignment=2, color = ButtonColour
- })
- --this should pull a relevant ship from the bag into the counting area
- self.createButton({
- label="+", click_function='TakeShipFromBag', function_owner=self,
- position=PlusPos, height=ButtonHeight, width=ButtonWidth, font_size=300, alignment=2, color = ButtonColour
- })
- --this should put a relevant ship out in the counting area back in the bag
- self.createButton({
- label="-", click_function='PutShipAway', function_owner=self,
- position=NegPos, height=ButtonHeight, width=ButtonWidth, font_size=300, alignment=2, color = ButtonColour
- })
- end
- function AssignMyShipName()
- for i,j in ipairs(ShipTable) do
- if j.Name == self.getDescription() then
- MyShip = j
- --print("Assigned "..MyShip.Name.." to self.")
- end
- end
- end
- function NewShip(N, C, L)
- local Ship = {}
- Ship.Name = N
- Ship.Cost = C
- Ship.Limit = L
- table.insert(ShipTable, Ship)
- return Ship
- end
- function CreateShipObjects()
- -- eventually expand this to include model file references etc
- destroyer = NewShip("Destroyer", 1, 8)
- cruiser = NewShip("Cruiser", 2, 8)
- warsun = NewShip("War Sun", 12, 2)
- infantry = NewShip("Infantry", 0.5, 12)
- fighter = NewShip("Fighter", 0.5, 10)
- carrier = NewShip("Carrier", 3, 4)
- dreadnought = NewShip("Dreadnought", 4, 5)
- flagship = NewShip("Flagship", 8, 1)
- end
- function UpdateShipNumber()
- if SeppukuPassed == true then
- local n = 0
- for i, j in pairs(ShipBag.getObjects()) do
- if string.find(j.name, MyShip.Name) then
- n = n+1
- end
- -- j.setColorTint(ShipBag.getColorTint())
- end
- self.editButton({index=1, label = tostring(n.."/"..MyShip.Limit)})
- MySpawner.setVar("EvaluateSwitch", true)
- end
- end
- function TakeShipFromBag()
- local ShipFound = false
- for i, j in pairs(ShipBag.getObjects()) do
- if string.find(j.name, MyShip.Name) and ShipFound == false then
- params = {}
- params.guid = j.guid
- params.position = NewShipPosition()
- ShipBag.takeObject(params)
- ShipFound = true
- end
- end
- UpdateShipNumber()
- end
- function NewShipPosition()
- local length = #FindShipsInCountingArea()
- local SpawnOffset = {-3, 1, -4}
- local x = MySpawner.getPosition()[1] + SpawnOffset[1] + 2*((length-2)%2)
- local y = MySpawner.getPosition()[2] + SpawnOffset[2]
- local z = MySpawner.getPosition()[3] + SpawnOffset[3] + 1.3*math.floor(length/2)
- return {x, y, z}
- end
- function PutShipAway()
- local ShipFound = false
- ShipsInCountingArea = CountingArea.getObjects()
- for i, j in pairs(ShipsInCountingArea) do
- if string.find(j.getName(), MyShip.Name) and ShipFound == false then
- ShipBag.putObject(j)
- j.destruct()
- ShipFound = true
- end
- end
- UpdateShipNumber()
- end
- function FindShipsInCountingArea()
- local ShipsInArea = {}
- for i, j in pairs(CountingArea.getObjects()) do
- if
- string.find(j.getName(), "Destroyer") or
- string.find(j.getName(), "Cruiser") or
- string.find(j.getName(), "Dreadnought") or
- string.find(j.getName(), "Carrier") or
- string.find(j.getName(), "Fighter") or
- string.find(j.getName(), "Infantry") or
- string.find(j.getName(), "Flagship") or
- string.find(j.getName(), "War Sun")
- then
- table.insert(ShipsInArea, j)
- end
- end
- return ShipsInArea
- end
- function onObjectDestroyed(obj)
- --print("Object destroyed, evaluating...")
- if SeppukuPassed == true then
- if HasShipName(obj) then
- if HasMyShipbagColorTint(obj) then
- UpdateShipNumber()
- end
- end
- end
- end
- function HasShipName(j)
- if
- string.find(j.getName(), "Destroyer") or
- string.find(j.getName(), "Cruiser") or
- string.find(j.getName(), "Dreadnought") or
- string.find(j.getName(), "Carrier") or
- string.find(j.getName(), "Fighter") or
- string.find(j.getName(), "Infantry") or
- string.find(j.getName(), "Flagship") or
- string.find(j.getName(), "War Sun")
- then return true
- else
- return false
- end
- end
- function HasMyShipbagColorTint(obj)
- if
- math.floor(obj.getColorTint()[1]*100) == math.floor(ShipBag.getColorTint()[1]*100) and
- math.floor(obj.getColorTint()[2]*100) == math.floor(ShipBag.getColorTint()[2]*100) and
- math.floor(obj.getColorTint()[3]*100) == math.floor(ShipBag.getColorTint()[3]*100)
- then return true
- else
- return false
- end
- end
- function onObjectEnterScriptingZone(zone, obj)
- if zone == CountingArea then
- UpdateShipNumber()
- --obj.setColorTint(ShipBag.getColorTint())
- end
- end
- ]])
- Blocc.setVar("MySpawner", self)
- Blocc.setVar("CountingArea", CountingArea)
- Blocc.setVar("ShipBag", ShipBag)
- Blocc.setVar("SpawnTrigger", true)
- Timer.create({identifier = 'BloccColorTimer:'..i..self.getGUID(), function_name = 'SetAllBloccColors', delay = 0.1})
- --Blocc.lock()
- end
- end
- function SetAllBloccColors()
- for i,j in pairs(BloccTable) do
- SetBloccColor(j)
- end
- end
- function LoccBloccs()
- for i,j in pairs(BloccTable) do
- j.lock()
- end
- end
- function SetSpawnPosition(v)
- s = self.getPosition()
- s = {s[1]+1.7, s[2]+0.35, s[3]-11.51+2.572*v}
- BloccParams.position = s
- BloccParams.rotation = {0, 90, 0}
- return s
- end
- function NewShip(N, C, L)
- local Ship = {}
- Ship.Name = N
- Ship.Cost = C
- Ship.Limit = L
- table.insert(ShipTable, Ship)
- return Ship
- end
- function CreateShipObjects()
- -- eventually expand this to include model file references etc
- destroyer = NewShip("Destroyer", 1, 8)
- cruiser = NewShip("Cruiser", 2, 8)
- warsun = NewShip("War Sun", 12, 2)
- infantry = NewShip("Infantry", 0.5, 12)
- fighter = NewShip("Fighter", 0.5, 10)
- carrier = NewShip("Carrier", 3, 4)
- dreadnought = NewShip("Dreadnought", 4, 5)
- flagship = NewShip("Flagship", 8, 1)
- end
- function onObjectDrop(player_color, dropped_object)
- if dropped_object == self then
- Timer.create({identifier = 'BloccDropTimer:'..self.getGUID(), function_name = 'RepositionBloccs', delay = 1})
- end
- end
- function RepositionBloccs()
- for i,j in pairs(BloccTable) do
- j.setPosition(SetSpawnPosition(i))
- end
- end
- function ChangeMyColor(NewColor)
- --NewColor = self.getColorTint()
- SetColor = stringColorToRGB(NewColor)
- ShipBag.setColorTint(SetColor)
- local recolorthese = CountingArea.getObjects()
- for i,j in pairs(recolorthese) do
- if j.getName() == "Board" or j.getName() == "" then
- else
- j.setColorTint(SetColor)
- end
- end
- for i,j in pairs(BloccTable) do
- SetBloccColor(j)
- end
- SortSelfOut()
- RemoveColorButtons()
- end
- function onObjectEnterScriptingZone(zone, obj)
- if zone == CountingArea then
- if IdentifyShip(obj) ~= nil then
- obj.setColorTint(ShipBag.getColorTint())
- EvaluateShips()
- end
- if string.find("PDS Space Dock Command Sheet", obj.getName()) and obj.getName() ~= "" then
- obj.setColorTint(ShipBag.getColorTint())
- self.setColorTint({0,0,0})
- end
- end
- end
- function SpawnColorButtons()
- if ColorButtonsExist == 0 then
- local ColorXOffset = -15.5
- local ColorButtonOffset = 0.35
- local ColorButtonBeingCreated = 0
- local ColorButtonZOffset = 0.8
- local ColorButtonZOffset2ndRow = 1.2
- self.createButton({
- label="", click_function='SetRed', function_owner=self,
- position={ColorXOffset+(ColorButtonOffset*ColorButtonBeingCreated),ButtonHeight+0.1,ColorButtonZOffset}, height=200, width=200, font_size=400, alignment=2
- })
- ColorButtonBeingCreated = 1
- self.createButton({
- label="", click_function='SetOrange', function_owner=self,
- position={ColorXOffset+(ColorButtonOffset*ColorButtonBeingCreated),ButtonHeight+0.1,ColorButtonZOffset}, height=200, width=200, font_size=400, alignment=2
- })
- ColorButtonBeingCreated = 2
- self.createButton({
- label="", click_function='SetYellow', function_owner=self,
- position={ColorXOffset+(ColorButtonOffset*ColorButtonBeingCreated),ButtonHeight+0.1,ColorButtonZOffset}, height=200, width=200, font_size=400, alignment=2
- })
- ColorButtonBeingCreated = 3
- self.createButton({
- label="", click_function='SetGreen', function_owner=self,
- position={ColorXOffset+(ColorButtonOffset*ColorButtonBeingCreated),ButtonHeight+0.1,ColorButtonZOffset}, height=200, width=200, font_size=400, alignment=2
- })
- ColorButtonBeingCreated = 4
- self.createButton({
- label="", click_function='SetTeal', function_owner=self,
- position={ColorXOffset+(ColorButtonOffset*ColorButtonBeingCreated),ButtonHeight+0.1,ColorButtonZOffset}, height=200, width=200, font_size=400, alignment=2
- })
- ColorButtonBeingCreated = 0
- self.createButton({
- label="", click_function='SetBlue', function_owner=self,
- position={ColorXOffset+(ColorButtonOffset*ColorButtonBeingCreated),ButtonHeight+0.1,ColorButtonZOffset2ndRow}, height=200, width=200, font_size=400, alignment=2
- })
- ColorButtonBeingCreated = 1
- self.createButton({
- label="", click_function='SetPurple', function_owner=self,
- position={ColorXOffset+(ColorButtonOffset*ColorButtonBeingCreated),ButtonHeight+0.1,ColorButtonZOffset2ndRow}, height=200, width=200, font_size=400, alignment=2
- })
- ColorButtonBeingCreated = 2
- self.createButton({
- label="", click_function='SetPink', function_owner=self,
- position={ColorXOffset+(ColorButtonOffset*ColorButtonBeingCreated),ButtonHeight+0.1,ColorButtonZOffset2ndRow}, height=200, width=200, font_size=400, alignment=2
- })
- ColorButtonBeingCreated = 3
- self.createButton({
- label="", click_function='SetWhite', function_owner=self,
- position={ColorXOffset+(ColorButtonOffset*ColorButtonBeingCreated),ButtonHeight+0.1,ColorButtonZOffset2ndRow}, height=200, width=200, font_size=400, alignment=2
- })
- ColorButtonBeingCreated = 4
- self.createButton({
- label="", click_function='SetBrown', function_owner=self,
- position={ColorXOffset+(ColorButtonOffset*ColorButtonBeingCreated),ButtonHeight+0.1,ColorButtonZOffset2ndRow}, height=200, width=200, font_size=400, alignment=2
- })
- ColorButtonsExist = 1
- ColorColorButtons()
- else
- end
- end
- function SetRed()
- ChangeMyColor("Red")
- end
- function SetOrange()
- ChangeMyColor("Orange")
- end
- function SetYellow()
- ChangeMyColor("Yellow")
- end
- function SetGreen()
- ChangeMyColor("Green")
- end
- function SetTeal()
- ChangeMyColor("Teal")
- end
- function SetBlue()
- ChangeMyColor("Blue")
- end
- function SetPurple()
- ChangeMyColor("Purple")
- end
- function SetPink()
- ChangeMyColor("Pink")
- end
- function SetWhite()
- ChangeMyColor("White")
- end
- function SetBrown()
- ChangeMyColor("Brown")
- end
- function RemoveColorButtons()
- if ColorButtonsExist == 1 then do
- for v = 8,17,1 do
- self.removeButton(v)
- end
- end
- ColorButtonsExist = 0
- end
- end
- function ColorColorButtons()
- Colors = {"Red", "Orange", "Yellow", "Green", "Teal", "Blue", "Purple", "Pink", "White", "Brown"}
- local ThisOne = 1
- for v = 8,17,1 do
- self.editButton({index = v, color = stringColorToRGB(Colors[ThisOne])})
- ThisOne = ThisOne + 1
- end
- end
- function Nada()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement