Merge pull request #6786 from pchote/retire-code
Retire legacy Lua API and IRC code.
This commit is contained in:
@@ -1,70 +0,0 @@
|
||||
Container@SERVERBROWSER_IRC:
|
||||
Logic: IrcLogic
|
||||
Width: 700
|
||||
Height: 250
|
||||
Children:
|
||||
Container@IRC_CONTAINER:
|
||||
Width: PARENT_RIGHT
|
||||
Height: PARENT_BOTTOM
|
||||
Children:
|
||||
ScrollPanel@HISTORY_PANEL:
|
||||
Width: 565
|
||||
Height: PARENT_BOTTOM - 30
|
||||
ItemSpacing: 5
|
||||
Label@HISTORY_TEMPLATE:
|
||||
X: 5
|
||||
Width: 530
|
||||
Height: 25
|
||||
WordWrap: True
|
||||
TextField@INPUT_BOX:
|
||||
Y: PARENT_BOTTOM - 25
|
||||
Width: 565
|
||||
Height: 25
|
||||
ScrollPanel@NICKNAME_PANEL:
|
||||
X: 570
|
||||
Width: 130
|
||||
Height: PARENT_BOTTOM - 30
|
||||
Label@NICKNAME_TEMPLATE:
|
||||
X: 5
|
||||
Button@DISCONNECT_BUTTON:
|
||||
X: 570
|
||||
Y: PARENT_BOTTOM - 25
|
||||
Width: 130
|
||||
Height: 25
|
||||
Text: Disconnect
|
||||
Font: Bold
|
||||
Background@IRC_CONNECT_BG:
|
||||
Width: PARENT_RIGHT
|
||||
Height: PARENT_BOTTOM
|
||||
Background: scrollpanel-bg
|
||||
Children:
|
||||
Label@GLOBAL_CHAT_LABEL:
|
||||
Y: PARENT_BOTTOM / 4
|
||||
Width: PARENT_RIGHT
|
||||
Align: Center
|
||||
Text: Global Chat
|
||||
Font: Bold
|
||||
Label@NICKNAME_LABEL:
|
||||
X: 200
|
||||
Y: PARENT_BOTTOM / 4 + 35
|
||||
Text: Nickname:
|
||||
TextField@NICKNAME_BOX:
|
||||
X: 270
|
||||
Y: PARENT_BOTTOM / 4 + 25
|
||||
Width: 150
|
||||
Height: 25
|
||||
Checkbox@CONNECT_AUTOMATICALLY_CHECKBOX:
|
||||
X: 270
|
||||
Y: PARENT_BOTTOM / 4 + 75
|
||||
Height: 20
|
||||
Width: 180
|
||||
Font: Regular
|
||||
Text: Connect Automatically
|
||||
Button@CONNECT_BUTTON:
|
||||
X: 430
|
||||
Y: PARENT_BOTTOM / 4 + 25
|
||||
Width: 100
|
||||
Height: 25
|
||||
Text: Connect
|
||||
Font: Bold
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
MissionAccomplished = function()
|
||||
Mission.MissionOver({ player }, nil, true)
|
||||
Media.PlayMovieFullscreen("bombaway.vqa")
|
||||
end
|
||||
|
||||
MissionFailed = function()
|
||||
Mission.MissionOver(nil, { player }, true)
|
||||
Media.PlayMovieFullscreen("gameover.vqa")
|
||||
end
|
||||
|
||||
AttackPlayer = function()
|
||||
if not Actor.IsDead(NodBarracks) then
|
||||
Production.BuildWithPerFactoryQueue(NodBarracks, "e1", 5)
|
||||
attackSquad = Team.New(Map.FindUnitsInCircle(enemy, NodBarracks, 3))
|
||||
Team.Do(attackSquad, function(unit)
|
||||
Actor.AttackMove(unit, waypoint9.location)
|
||||
Actor.Hunt(unit)
|
||||
end)
|
||||
Team.AddEventHandler(attackSquad.OnAllKilled, OpenRA.RunAfterDelay(Utils.Seconds(15), AttackPlayer))
|
||||
end
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
player = OpenRA.GetPlayer("GDI")
|
||||
enemy = OpenRA.GetPlayer("Nod")
|
||||
|
||||
Media.PlayMovieFullscreen("samdie.vqa")
|
||||
|
||||
samSites = Team.New({ Sam1, Sam2, Sam3, Sam4 })
|
||||
Team.AddEventHandler(samSites.OnAllKilled, function() Actor.Create("PowerProxy.AirSupport", { Owner = player }) end)
|
||||
OpenRA.RunAfterDelay(Utils.Seconds(15), AttackPlayer)
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
if Mission.RequiredUnitsAreDestroyed(player) then
|
||||
MissionFailed()
|
||||
end
|
||||
if Mission.RequiredUnitsAreDestroyed(enemy) then
|
||||
MissionAccomplished()
|
||||
end
|
||||
end
|
||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 50 KiB |
File diff suppressed because it is too large
Load Diff
@@ -103,7 +103,6 @@ ChromeLayout:
|
||||
./mods/cnc/chrome/credits.yaml
|
||||
./mods/cnc/chrome/dialogs.yaml
|
||||
./mods/cnc/chrome/tooltips.yaml
|
||||
./mods/cnc/chrome/irc.yaml
|
||||
./mods/cnc/chrome/assetbrowser.yaml
|
||||
./mods/cnc/chrome/missionbrowser.yaml
|
||||
|
||||
@@ -172,28 +171,28 @@ ChromeMetrics:
|
||||
|
||||
Fonts:
|
||||
Small:
|
||||
Font:./FreeSans.ttf
|
||||
Font:./mods/common/FreeSans.ttf
|
||||
Size:12
|
||||
Regular:
|
||||
Font:./FreeSans.ttf
|
||||
Font:./mods/common/FreeSans.ttf
|
||||
Size:14
|
||||
Bold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:14
|
||||
Title:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:32
|
||||
MediumBold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:18
|
||||
BigBold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:24
|
||||
Tiny:
|
||||
Font:./FreeSans.ttf
|
||||
Font:./mods/common/FreeSans.ttf
|
||||
Size:10
|
||||
TinyBold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:10
|
||||
|
||||
LuaScripts:
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
CloakSound: trans1.aud
|
||||
UncloakSound: trans1.aud
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
GainsStatUpgrades:
|
||||
SelfHealing@ELITE:
|
||||
@@ -96,7 +95,6 @@
|
||||
CloakSound: trans1.aud
|
||||
UncloakSound: trans1.aud
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
GainsStatUpgrades:
|
||||
SelfHealing@ELITE:
|
||||
@@ -135,7 +133,6 @@
|
||||
BodyOrientation:
|
||||
UpdatesPlayerStatistics:
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
Tooltip:
|
||||
GenericName: Helicopter
|
||||
@@ -210,7 +207,6 @@
|
||||
Prerequisites: hosp
|
||||
UpdatesPlayerStatistics:
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
DetectCloaked:
|
||||
Range: 1
|
||||
ScriptTriggers:
|
||||
@@ -307,7 +303,6 @@
|
||||
AttackFrontal:
|
||||
UpdatesPlayerStatistics:
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
DeathSounds:
|
||||
|
||||
@@ -328,7 +323,6 @@
|
||||
BodyOrientation:
|
||||
Huntable:
|
||||
AttackMove:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
GainsStatUpgrades:
|
||||
SelfHealing@ELITE:
|
||||
@@ -362,7 +356,6 @@
|
||||
BodyOrientation:
|
||||
UpdatesPlayerStatistics:
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
GainsStatUpgrades:
|
||||
SelfHealing@ELITE:
|
||||
@@ -414,7 +407,6 @@
|
||||
FrozenUnderFog:
|
||||
UpdatesPlayerStatistics:
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
Demolishable:
|
||||
ScriptTriggers:
|
||||
WithMakeAnimation:
|
||||
@@ -459,7 +451,6 @@
|
||||
BodyOrientation:
|
||||
FrozenUnderFog:
|
||||
StartsRevealed: true
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
WithMakeAnimation:
|
||||
|
||||
@@ -505,7 +496,6 @@
|
||||
Palette: terrain
|
||||
FrozenUnderFog:
|
||||
StartsRevealed: true
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
WithMakeAnimation:
|
||||
|
||||
@@ -539,7 +529,6 @@
|
||||
Guardable:
|
||||
BodyOrientation:
|
||||
FrozenUnderFog:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
|
||||
^Tree:
|
||||
@@ -564,7 +553,6 @@
|
||||
BodyOrientation:
|
||||
FrozenUnderFog:
|
||||
StartsRevealed: true
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
WithMakeAnimation:
|
||||
|
||||
@@ -583,7 +571,6 @@
|
||||
BodyOrientation:
|
||||
FrozenUnderFog:
|
||||
StartsRevealed: true
|
||||
LuaScriptEvents:
|
||||
WithMakeAnimation:
|
||||
|
||||
^Rock:
|
||||
@@ -602,7 +589,6 @@
|
||||
BodyOrientation:
|
||||
FrozenUnderFog:
|
||||
StartsRevealed: true
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
WithMakeAnimation:
|
||||
|
||||
@@ -630,7 +616,6 @@
|
||||
BodyOrientation:
|
||||
Tooltip:
|
||||
GenericName: Destroyed Vehicle
|
||||
LuaScriptEvents:
|
||||
DisabledOverlay:
|
||||
ScriptTriggers:
|
||||
|
||||
@@ -660,6 +645,5 @@
|
||||
DamagedSound: xplos.aud
|
||||
DestroyedSound: xplobig4.aud
|
||||
BodyOrientation:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
|
||||
|
||||
BIN
mods/common/FreeSans.ttf
Normal file
BIN
mods/common/FreeSans.ttf
Normal file
Binary file not shown.
BIN
mods/common/FreeSansBold.ttf
Normal file
BIN
mods/common/FreeSansBold.ttf
Normal file
Binary file not shown.
@@ -1,236 +0,0 @@
|
||||
Actor = { }
|
||||
|
||||
Actor.Create = function(name, init)
|
||||
if name == nil then error("No actor name specified", 2) end
|
||||
if init.Owner == nil then error("No actor owner specified", 2) end
|
||||
local td = OpenRA.New("TypeDictionary")
|
||||
local addToWorld = true
|
||||
for key, value in pairs(init) do
|
||||
if key == "AddToWorld" then
|
||||
addToWorld = value
|
||||
else
|
||||
td:Add(OpenRA.New(key .. "Init", { value }))
|
||||
end
|
||||
end
|
||||
return World:CreateActor(addToWorld, name, td)
|
||||
end
|
||||
|
||||
Actor.Turn = function(actor, facing)
|
||||
actor:QueueActivity(OpenRA.New("Turn", { actor, { facing, "Int32" } }))
|
||||
end
|
||||
|
||||
Actor.Move = function(actor, location)
|
||||
Actor.MoveNear(actor, location, 0)
|
||||
end
|
||||
|
||||
Actor.MoveNear = function(actor, location, nearEnough)
|
||||
actor:QueueActivity(OpenRA.New("Move", { actor, location, WRange.FromCells(nearEnough) }))
|
||||
end
|
||||
|
||||
Actor.ScriptedMove = function(actor, location)
|
||||
if Actor.HasTrait(actor, "Helicopter") then
|
||||
Internal.HeliFlyToPos(actor, Map.CenterOfCell(location))
|
||||
else
|
||||
actor:QueueActivity(OpenRA.New("Move", { actor, location }))
|
||||
end
|
||||
end
|
||||
|
||||
Actor.AfterMove = function(actor)
|
||||
local heli = Actor.TraitOrDefault(actor, "Helicopter")
|
||||
if heli ~= nil then
|
||||
Actor.Turn(actor, heli.Info.InitialFacing)
|
||||
Actor.HeliLand(actor, true)
|
||||
end
|
||||
end
|
||||
|
||||
Actor.Teleport = function(actor, location)
|
||||
actor:QueueActivity(OpenRA.New("SimpleTeleport", { location }))
|
||||
end
|
||||
|
||||
Actor.AttackMove = function(actor, location, nearEnough)
|
||||
Internal.AttackMove(actor, location, nearEnough or 0)
|
||||
end
|
||||
|
||||
Actor.HeliFly = function(actor, position)
|
||||
Internal.HeliFlyToPos(actor, position)
|
||||
end
|
||||
|
||||
Actor.HeliLand = function(actor, requireSpace)
|
||||
actor:QueueActivity(OpenRA.New("HeliLand", { requireSpace }))
|
||||
end
|
||||
|
||||
Actor.Fly = function(actor, position)
|
||||
Internal.FlyToPos(actor, position)
|
||||
end
|
||||
|
||||
Actor.FlyAttackActor = function(actor, targetActor)
|
||||
Internal.FlyAttackActor(actor, targetActor)
|
||||
end
|
||||
|
||||
Actor.FlyAttackCell = function(actor, location)
|
||||
Internal.FlyAttackCell(actor, location)
|
||||
end
|
||||
|
||||
Actor.FlyOffMap = function(actor)
|
||||
actor:QueueActivity(OpenRA.New("FlyOffMap"))
|
||||
end
|
||||
|
||||
Actor.Hunt = function(actor)
|
||||
if Actor.HasTrait(actor, "AttackBase") and Actor.HasTrait(actor, "IMove") then
|
||||
actor:QueueActivity(OpenRA.New("Hunt", { actor }))
|
||||
end
|
||||
end
|
||||
|
||||
Actor.CargoIsEmpty = function(actor)
|
||||
local cargo = Actor.TraitOrDefault(actor, "Cargo")
|
||||
return cargo == nil or cargo:IsEmpty(actor)
|
||||
end
|
||||
|
||||
Actor.UnloadCargo = function(actor, unloadAll)
|
||||
actor:QueueActivity(OpenRA.New("UnloadCargo", { actor, unloadAll }))
|
||||
end
|
||||
|
||||
Actor.Harvest = function(actor)
|
||||
actor:QueueActivity(OpenRA.New("FindResources"))
|
||||
end
|
||||
|
||||
Actor.Scatter = function(actor)
|
||||
local mobile = Actor.Trait(actor, "Mobile")
|
||||
mobile:Nudge(actor, actor, true)
|
||||
end
|
||||
|
||||
Actor.Wait = function(actor, period)
|
||||
actor:QueueActivity(OpenRA.New("Wait", { { period, "Int32" } }))
|
||||
end
|
||||
|
||||
Actor.WaitFor = function(actor, func)
|
||||
Internal.WaitFor(actor, func)
|
||||
end
|
||||
|
||||
Actor.CallFunc = function(actor, func)
|
||||
Internal.CallFunc(actor, func)
|
||||
end
|
||||
|
||||
Actor.DeployTransform = function(actor)
|
||||
Actor.CallFunc(actor, function()
|
||||
-- Queue the transform order
|
||||
Actor.Trait(actor, "Transforms"):DeployTransform(true)
|
||||
end)
|
||||
end
|
||||
|
||||
Actor.RemoveSelf = function(actor)
|
||||
actor:QueueActivity(OpenRA.New("RemoveSelf"))
|
||||
end
|
||||
|
||||
Actor.Stop = function(actor)
|
||||
actor:CancelActivity()
|
||||
end
|
||||
|
||||
Actor.IsDead = function(actor)
|
||||
return Internal.IsDead(actor)
|
||||
end
|
||||
|
||||
Actor.IsInWorld = function(actor)
|
||||
return actor.IsInWorld
|
||||
end
|
||||
|
||||
Actor.Owner = function(actor)
|
||||
return actor.Owner
|
||||
end
|
||||
|
||||
Actor.Facing = function(actor)
|
||||
return Actor.Trait(actor, "IFacing"):get_Facing()
|
||||
end
|
||||
|
||||
Actor.IsIdle = function(actor)
|
||||
return actor.IsIdle
|
||||
end
|
||||
|
||||
Actor.SetStance = function(actor, stance)
|
||||
Internal.SetUnitStance(actor, stance)
|
||||
end
|
||||
|
||||
Actor.RepairBuilding = function(actor)
|
||||
local rb = Actor.TraitOrDefault(actor, "RepairableBuilding")
|
||||
if rb ~= nil and not rb.RepairActive then
|
||||
rb:RepairBuilding(actor, Actor.Owner(actor))
|
||||
end
|
||||
end
|
||||
|
||||
Actor.OnDamaged = function(actor, eh)
|
||||
Actor.Trait(actor, "LuaScriptEvents").OnDamaged:Add(eh)
|
||||
end
|
||||
|
||||
Actor.OnKilled = function(actor, eh)
|
||||
Actor.Trait(actor, "LuaScriptEvents").OnKilled:Add(eh)
|
||||
end
|
||||
|
||||
Actor.OnAddedToWorld = function(actor, eh)
|
||||
Actor.Trait(actor, "LuaScriptEvents").OnAddedToWorld:Add(eh)
|
||||
end
|
||||
|
||||
Actor.OnRemovedFromWorld = function(actor, eh)
|
||||
Actor.Trait(actor, "LuaScriptEvents").OnRemovedFromWorld:Add(eh)
|
||||
end
|
||||
|
||||
Actor.OnCaptured = function(actor, eh)
|
||||
Actor.Trait(actor, "LuaScriptEvents").OnCaptured:Add(eh)
|
||||
end
|
||||
|
||||
Actor.OnIdle = function(actor, eh)
|
||||
Actor.Trait(actor, "LuaScriptEvents").OnIdle:Add(eh)
|
||||
end
|
||||
|
||||
Actor.OnProduced = function(actor, eh)
|
||||
Actor.Trait(actor, "LuaScriptEvents").OnProduced:Add(eh)
|
||||
end
|
||||
|
||||
Actor.ActorsWithTrait = function(className)
|
||||
local ret = { }
|
||||
for item in Utils.Enumerate(Internal.ActorsWithTrait(className)) do
|
||||
table.insert(ret, item.Actor)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
Actor.HasTrait = function(actor, className)
|
||||
return Internal.HasTrait(actor, className)
|
||||
end
|
||||
|
||||
Actor.TraitOrDefault = function(actor, className)
|
||||
return Internal.TraitOrDefault(actor, className)
|
||||
end
|
||||
|
||||
Actor.Trait = function(actor, className)
|
||||
return Internal.Trait(actor, className)
|
||||
end
|
||||
|
||||
Actor.ReturnToBase = function(actor, airfield)
|
||||
actor:QueueActivity(OpenRA.New("ReturnToBase", { actor, airfield }))
|
||||
end
|
||||
|
||||
Actor.Guard = function(actor, target)
|
||||
Internal.Guard(actor, target)
|
||||
end
|
||||
|
||||
Actor.Patrol = function(actor, waypoints, wait, loop)
|
||||
if not Actor.IsDead(actor) then
|
||||
Utils.Do(waypoints, function(wpt)
|
||||
Actor.AttackMove(actor, wpt.Location, 3)
|
||||
Actor.Wait(actor, wait or 0)
|
||||
end)
|
||||
if loop or loop == nil then
|
||||
Actor.CallFunc(actor, function() Actor.Patrol(actor, waypoints, wait, loop) end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Actor.PatrolUntil = function(actor, waypoints, wait, func)
|
||||
if func == nil then error("No function specified", 2) end
|
||||
if not Actor.IsDead(actor) then
|
||||
Actor.Patrol(actor, waypoints, wait, false)
|
||||
if not func(actor) then
|
||||
Actor.CallFunc(actor, function() Actor.PatrolUntil(actor, waypoints, wait, func) end)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,10 +0,0 @@
|
||||
Facing = { }
|
||||
|
||||
Facing.North = { 0, "Int32" }
|
||||
Facing.NorthWest = { 32, "Int32" }
|
||||
Facing.West = { 64, "Int32" }
|
||||
Facing.SouthWest = { 96, "Int32" }
|
||||
Facing.South = { 128, "Int32" }
|
||||
Facing.SouthEast = { 160, "Int32" }
|
||||
Facing.East = { 192, "Int32" }
|
||||
Facing.NorthEast = { 224, "Int32" }
|
||||
@@ -1,109 +0,0 @@
|
||||
Map = { }
|
||||
|
||||
Map.GetFacing = function(vec, currentFacing)
|
||||
return Internal.GetFacing(vec, currentFacing)
|
||||
end
|
||||
|
||||
Map.GetRandomCell = function()
|
||||
return Internal.GetRandomCell()
|
||||
end
|
||||
|
||||
Map.GetRandomEdgeCell = function()
|
||||
return Internal.GetRandomEdgeCell()
|
||||
end
|
||||
|
||||
Map.IsNamedActor = function(actor)
|
||||
return Internal.IsNamedActor(actor)
|
||||
end
|
||||
|
||||
Map.GetNamedActor = function(actorName)
|
||||
return Internal.GetNamedActor(actorName)
|
||||
end
|
||||
|
||||
Map.GetNamedActors = function()
|
||||
return Internal.GetNamedActors()
|
||||
end
|
||||
|
||||
Map.FindActorsInCircle = function(location, radius, func)
|
||||
local actors = Internal.FindActorsInCircle(location.CenterPosition, WRange.FromCells(radius))
|
||||
return Utils.EnumerableWhere(actors, func)
|
||||
end
|
||||
|
||||
Map.FindActorsInBox = function(topLeft, bottomRight, func)
|
||||
local actors = Internal.FindActorsInBox(topLeft.CenterPosition, bottomRight.CenterPosition)
|
||||
return Utils.EnumerableWhere(actors, func)
|
||||
end
|
||||
|
||||
Map.__FilterByTrait = function(a, player, trait)
|
||||
return Actor.Owner(a) == player and Actor.HasTrait(a, trait)
|
||||
end
|
||||
|
||||
Map.__FilterByTraitAndIdle = function(a, player, trait)
|
||||
return Map.__FilterByTrait(a, player, trait) and Actor.IsIdle(a)
|
||||
end
|
||||
|
||||
Map.FindUnitsInCircle = function(player, location, radius)
|
||||
return Map.FindActorsInCircle(location, radius, function(a) return Map.__FilterByTrait(a, player, "Mobile") end)
|
||||
end
|
||||
|
||||
Map.FindUnitsInBox = function(player, topLeft, bottomRight)
|
||||
return Map.FindActorsInBox(topLeft, bottomRight, function(a) return Map.__FilterByTrait(a, player, "Mobile") end)
|
||||
end
|
||||
|
||||
Map.FindStructuresInCircle = function(player, location, radius)
|
||||
return Map.FindActorsInCircle(location, radius, function(a) return Map.__FilterByTrait(a, player, "Building") end)
|
||||
end
|
||||
|
||||
Map.FindStructuresInBox = function(player, topLeft, bottomRight)
|
||||
return Map.FindActorsInBox(topLeft, bottomRight, function(a) return Map.__FilterByTrait(a, player, "Building") end)
|
||||
end
|
||||
|
||||
Map.FindIdleUnitsInCircle = function(player, location, radius)
|
||||
return Map.FindActorsInCircle(location, radius, function(a) return Map.__FilterByTraitAndIdle(a, player, "Mobile") end)
|
||||
end
|
||||
|
||||
Map.FindIdleUnitsInBox = function(player, topLeft, bottomRight)
|
||||
return Map.FindActorsInBox(topLeft, bottomRight, function(a) return Map.__FilterByTraitAndIdle(a, player, "Mobile") end)
|
||||
end
|
||||
|
||||
Map.ExpandFootprint = function(cells, allowDiagonal)
|
||||
return Utils.EnumerableToTable(Internal.ExpandFootprint(cells, allowDiagonal))
|
||||
end
|
||||
|
||||
Map.CenterOfCell = function(position)
|
||||
return Internal.CenterOfCell(position)
|
||||
end
|
||||
|
||||
CPos.New = function(x, y)
|
||||
return OpenRA.New("CPos", { { x, "Int32" }, { y, "Int32" } })
|
||||
end
|
||||
|
||||
WPos.New = function(x, y, z)
|
||||
if z == nil then
|
||||
z = 0
|
||||
end
|
||||
return OpenRA.New("WPos", { { x, "Int32" }, { y, "Int32" }, { z, "Int32" } })
|
||||
end
|
||||
|
||||
WPos.FromCPos = function(location)
|
||||
return WPos.New(location.X * 1024, location.Y * 1024, 0)
|
||||
end
|
||||
|
||||
CVec.New = function(x, y)
|
||||
return OpenRA.New("CVec", { { x, "Int32" }, { y, "Int32" } })
|
||||
end
|
||||
|
||||
WVec.New = function(x, y, z)
|
||||
if z == nil then
|
||||
z = 0
|
||||
end
|
||||
return OpenRA.New("WVec", { { x, "Int32" }, { y, "Int32" }, { z, "Int32" } })
|
||||
end
|
||||
|
||||
WRange.New = function(r)
|
||||
return OpenRA.New("WRange", { { r, "Int32" } })
|
||||
end
|
||||
|
||||
WRange.FromCells = function(cells)
|
||||
return WRange.New(cells * 1024)
|
||||
end
|
||||
@@ -1,20 +0,0 @@
|
||||
Media = { }
|
||||
|
||||
Media.PlaySpeechNotification = function(notification, player)
|
||||
Internal.PlaySpeechNotification(player, notification)
|
||||
end
|
||||
|
||||
Media.PlaySoundNotification = function(notification, player)
|
||||
Internal.PlaySoundNotification(player, notification)
|
||||
end
|
||||
|
||||
Media.PlayRandomMusic = function()
|
||||
Internal.PlayRandomMusic()
|
||||
end
|
||||
|
||||
Media.PlayMovieFullscreen = function(movie, onComplete)
|
||||
if onComplete == nil then
|
||||
onComplete = function() end
|
||||
end
|
||||
Internal.PlayMovieFullscreen(movie, onComplete)
|
||||
end
|
||||
@@ -1,37 +0,0 @@
|
||||
Mission = { }
|
||||
|
||||
Mission.MissionOver = function(winners, losers, setWinStates)
|
||||
World:SetLocalPauseState(true)
|
||||
World:set_PauseStateLocked(true)
|
||||
if winners then
|
||||
for i, player in ipairs(winners) do
|
||||
Media.PlaySpeechNotification("Win", player)
|
||||
if setWinStates then
|
||||
OpenRA.SetWinState(player, "Won")
|
||||
end
|
||||
end
|
||||
end
|
||||
if losers then
|
||||
for i, player in ipairs(losers) do
|
||||
Media.PlaySpeechNotification("Lose", player)
|
||||
if setWinStates then
|
||||
OpenRA.SetWinState(player, "Lost")
|
||||
end
|
||||
end
|
||||
end
|
||||
Mission.MissionIsOver = true
|
||||
end
|
||||
|
||||
Mission.GetGroundAttackersOf = function(player)
|
||||
return Utils.Where(Actor.ActorsWithTrait("AttackBase"), function(actor)
|
||||
return not Actor.IsDead(actor) and Actor.IsInWorld(actor) and Actor.Owner(actor) == player and Actor.HasTrait(actor, "Mobile")
|
||||
end)
|
||||
end
|
||||
|
||||
Mission.TickTakeOre = function(player)
|
||||
OpenRA.TakeOre(player, 0.01 * OpenRA.GetOreCapacity(player) / 25)
|
||||
end
|
||||
|
||||
Mission.RequiredUnitsAreDestroyed = function(player)
|
||||
return Internal.RequiredUnitsAreDestroyed(player)
|
||||
end
|
||||
@@ -1,83 +0,0 @@
|
||||
print = Internal.Debug
|
||||
|
||||
OpenRA = { }
|
||||
|
||||
OpenRA.New = function(className, args)
|
||||
if args == nil then
|
||||
args = { }
|
||||
end
|
||||
return Internal.New(className, args)
|
||||
end
|
||||
|
||||
OpenRA.RunAfterDelay = function(delay, func)
|
||||
if func == nil then error("No function specified", 2) end
|
||||
Internal.RunAfterDelay(delay, func)
|
||||
end
|
||||
|
||||
OpenRA.SetViewportCenterPosition = function(position)
|
||||
WorldRenderer.Viewport:Center(position)
|
||||
end
|
||||
|
||||
OpenRA.GetViewportCenterPosition = function()
|
||||
return WorldRenderer.Viewport.CenterPosition
|
||||
end
|
||||
|
||||
OpenRA.GetDifficulty = function()
|
||||
return World.LobbyInfo.GlobalSettings.Difficulty
|
||||
end
|
||||
|
||||
OpenRA.IsSinglePlayer = function()
|
||||
return World.LobbyInfo:get_IsSinglePlayer()
|
||||
end
|
||||
|
||||
OpenRA.GetPlayer = function(internalName)
|
||||
return Utils.EnumerableFirstOrNil(World.Players, function(p) return p.InternalName == internalName end)
|
||||
end
|
||||
|
||||
OpenRA.GetPlayers = function(func)
|
||||
return Utils.EnumerableWhere(World.Players, func)
|
||||
end
|
||||
|
||||
OpenRA.SetWinState = function(player, winState)
|
||||
Internal.SetWinState(player, winState)
|
||||
end
|
||||
|
||||
OpenRA.GetRandomInteger = function(low, high)
|
||||
if high <= low then
|
||||
return low
|
||||
else
|
||||
return Internal.GetRandomInteger(low, high)
|
||||
end
|
||||
end
|
||||
|
||||
OpenRA.TakeOre = function(player, amount)
|
||||
Actor.Trait(player.PlayerActor, "PlayerResources"):TakeResources(amount)
|
||||
end
|
||||
|
||||
OpenRA.TakeCash = function(player, amount)
|
||||
Actor.Trait(player.PlayerActor, "PlayerResources"):TakeCash(amount)
|
||||
end
|
||||
|
||||
OpenRA.GiveOre = function(player, amount)
|
||||
Actor.Trait(player.PlayerActor, "PlayerResources"):GiveResources(amount)
|
||||
end
|
||||
|
||||
OpenRA.GiveCash = function(player, amount)
|
||||
Actor.Trait(player.PlayerActor, "PlayerResources"):GiveCash(amount)
|
||||
end
|
||||
|
||||
OpenRA.CanGiveOre = function(player, amount)
|
||||
return Actor.Trait(player.PlayerActor, "PlayerResources"):CanGiveResources(amount)
|
||||
end
|
||||
|
||||
OpenRA.GetOreCapacity = function(player)
|
||||
return Actor.Trait(player.PlayerActor, "PlayerResources").ResourceCapacity
|
||||
end
|
||||
|
||||
OpenRA.GetOre = function(player)
|
||||
return Actor.Trait(player.PlayerActor, "PlayerResources").Resources
|
||||
end
|
||||
|
||||
OpenRA.GetCash = function(player)
|
||||
return Actor.Trait(player.PlayerActor, "PlayerResources").Cash
|
||||
end
|
||||
@@ -1,94 +0,0 @@
|
||||
Production = { }
|
||||
Production.EventHandlers = { }
|
||||
|
||||
Production.BuildWithSharedQueue = function(player, unit, amount)
|
||||
Internal.BuildWithSharedQueue(player, unit, amount or 1)
|
||||
end
|
||||
|
||||
Production.BuildWithPerFactoryQueue = function(factory, unit, amount)
|
||||
Internal.BuildWithPerFactoryQueue(factory, unit, amount or 1)
|
||||
end
|
||||
|
||||
Production.Build = function(factory, unit, amount)
|
||||
if Actor.HasTrait(factory, "ProductionQueue") then
|
||||
Production.BuildWithPerFactoryQueue(factory, unit, amount)
|
||||
elseif Actor.HasTrait(factory, "Production") then
|
||||
Production.SetPrimaryBuilding(factory)
|
||||
Production.BuildWithSharedQueue(Actor.Owner(factory), unit, amount)
|
||||
else
|
||||
error("Production.Build: not a factory")
|
||||
end
|
||||
end
|
||||
|
||||
Production.SharedQueueIsBusy = function(player, category)
|
||||
return Internal.SharedQueueIsBusy(player, category)
|
||||
end
|
||||
|
||||
Production.PerFactoryQueueIsBusy = function(factory)
|
||||
return Internal.PerFactoryQueueIsBusy(factory)
|
||||
end
|
||||
|
||||
Production.SetRallyPoint = function(factory, location)
|
||||
local srp = Actor.Trait(factory, "RallyPoint")
|
||||
if srp ~= nil then
|
||||
srp.Location = location.Location
|
||||
end
|
||||
end
|
||||
|
||||
Production.SetPrimaryBuilding = function(factory)
|
||||
local pb = Actor.TraitOrDefault(factory, "PrimaryBuilding")
|
||||
if pb ~= nil then
|
||||
pb:SetPrimaryProducer(factory, true)
|
||||
end
|
||||
end
|
||||
|
||||
Production.BuildTeamFromTemplate = function(player, template, func)
|
||||
local factories = { }
|
||||
Utils.Do(template, function(t) table.insert(factories, t[1]) end)
|
||||
|
||||
if Utils.Any(factories, Actor.IsDead) then
|
||||
return
|
||||
end
|
||||
|
||||
if Utils.Any(factories, function(fact) return Production.EventHandlers[fact] end) then
|
||||
OpenRA.RunAfterDelay(Utils.Seconds(10), function() Production.BuildTeamFromTemplate(player, template, func) end)
|
||||
return
|
||||
end
|
||||
|
||||
local team = Team.New({ })
|
||||
local teamSize = 0
|
||||
Utils.Do(template, function(t) teamSize = teamSize + #t[2] end)
|
||||
|
||||
local eventHandler = function(unit)
|
||||
Team.Add(team, unit)
|
||||
|
||||
if #team.Actors >= teamSize then
|
||||
func(team)
|
||||
Utils.Do(factories, function(factory)
|
||||
Production.EventHandlers[factory] = nil
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
Utils.Do(factories, function(factory)
|
||||
Production.EventHandlers[factory] = eventHandler
|
||||
end)
|
||||
|
||||
Utils.Do(template, function(t)
|
||||
Utils.Do(t[2], function(unit)
|
||||
Production.Build(t[1], unit)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
Production.EventHandlers.Setup = function(player)
|
||||
Utils.Do(Actor.ActorsWithTrait("Production"), function(factory)
|
||||
if Actor.Owner(factory) == player then
|
||||
Actor.OnProduced(factory, function(fact, unit)
|
||||
if Production.EventHandlers[fact] then
|
||||
Production.EventHandlers[fact](unit)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -1,82 +0,0 @@
|
||||
Reinforcements = { }
|
||||
|
||||
Reinforcements.Insert = function(owner, transportName, passengerNames, enterPath, exitPath)
|
||||
local facing = { Map.GetFacing(CPos.op_Subtraction(enterPath[2], enterPath[1]), 0), "Int32" }
|
||||
local center = WPos.op_Addition(Map.CenterOfCell(enterPath[1]), WVec.New(0, 0, Rules.InitialAltitude(transportName)))
|
||||
local transport = Actor.Create(transportName, { Owner = owner, Location = enterPath[1], CenterPosition = center, Facing = facing })
|
||||
local cargo = Actor.Trait(transport, "Cargo")
|
||||
local passengers = { }
|
||||
|
||||
for i, passengerName in ipairs(passengerNames) do
|
||||
local passenger = Actor.Create(passengerName, { AddToWorld = false, Owner = owner })
|
||||
passengers[i] = passenger
|
||||
cargo:Load(transport, passenger)
|
||||
end
|
||||
|
||||
Utils.Do(Utils.Skip(enterPath, 1), function(l) Actor.ScriptedMove(transport, l) end)
|
||||
Actor.AfterMove(transport)
|
||||
Actor.UnloadCargo(transport, true)
|
||||
Actor.Wait(transport, 25)
|
||||
Utils.Do(exitPath, function(l) Actor.ScriptedMove(transport, l) end)
|
||||
Actor.RemoveSelf(transport)
|
||||
return transport, passengers
|
||||
end
|
||||
|
||||
Reinforcements.Extract = function(owner, transportName, passengerNames, enterPath, exitPath)
|
||||
local facing = { Map.GetFacing(CPos.op_Subtraction(enterPath[2], enterPath[1]), 0), "Int32" }
|
||||
local center = WPos.op_Addition(Map.CenterOfCell(enterPath[1]), WVec.New(0, 0, Rules.InitialAltitude(transportName)))
|
||||
local transport = Actor.Create(transportName, { Owner = owner, Location = enterPath[1], CenterPosition = center, Facing = facing })
|
||||
local cargo = Actor.Trait(transport, "Cargo")
|
||||
|
||||
Utils.Do(Utils.Skip(enterPath, 1), function(l) Actor.ScriptedMove(transport, l) end)
|
||||
Actor.AfterMove(transport)
|
||||
Actor.WaitFor(transport, function()
|
||||
return Utils.All(passengerNames, function(passenger) return cargo.Passengers:Contains(passenger) end)
|
||||
end)
|
||||
|
||||
Actor.Wait(transport, 125)
|
||||
Utils.Do(exitPath, function(l) Actor.ScriptedMove(transport, l) end)
|
||||
Actor.RemoveSelf(transport)
|
||||
return transport
|
||||
end
|
||||
|
||||
Reinforcements.Reinforce = function(owner, reinforcementNames, enterLocation, rallyPointLocation, interval, onCreateFunc)
|
||||
local facing = { Map.GetFacing(CPos.op_Subtraction(rallyPointLocation, enterLocation), 0), "Int32" }
|
||||
local reinforcements = { }
|
||||
for i, reinforcementName in ipairs(reinforcementNames) do
|
||||
local reinforcement = Actor.Create(reinforcementName, { AddToWorld = false, Owner = owner, Location = enterLocation, Facing = facing })
|
||||
reinforcements[i] = reinforcement
|
||||
OpenRA.RunAfterDelay((i - 1) * interval, function()
|
||||
World:Add(reinforcement)
|
||||
Actor.MoveNear(reinforcement, rallyPointLocation, 2)
|
||||
if onCreateFunc ~= nil then
|
||||
onCreateFunc(reinforcement)
|
||||
end
|
||||
end)
|
||||
end
|
||||
return reinforcements
|
||||
end
|
||||
|
||||
Reinforcements.ReinforceWithCargo = function(owner, actorName, path, cargoNames, actionFunc)
|
||||
local facing = { Map.GetFacing(CPos.op_Subtraction(path[2].Location, path[1].Location), 0), "Int32" }
|
||||
local center = WPos.op_Addition(path[1].CenterPosition, WVec.New(0, 0, Rules.InitialAltitude(actorName)))
|
||||
local actor = Actor.Create(actorName, { Owner = owner, Location = path[1].Location, CenterPosition = center, Facing = facing })
|
||||
local cargo = Actor.TraitOrDefault(actor, "Cargo")
|
||||
local team = Team.New({})
|
||||
if cargo ~= nil and cargoNames ~= nil and #cargoNames > 0 then
|
||||
local passengers = { }
|
||||
|
||||
for i, cargoName in ipairs(cargoNames) do
|
||||
local passenger = Actor.Create(cargoName, { AddToWorld = false, Owner = owner })
|
||||
Team.Add(team, passenger)
|
||||
passengers[i] = passenger
|
||||
cargo:Load(actor, passenger)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Utils.Do(Utils.Skip(path, 1), function(waypoint) Actor.ScriptedMove(actor, waypoint.Location) end)
|
||||
|
||||
if actionFunc then actionFunc(actor, team) end
|
||||
return actor, team
|
||||
end
|
||||
@@ -1,21 +0,0 @@
|
||||
Rules = { }
|
||||
|
||||
Rules.HasTraitInfo = function(actorType, className)
|
||||
return Internal.HasTraitInfo(actorType, className)
|
||||
end
|
||||
|
||||
Rules.TraitInfoOrDefault = function(actorType, className)
|
||||
return Internal.TraitInfoOrDefault(actorType, className)
|
||||
end
|
||||
|
||||
Rules.TraitInfo = function(actorType, className)
|
||||
return Internal.TraitInfo(actorType, className)
|
||||
end
|
||||
|
||||
Rules.InitialAltitude = function(actorType)
|
||||
local ai = Rules.TraitInfoOrDefault(actorType, "AircraftInfo")
|
||||
if ai ~= nil then
|
||||
return ai.CruiseAltitude.Range
|
||||
end
|
||||
return 0
|
||||
end
|
||||
@@ -1,44 +0,0 @@
|
||||
SupportPowers = { }
|
||||
|
||||
SupportPowers.Airstrike = function(owner, planeName, enterLocation, bombLocation)
|
||||
local facing = { Map.GetFacing(CPos.op_Subtraction(bombLocation, enterLocation), 0), "Int32" }
|
||||
local center = WPos.op_Addition(Map.CenterOfCell(enterLocation), WVec.New(0, 0, Rules.InitialAltitude(planeName)))
|
||||
local plane = Actor.Create(planeName, { Location = enterLocation, Owner = owner, Facing = facing, CenterPosition = center })
|
||||
local bombLoc = Map.CenterOfCell(bombLocation)
|
||||
Actor.Trait(plane, "AttackBomber"):SetTarget(bombLoc)
|
||||
Actor.Fly(plane, bombLoc)
|
||||
Actor.FlyOffMap(plane)
|
||||
Actor.RemoveSelf(plane)
|
||||
return plane
|
||||
end
|
||||
|
||||
SupportPowers.Paradrop = function(owner, planeName, passengerNames, enterLocation, dropLocation)
|
||||
local facing = { Map.GetFacing(CPos.op_Subtraction(dropLocation, enterLocation), 0), "Int32" }
|
||||
local center = WPos.op_Addition(Map.CenterOfCell(enterLocation), WVec.New(0, 0, Rules.InitialAltitude(planeName)))
|
||||
local plane = Actor.Create(planeName, { Location = enterLocation, Owner = owner, Facing = facing, CenterPosition = center })
|
||||
Actor.Fly(plane, Map.CenterOfCell(dropLocation))
|
||||
Actor.Trait(plane, "ParaDrop"):SetLZ(dropLocation, true)
|
||||
Actor.FlyOffMap(plane)
|
||||
Actor.RemoveSelf(plane)
|
||||
local cargo = Actor.Trait(plane, "Cargo")
|
||||
local passengers = { }
|
||||
for i, passengerName in ipairs(passengerNames) do
|
||||
local passenger = Actor.Create(passengerName, { AddToWorld = false, Owner = owner })
|
||||
passengers[i] = passenger
|
||||
cargo:Load(plane, passenger)
|
||||
end
|
||||
return plane, passengers
|
||||
end
|
||||
|
||||
SupportPowers.Chronoshift = function(unitLocationPairs, chronosphere, duration, killCargo)
|
||||
duration = duration or -1
|
||||
killCargo = killCargo or true
|
||||
Utils.Do(unitLocationPairs, function(pair)
|
||||
local unit = pair[1]
|
||||
local cell = pair[2]
|
||||
local cs = Actor.TraitOrDefault(unit, "Chronoshiftable")
|
||||
if cs ~= nil and cs:CanChronoshiftTo(unit, cell) then
|
||||
cs:Teleport(unit, cell, duration, killCargo, chronosphere)
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -1,73 +0,0 @@
|
||||
Team = { }
|
||||
|
||||
Team.New = function(actors)
|
||||
local team = { }
|
||||
team.Actors = actors
|
||||
team.OnAllKilled = { }
|
||||
team.OnAnyKilled = { }
|
||||
team.OnAllRemovedFromWorld = { }
|
||||
team.OnAnyRemovedFromWorld = { }
|
||||
Team.Do(team, function(actor) Team.AddActorEventHandlers(team, actor) end)
|
||||
return team
|
||||
end
|
||||
|
||||
Team.Add = function(team, actor)
|
||||
table.insert(team.Actors, actor)
|
||||
Team.AddActorEventHandlers(team, actor)
|
||||
end
|
||||
|
||||
Team.AddActorEventHandlers = function(team, actor)
|
||||
Actor.OnKilled(actor, function()
|
||||
Team.InvokeHandlers(team.OnAnyKilled)
|
||||
if Team.AllAreDead(team) then Team.InvokeHandlers(team.OnAllKilled) end
|
||||
end)
|
||||
|
||||
Actor.OnRemovedFromWorld(actor, function()
|
||||
Team.InvokeHandlers(team.OnAnyRemovedFromWorld)
|
||||
if not Team.AnyAreInWorld(team) then Team.InvokeHandlers(team.OnAllRemovedFromWorld) end
|
||||
end)
|
||||
end
|
||||
|
||||
Team.InvokeHandlers = function(event)
|
||||
Utils.Do(event, function(handler) handler() end)
|
||||
end
|
||||
|
||||
Team.AllAreDead = function(team)
|
||||
return Utils.All(team.Actors, Actor.IsDead)
|
||||
end
|
||||
|
||||
Team.AnyAreDead = function(team)
|
||||
return Utils.Any(team.Actors, Actor.IsDead)
|
||||
end
|
||||
|
||||
Team.AllAreInWorld = function(team)
|
||||
return Utils.All(team.Actors, Actor.IsInWorld)
|
||||
end
|
||||
|
||||
Team.AnyAreInWorld = function(team)
|
||||
return Utils.Any(team.Actors, Actor.IsInWorld)
|
||||
end
|
||||
|
||||
Team.AddEventHandler = function(event, func)
|
||||
table.insert(event, func)
|
||||
end
|
||||
|
||||
Team.Contains = function(team, actor)
|
||||
return Utils.Any(team.Actors, function(a) return a == actor end)
|
||||
end
|
||||
|
||||
Team.Do = function(team, func)
|
||||
Utils.Do(team.Actors, function(actor)
|
||||
if not Actor.IsDead(actor) then
|
||||
func(actor)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
Team.Patrol = function(team, waypoints, wait, loop)
|
||||
Team.Do(team, function(a) Actor.Patrol(a, waypoints, wait, loop) end)
|
||||
end
|
||||
|
||||
Team.PatrolUntil = function(team, waypoints, wait, func)
|
||||
Team.Do(team, function(a) Actor.PatrolUntil(a, waypoints, wait, func) end)
|
||||
end
|
||||
@@ -1,94 +0,0 @@
|
||||
Utils = { }
|
||||
|
||||
Utils.Enumerate = function(netEnumerable)
|
||||
local enum = netEnumerable:GetEnumerator()
|
||||
return function()
|
||||
if enum:MoveNext() then
|
||||
return enum:get_Current()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Utils.EnumerableFirstOrNil = function(netEnumerable, func)
|
||||
for item in Utils.Enumerate(netEnumerable) do
|
||||
if func(item) then
|
||||
return item
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
Utils.EnumerableWhere = function(netEnumerable, func)
|
||||
local ret = { }
|
||||
for item in Utils.Enumerate(netEnumerable) do
|
||||
if func(item) then
|
||||
table.insert(ret, item)
|
||||
end
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
Utils.EnumerableToTable = function(netEnumerable, func)
|
||||
local ret = { }
|
||||
for item in Utils.Enumerate(netEnumerable) do
|
||||
table.insert(ret, item)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
Utils.Where = function(array, func)
|
||||
local ret = { }
|
||||
for i, item in ipairs(array) do
|
||||
if func(item) then
|
||||
table.insert(ret, item)
|
||||
end
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
Utils.All = function(array, func)
|
||||
for i, item in ipairs(array) do
|
||||
if not func(item) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
Utils.Any = function(array, func)
|
||||
for i, item in ipairs(array) do
|
||||
if func(item) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
Utils.Do = function(array, func)
|
||||
for i, item in ipairs(array) do
|
||||
func(item)
|
||||
end
|
||||
end
|
||||
|
||||
Utils.Skip = function(array, n)
|
||||
local ret = { }
|
||||
for i, item in ipairs(array) do
|
||||
if i > n then
|
||||
table.insert(ret, item)
|
||||
end
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
Utils.TableToArray = function(luaTable)
|
||||
return Internal.TableToArray(luaTable)
|
||||
end
|
||||
|
||||
Utils.Seconds = function(seconds)
|
||||
local TicksPerSecond = 25
|
||||
return seconds * TicksPerSecond
|
||||
end
|
||||
|
||||
Utils.Minutes = function(minutes)
|
||||
return Utils.Seconds(minutes * 60)
|
||||
end
|
||||
@@ -91,7 +91,6 @@ ChromeLayout:
|
||||
./mods/ra/chrome/musicplayer.yaml
|
||||
./mods/d2k/chrome/tooltips.yaml
|
||||
./mods/ra/chrome/assetbrowser.yaml
|
||||
./mods/ra/chrome/irc.yaml
|
||||
./mods/ra/chrome/missionbrowser.yaml
|
||||
./mods/ra/chrome/confirmation-dialogs.yaml
|
||||
|
||||
@@ -153,28 +152,28 @@ ChromeMetrics:
|
||||
|
||||
Fonts:
|
||||
Regular:
|
||||
Font:./FreeSans.ttf
|
||||
Font:./mods/common/FreeSans.ttf
|
||||
Size:14
|
||||
Bold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:14
|
||||
Title:
|
||||
Font:./mods/d2k/Dune2k.ttf
|
||||
Size:32
|
||||
MediumBold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:18
|
||||
BigBold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:24
|
||||
Small:
|
||||
Font:./FreeSans.ttf
|
||||
Font:./mods/common/FreeSans.ttf
|
||||
Size:12
|
||||
Tiny:
|
||||
Font:./FreeSans.ttf
|
||||
Font:./mods/common/FreeSans.ttf
|
||||
Size:10
|
||||
TinyBold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:10
|
||||
|
||||
LuaScripts:
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
BodyOrientation:
|
||||
UpdatesPlayerStatistics:
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
Demolishable:
|
||||
ScriptTriggers:
|
||||
GainsStatUpgrades:
|
||||
@@ -86,7 +85,6 @@
|
||||
BodyOrientation:
|
||||
UpdatesPlayerStatistics:
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
Demolishable:
|
||||
ScriptTriggers:
|
||||
GainsStatUpgrades:
|
||||
@@ -113,7 +111,6 @@
|
||||
Tooltip:
|
||||
Name: Wreck
|
||||
BodyOrientation:
|
||||
LuaScriptEvents:
|
||||
TargetableUnit:
|
||||
TargetTypes: Ground
|
||||
RequiresForceFire: yes
|
||||
@@ -144,7 +141,6 @@
|
||||
ProximityCaptor:
|
||||
Types: Husk
|
||||
BodyOrientation:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
|
||||
^AircraftHusk:
|
||||
@@ -211,7 +207,6 @@
|
||||
BodyOrientation:
|
||||
UpdatesPlayerStatistics:
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
DeathSounds:
|
||||
Parachutable:
|
||||
@@ -247,7 +242,6 @@
|
||||
UpdatesPlayerStatistics:
|
||||
Huntable:
|
||||
AttackMove:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
GainsStatUpgrades:
|
||||
SelfHealing@ELITE:
|
||||
@@ -306,7 +300,6 @@
|
||||
UpdatesPlayerStatistics:
|
||||
WithCrumbleOverlay:
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
Demolishable:
|
||||
DamagedWithoutFoundation:
|
||||
ThrowsShrapnel:
|
||||
|
||||
@@ -31,22 +31,22 @@ ChromeMetrics:
|
||||
|
||||
Fonts:
|
||||
Regular:
|
||||
Font:./FreeSans.ttf
|
||||
Font:./mods/common/FreeSans.ttf
|
||||
Size:14
|
||||
Bold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:14
|
||||
BigBold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:24
|
||||
MediumBold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:18
|
||||
Tiny:
|
||||
Font:./FreeSans.ttf
|
||||
Font:./mods/common/FreeSans.ttf
|
||||
Size:10
|
||||
TinyBold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:10
|
||||
|
||||
LobbyDefaults:
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
Container@SERVERBROWSER_IRC:
|
||||
Logic: IrcLogic
|
||||
Width: 700
|
||||
Height: 250
|
||||
Children:
|
||||
Container@IRC_CONTAINER:
|
||||
Width: PARENT_RIGHT
|
||||
Height: PARENT_BOTTOM
|
||||
Children:
|
||||
ScrollPanel@HISTORY_PANEL:
|
||||
Width: 565
|
||||
Height: PARENT_BOTTOM - 30
|
||||
ItemSpacing: 5
|
||||
Label@HISTORY_TEMPLATE:
|
||||
X: 5
|
||||
Width: 530
|
||||
Height: 25
|
||||
WordWrap: True
|
||||
TextField@INPUT_BOX:
|
||||
Y: PARENT_BOTTOM - 25
|
||||
Width: 565
|
||||
Height: 25
|
||||
ScrollPanel@NICKNAME_PANEL:
|
||||
X: 570
|
||||
Width: 130
|
||||
Height: PARENT_BOTTOM - 30
|
||||
Label@NICKNAME_TEMPLATE:
|
||||
X: 5
|
||||
Button@DISCONNECT_BUTTON:
|
||||
X: 570
|
||||
Y: PARENT_BOTTOM - 25
|
||||
Width: 130
|
||||
Height: 25
|
||||
Text: Disconnect
|
||||
Font: Bold
|
||||
Background@IRC_CONNECT_BG:
|
||||
Width: PARENT_RIGHT
|
||||
Height: PARENT_BOTTOM
|
||||
Background: scrollpanel-bg
|
||||
Children:
|
||||
Label@GLOBAL_CHAT_LABEL:
|
||||
Y: PARENT_BOTTOM / 4
|
||||
Width: PARENT_RIGHT
|
||||
Align: Center
|
||||
Text: Global Chat
|
||||
Font: Bold
|
||||
Label@NICKNAME_LABEL:
|
||||
X: 200
|
||||
Y: PARENT_BOTTOM / 4 + 35
|
||||
Text: Nickname:
|
||||
TextField@NICKNAME_BOX:
|
||||
X: 270
|
||||
Y: PARENT_BOTTOM / 4 + 25
|
||||
Width: 150
|
||||
Height: 25
|
||||
Checkbox@CONNECT_AUTOMATICALLY_CHECKBOX:
|
||||
X: 270
|
||||
Y: PARENT_BOTTOM / 4 + 75
|
||||
Height: 20
|
||||
Width: 180
|
||||
Text: Connect Automatically
|
||||
Button@CONNECT_BUTTON:
|
||||
X: 430
|
||||
Y: PARENT_BOTTOM / 4 + 25
|
||||
Width: 100
|
||||
Height: 25
|
||||
Text: Connect
|
||||
Font: Bold
|
||||
|
||||
@@ -104,7 +104,6 @@ ChromeLayout:
|
||||
./mods/ra/chrome/musicplayer.yaml
|
||||
./mods/ra/chrome/tooltips.yaml
|
||||
./mods/ra/chrome/assetbrowser.yaml
|
||||
./mods/ra/chrome/irc.yaml
|
||||
./mods/ra/chrome/missionbrowser.yaml
|
||||
./mods/ra/chrome/confirmation-dialogs.yaml
|
||||
|
||||
@@ -169,28 +168,28 @@ ChromeMetrics:
|
||||
|
||||
Fonts:
|
||||
Regular:
|
||||
Font:./FreeSans.ttf
|
||||
Font:./mods/common/FreeSans.ttf
|
||||
Size:14
|
||||
Bold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:14
|
||||
Title:
|
||||
Font:./mods/ra/ZoodRangmah.ttf
|
||||
Size:48
|
||||
MediumBold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:18
|
||||
BigBold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:24
|
||||
Small:
|
||||
Font:./FreeSans.ttf
|
||||
Font:./mods/common/FreeSans.ttf
|
||||
Size:12
|
||||
Tiny:
|
||||
Font:./FreeSans.ttf
|
||||
Font:./mods/common/FreeSans.ttf
|
||||
Size:10
|
||||
TinyBold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:10
|
||||
|
||||
LuaScripts:
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
EjectInAir: false
|
||||
AllowUnsuitableCell: false
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
Capturable:
|
||||
Type: vehicle
|
||||
CaptureThreshold: 1
|
||||
@@ -117,7 +116,6 @@
|
||||
EjectInAir: false
|
||||
AllowUnsuitableCell: false
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
Capturable:
|
||||
Type: vehicle
|
||||
CaptureThreshold: 1
|
||||
@@ -199,7 +197,6 @@
|
||||
Upgrades: hospitalheal
|
||||
Prerequisites: hosp
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
DeathSounds@NORMAL:
|
||||
DeathTypes: 1, 2, 3, 4
|
||||
@@ -259,7 +256,6 @@
|
||||
Tooltip:
|
||||
GenericName: Ship
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
GainsStatUpgrades:
|
||||
SelfHealing@ELITE:
|
||||
@@ -311,7 +307,6 @@
|
||||
Tooltip:
|
||||
GenericName: Plane
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
GainsStatUpgrades:
|
||||
SelfHealing@ELITE:
|
||||
@@ -383,7 +378,6 @@
|
||||
GpsDot:
|
||||
String: Structure
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
Demolishable:
|
||||
ScriptTriggers:
|
||||
UpgradeManager:
|
||||
@@ -435,7 +429,6 @@
|
||||
Guardable:
|
||||
BodyOrientation:
|
||||
FrozenUnderFog:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
|
||||
^TechBuilding:
|
||||
@@ -544,7 +537,6 @@
|
||||
BodyOrientation:
|
||||
FrozenUnderFog:
|
||||
StartsRevealed: true
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
|
||||
^Husk:
|
||||
@@ -563,7 +555,6 @@
|
||||
BelowUnits:
|
||||
BodyOrientation:
|
||||
Chronoshiftable:
|
||||
LuaScriptEvents:
|
||||
TargetableUnit:
|
||||
TargetTypes: Ground
|
||||
RequiresForceFire: true
|
||||
@@ -621,7 +612,6 @@
|
||||
Type: Concrete
|
||||
AutoTargetIgnore:
|
||||
BodyOrientation:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
|
||||
^Rock:
|
||||
@@ -643,7 +633,6 @@
|
||||
BodyOrientation:
|
||||
FrozenUnderFog:
|
||||
StartsRevealed: true
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
|
||||
^DesertCivBuilding:
|
||||
|
||||
@@ -133,7 +133,6 @@ ChromeLayout:
|
||||
./mods/ra/chrome/musicplayer.yaml
|
||||
./mods/ra/chrome/tooltips.yaml
|
||||
./mods/ra/chrome/assetbrowser.yaml
|
||||
./mods/ra/chrome/irc.yaml
|
||||
./mods/ra/chrome/missionbrowser.yaml
|
||||
./mods/ra/chrome/confirmation-dialogs.yaml
|
||||
|
||||
@@ -197,25 +196,25 @@ ChromeMetrics:
|
||||
|
||||
Fonts:
|
||||
Regular:
|
||||
Font:./FreeSans.ttf
|
||||
Font:./mods/common/FreeSans.ttf
|
||||
Size:14
|
||||
Bold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:14
|
||||
Title:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:32
|
||||
BigBold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:24
|
||||
Small:
|
||||
Font:./FreeSans.ttf
|
||||
Font:./mods/common/FreeSans.ttf
|
||||
Size:12
|
||||
Tiny:
|
||||
Font:./FreeSans.ttf
|
||||
Font:./mods/common/FreeSans.ttf
|
||||
Size:10
|
||||
TinyBold:
|
||||
Font:./FreeSansBold.ttf
|
||||
Font:./mods/common/FreeSansBold.ttf
|
||||
Size:10
|
||||
|
||||
LuaScripts:
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
Range: 3
|
||||
BodyOrientation:
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
Demolishable:
|
||||
ScriptTriggers:
|
||||
WithMakeAnimation:
|
||||
@@ -84,7 +83,6 @@
|
||||
SellSounds: cashturn.aud
|
||||
UpdatesPlayerStatistics:
|
||||
BodyOrientation:
|
||||
LuaScriptEvents:
|
||||
Demolishable:
|
||||
ScriptTriggers:
|
||||
UpgradeManager:
|
||||
@@ -158,7 +156,6 @@
|
||||
Guardable:
|
||||
BodyOrientation:
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
DeathSounds@NORMAL:
|
||||
DeathTypes: 1, 2, 3
|
||||
@@ -255,7 +252,6 @@
|
||||
BodyOrientation:
|
||||
CameraPitch: 90
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
Explodes:
|
||||
Weapon: UnitExplodeSmall
|
||||
@@ -328,7 +324,6 @@
|
||||
BodyOrientation:
|
||||
CameraPitch: 90
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
Explodes:
|
||||
Weapon: UnitExplodeSmall
|
||||
@@ -388,7 +383,6 @@
|
||||
BodyOrientation:
|
||||
CameraPitch: 90
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
ScriptTriggers:
|
||||
Guard:
|
||||
Guardable:
|
||||
@@ -408,7 +402,6 @@
|
||||
BodyOrientation:
|
||||
FrozenUnderFog:
|
||||
StartsRevealed: true
|
||||
LuaScriptEvents:
|
||||
SeedsResource:
|
||||
ResourceType: Tiberium
|
||||
Interval: 55
|
||||
|
||||
Reference in New Issue
Block a user