- Remove debug messages for Range.lua
- Add hint message when spawning targets.
This commit is contained in:
@@ -44,6 +44,10 @@ Localizations = {
|
||||
['Auto Respawn Targets: Off'] = 'Auto Respawn Targets: Off',
|
||||
--Message
|
||||
['There is no range section of %s left.'] = 'There is no range section of %s left.',
|
||||
['Spawn target at %s section area. targetType: %s state: %s'] = 'Spawn target at %s section area. targetType: %s state: %s',
|
||||
['Spawn target at %s section area. targetType: %s AAType: %s state: %s'] = 'Spawn target at %s section area. targetType: %s AAType: %s state: %s',
|
||||
['Stationary'] = 'Stationary',
|
||||
['Moving'] = 'Moving',
|
||||
},
|
||||
|
||||
--中文
|
||||
@@ -89,6 +93,10 @@ Localizations = {
|
||||
['Auto Respawn Targets: Off'] = '目标自动重生: 关',
|
||||
--Message
|
||||
['There is no range section of %s left.'] = '没有 %s 类型靶场空闲了.',
|
||||
['Spawn target at %s section area. targetType: %s state: %s'] = '在 %s 区域刷新目标. 目标类型: %s 状态: %s',
|
||||
['Spawn target at %s section area. targetType: %s AAType: %s state: %s'] = '在 %s 区域 刷新目标. 目标类型: %s 防空类型: %s 状态: %s',
|
||||
['Stationary'] = '静止目标',
|
||||
['Moving'] = '运动目标',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+39
-45
@@ -60,6 +60,10 @@ do
|
||||
self.points = points
|
||||
|
||||
Utils.drawPolygon(-1,Utils.getMarkID(),points,{0,1,1,1},{0,1,0,0},2)
|
||||
local dangerZonePoints = Utils.getWayPoints(zoneName..'-1')
|
||||
if dangerZonePoints then
|
||||
Utils.drawPolygon(-1,Utils.getMarkID(),dangerZonePoints,{1,0,0,1},{1,0,0,0},2)
|
||||
end
|
||||
|
||||
for type, value in pairs(self.sectionTypes) do
|
||||
for j=1,100,1 do
|
||||
@@ -71,7 +75,7 @@ do
|
||||
end
|
||||
|
||||
--Debug
|
||||
self.drawPolygon(points)
|
||||
-- self.drawPolygon(points)
|
||||
-- trigger.action.textToAll(-1,Utils.getMarkID(),Utils.makeVec3(points[1]),{1,1,1,1},{0,0,0,0},8,false,sectionName)
|
||||
|
||||
local sectionData = {
|
||||
@@ -159,28 +163,27 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
-- Utils.Debug(mist.utils.tableShow(self.playerList))
|
||||
--Debug
|
||||
for sectionType,sections in pairs(self.sections) do
|
||||
for i, section in ipairs(sections) do
|
||||
local text = 'not active'
|
||||
if section.active then
|
||||
text = 'active'
|
||||
end
|
||||
-- --Debug
|
||||
-- for sectionType,sections in pairs(self.sections) do
|
||||
-- for i, section in ipairs(sections) do
|
||||
-- local text = 'not active'
|
||||
-- if section.active then
|
||||
-- text = 'active'
|
||||
-- end
|
||||
|
||||
local point = {
|
||||
x = section.points[1].x,
|
||||
y = 0,
|
||||
z = section.points[1].y,
|
||||
}
|
||||
if not section.tagID then
|
||||
section.tagID = Utils.getMarkID()
|
||||
trigger.action.textToAll(-1,section.tagID,point,{1,1,0,1},{0,0,0,0},12,false,text)
|
||||
end
|
||||
-- local point = {
|
||||
-- x = section.points[1].x,
|
||||
-- y = 0,
|
||||
-- z = section.points[1].y,
|
||||
-- }
|
||||
-- if not section.tagID then
|
||||
-- section.tagID = Utils.getMarkID()
|
||||
-- trigger.action.textToAll(-1,section.tagID,point,{1,1,0,1},{0,0,0,0},12,false,text)
|
||||
-- end
|
||||
|
||||
trigger.action.setMarkupText(section.tagID,text)
|
||||
end
|
||||
end
|
||||
-- trigger.action.setMarkupText(section.tagID,text)
|
||||
-- end
|
||||
-- end
|
||||
|
||||
|
||||
return time+repeatTime
|
||||
@@ -215,13 +218,11 @@ do
|
||||
local playerName = playerUnit:getPlayerName()
|
||||
if self.playerList[playerName] then
|
||||
if self.playerList[playerName].menu then
|
||||
Utils.Debug('removeMenu')
|
||||
missionCommands.removeItemForGroup(groupID,self.playerList[playerName].menu)
|
||||
self.playerList[playerName].menu = nil
|
||||
end
|
||||
end
|
||||
|
||||
Utils.Debug('createMenu')
|
||||
local MainMenuName = Localizations:translate('Range','cn')
|
||||
local menu = missionCommands.addSubMenuForGroup(groupID,MainMenuName)
|
||||
|
||||
@@ -287,7 +288,7 @@ do
|
||||
if self.playerList[playerName].isTargerRedAlert then
|
||||
switch = 'On'
|
||||
end
|
||||
Utils.Debug('switch: '..switch)
|
||||
|
||||
local SettingsMenuName = Localizations:translate('Settings','cn')
|
||||
local SettingsMenu = missionCommands.addSubMenuForGroup(groupID,SettingsMenuName,menu)
|
||||
|
||||
@@ -301,7 +302,6 @@ do
|
||||
if self.playerList[playerName].autoRespawn then
|
||||
switch = 'On'
|
||||
end
|
||||
Utils.Debug('switch: '..switch)
|
||||
local AutoRespawnSwitchName = Localizations:translate(string.format('Auto Respawn Targets: %s',switch),'cn')
|
||||
missionCommands.addCommandForGroup(groupID,AutoRespawnSwitchName,SettingsMenu,function (vars)
|
||||
local self = vars.context
|
||||
@@ -322,8 +322,6 @@ do
|
||||
local playerGroup = playerUnit:getGroup()
|
||||
if not playerGroup then return end
|
||||
|
||||
Utils.Debug('createPlayerProfile')
|
||||
|
||||
self.playerList[PlayerName] = {
|
||||
group = playerGroup,
|
||||
groupID = playerGroup:getID(),
|
||||
@@ -357,15 +355,22 @@ do
|
||||
|
||||
self:deactivateTargets(playerName)
|
||||
|
||||
--Debug
|
||||
local isMove = 'Stationary'
|
||||
--Send message
|
||||
local isMove = Localizations:translate('Stationary','cn')
|
||||
if Move then
|
||||
isMove = 'Moving'
|
||||
isMove = Localizations:translate('Moving','cn')
|
||||
end
|
||||
|
||||
--Debug
|
||||
local tAAtype = AAType or 'None'
|
||||
Utils.Debug('section:'..sectionType..' targetType: '..targetType..' AAType: '..tAAtype..' Move: '..isMove)
|
||||
local baseText = Localizations:translate('Spawn target at %s section area. targetType: %s state: %s','cn')
|
||||
local tSectionType = Localizations:translate(sectionType,'cn')
|
||||
local ttargetType = Localizations:translate(targetType,'cn')
|
||||
local messageText = string.format(baseText,tSectionType,ttargetType,isMove)
|
||||
if AAType then
|
||||
baseText = Localizations:translate('Spawn target at %s section area. targetType: %s AAType: %s state: %s','cn')
|
||||
local tAAtype = Localizations:translate(AAType,'cn')
|
||||
messageText = string.format(baseText,tSectionType,ttargetType,tAAtype,isMove)
|
||||
end
|
||||
trigger.action.outTextForGroup(self.playerList[playerName].groupID,messageText,10)
|
||||
|
||||
--Get sectionZone
|
||||
local sectionZone = self.playerList[playerName].assignedSection or nil
|
||||
@@ -377,7 +382,6 @@ do
|
||||
|
||||
if not Move then
|
||||
self.sections[sectionType][zoneNum].active = true
|
||||
Utils.Debug('Active: '..self.sections[sectionType][zoneNum].name)
|
||||
end
|
||||
|
||||
break
|
||||
@@ -391,7 +395,6 @@ do
|
||||
|
||||
if not Move then
|
||||
self.sections[sectionType][i].active = true
|
||||
Utils.Debug('Active: '..self.sections[sectionType][i].name)
|
||||
end
|
||||
|
||||
break
|
||||
@@ -412,7 +415,6 @@ do
|
||||
}
|
||||
-- self.playerList[playerName].assignedSection = sectionZone.name
|
||||
self.playerList[playerName].assignedSection = sectionZone
|
||||
Utils.Debug('assignedSection: '..sectionZone.name)
|
||||
end
|
||||
|
||||
--Get targets(typeNames)
|
||||
@@ -426,7 +428,6 @@ do
|
||||
if AAType then
|
||||
targetList = self.targetPresets[targetType][AAType]
|
||||
end
|
||||
Utils.Debug('targetType: '..targetType)
|
||||
|
||||
for i=1,6,1 do
|
||||
local randomNum = math.random(1,#targetList)
|
||||
@@ -459,7 +460,7 @@ do
|
||||
local spawnPoint = {}
|
||||
|
||||
for i=1,100,1 do
|
||||
local tPoint = Utils.vecTranslate(centerPoint,tDir,math.random(10,150))
|
||||
local tPoint = Utils.vecTranslate(centerPoint,tDir,math.random(10,500))
|
||||
if Utils.pointInPolygon(tPoint,sectionZone.points) then
|
||||
if land.getSurfaceType(tPoint) ~= land.SurfaceType.WATER or land.getSurfaceType(tPoint) ~= land.SurfaceType.SHALLOW_WATER then
|
||||
spawnPoint = tPoint
|
||||
@@ -603,9 +604,6 @@ do
|
||||
AAtype = Range.AATypes.AAA
|
||||
end
|
||||
end
|
||||
-- Utils.Debug('typeName: '..targetDesc['typeName'])
|
||||
-- Utils.Debug(' AAtype: '..AAtype)
|
||||
-- Utils.Debug(targetDesc.attributes)
|
||||
|
||||
self.targetPresets[targetType] = self.targetPresets[targetType] or {}
|
||||
self.targetPresets[targetType][AAtype] = self.targetPresets[targetType][AAtype] or {}
|
||||
@@ -714,14 +712,10 @@ do
|
||||
for i=1,20,1 do
|
||||
local unit = Unit.getByName('test-'..i..'-1')
|
||||
if unit then
|
||||
-- local desc = unit:getDesc()
|
||||
-- Utils.Debug(desc['typeName']..' desc:')
|
||||
-- Utils.Debug(desc.attributes)
|
||||
range1:addTargetPreset(unit)
|
||||
end
|
||||
end
|
||||
|
||||
-- Utils.Debug(range1.targetPresets)
|
||||
end
|
||||
|
||||
-- local group = Group.getByName('Buta_target')
|
||||
|
||||
Reference in New Issue
Block a user