Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions common/upgets/api_resource_spot_finder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,28 @@ local function GetSpotsGeo()
end
end
local spots = {}
local seen = {}
local features = Spring.GetAllFeatures()
local spotCount = 0
for i = 1, #features do
if geoFeatureDefs[Spring.GetFeatureDefID(features[i])] then
local x, y, z = Spring.GetFeaturePosition(features[i])
spotCount = spotCount + 1
spots[spotCount] = {
isGeo = true,
x = GetFootprintPos(x),
y = y,
z = GetFootprintPos(z),
minX = GetFootprintPos(x) - (precision / 2),
maxX = GetFootprintPos(x) + (precision / 2),
minZ = GetFootprintPos(z) - (precision / 2),
maxZ = GetFootprintPos(z) + (precision / 2),
}
-- some maps place each vent twice (SMF and LuaGaia featureplacer, e.g. Delta Siege Dry)
local key = GetFootprintPos(x) * 65536 + GetFootprintPos(z)
if not seen[key] then
seen[key] = true
spotCount = spotCount + 1
spots[spotCount] = {
isGeo = true,
x = GetFootprintPos(x),
y = y,
z = GetFootprintPos(z),
minX = GetFootprintPos(x) - (precision / 2),
maxX = GetFootprintPos(x) + (precision / 2),
minZ = GetFootprintPos(z) - (precision / 2),
maxZ = GetFootprintPos(z) + (precision / 2),
}
end
end
end
return spots
Expand Down
39 changes: 30 additions & 9 deletions language/en/interface.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,12 @@
"profileDesc": " ",
"all": "All",
"you": "You",
"youGrouped": "\"Group by team\" toggle is on: this picks your whole team. Turn it off to pick yourself alone.",
"shareOne": "% of total is on, but only one player or team is on the chart - all of its own total - so it keeps its line until there are more.",
"hideUnselected": "Remove unselected",
"hideUnselectedDesc": "Removes data from players/teams data that currently aren't in the selection.",
"allHint": "Include all players+teams into the selection.",
"allMilestones": "Every team's milestones go on the chart.",
"none": "None",
"noneHint": "Take every player and team out of the selection, then click the ones to show.",
"teams": "%{count} teams",
"players": "%{count} players",
"state": {
Expand All @@ -487,10 +487,8 @@
"faded": "Not selected: faded behind the selected.",
"left": "Not selected: removed from the chart by Remove unselected.",
"notCounted": "Not selected: left out of the composition.",
"alike": "Nothing is selected: every team is drawn alike.",
"allCounted": "Nothing is selected: every team is counted in the composition.",
"milestones": "Its milestones are on the chart.",
"milestonesGroup": "Their milestones are on the chart.",
"alike": "Every team is selected: all drawn alike.",
"allCounted": "Every team is selected: all counted in the composition.",
"grouped": "\"Group by team\" toggle is on: a team's players share one line. Turn it off to pick them one by one."
},
"control": {
Expand Down Expand Up @@ -593,9 +591,11 @@
"defaultName": "My graphs %{number}",
"perGraphOpen": "For this graph only: it keeps what you set here.",
"perGraphGrid": "Every graph in a custom category keeps its own: open one to set it.",
"groupAll": "Here it sets every graph of this category; an opened graph can keep its own.",
"addTo": "Add to…",
"addToDesc": "Puts this graph, drawn the way it is now, into a category of your own - or a new one.",
"newCategory": "New category",
"newCategoryDesc": "Make a category of your own, then open any graph and use Add to… to fill it.",
"rename": "Rename",
"moveUp": "Move up",
"moveDown": "Move down",
Expand All @@ -611,18 +611,39 @@
"overviewHint": "Ships with the game, and yours to change: \nOpen a graph... Click the Add to… button to add to your (custom) overview.\nRight-click a graph to rename, move or reset it.",
"graphHint": "Drag it to another place in this category. Right-click to move it or take it out."
},
"section": {
"tables": "Tables",
"graphs": "Graphs"
},
"tables": {
"summary": "Summary",
"summaryDesc": "How the game has gone so far, a row per player.",
"columns": "Columns…",
"columnsDesc": "Pick which stats this table shows. Drag a column's caption to move it; right-click it to move or remove it.",
"cardHint": "Click a stat to add it or take it out",
"full": "The table is full: take a column out to add another",
"captionHint": "Click to sort. Drag to move the column; right-click to move or remove it.",
"shippedHint": "Right-click to rename or move it, or put its columns back as they were.",
"ownDesc": "A table of your own.",
"ownHint": "Right-click to rename, move or delete it.",
"defaultName": "My table %{number}",
"newTable": "New table",
"newTableDesc": "Make a table of your own and pick the stats it shows.",
"empty": "Nothing here yet: pick its stats with the Columns… button above.",
"moveLeft": "Move left",
"moveRight": "Move right",
"remove": "Remove column"
},
"switch": {
"thisGraph": "This graph",
"graphs": "Graphs",
"graphsDesc": "Display graphs instead of tables",
"groupByTeam": "Group by team",
"groupByTeamDesc": "Combine all players under their team as a single entity",
"shareOfTotal": "% of total",
"shareOfTotalDesc": "Y-axis displays percentage of total",
"bars": "Bars",
"barsDesc": "A bar behind every number, scaled to the largest in its column.",
"vsMe": "vs. me",
"vsMeDesc": "Every number as the difference from your own: green where a team is doing better than you, red where it is worse. Your own row keeps its numbers, and so do the teams' totals against your team's. Spectating, the team you are watching is yours.",
"vsMeDesc": "Every number as the difference from your own: green where a team is doing better than you, red where it is worse. Your own row keeps its numbers, and so do the teams' totals against your team's. Once you are out of the game your team is still the one you played; a spectator who never played has nothing to compare with.",
"trend": "Trend",
"trendDesc": "A small line beside every number: how it moved over the game, every team against the same scale. A running total shows the pace it rose at, so a cell says how it is going, not only where it stands.",
"milestones": "Milestones",
Expand Down
8 changes: 7 additions & 1 deletion luarules/gadgets/api_teamstats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -904,10 +904,16 @@
end
end
local features = spGetAllFeatures()
local seen = {}
for i = 1, #features do
if vents[spGetFeatureDefID(features[i])] then
local x, _, z = spGetFeaturePosition(features[i])
found.geo[#found.geo + 1] = { x = x, z = z }
-- some maps place each vent twice (SMF and LuaGaia featureplacer)
local key = x * 65536 + z

Check warning on line 912 in luarules/gadgets/api_teamstats.lua

View workflow job for this annotation

GitHub Actions / emmylua_check

need-check-nil

z value may be nil

Check warning on line 912 in luarules/gadgets/api_teamstats.lua

View workflow job for this annotation

GitHub Actions / emmylua_check

need-check-nil

x value may be nil
if not seen[key] then
seen[key] = true
found.geo[#found.geo + 1] = { x = x, z = z }
end
end
end
spots = found
Expand Down
Loading
Loading