Skip to content

Commit

Permalink
Added some more alternative entity names
Browse files Browse the repository at this point in the history
Renamed Bounce Block -> Core Block, as its more used
Kept Bounce Block as alternative name
Watchtowers now also show up with Binoculars and Lookout
Fixed alternative names not working with multiple names
  • Loading branch information
Cruor committed Jul 10, 2023
1 parent 78f518d commit c5d22e7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/entities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -930,10 +930,9 @@ local function getAlternativeDisplayNames(placementInfo, name, language)
local result = {}

for _, altName in ipairs(alternativeName) do
local displayName = getPlacementLanguage(language, name, alternativeName, "name")
local displayName = getPlacementLanguage(language, name, altName, "name")

if displayName then
print(type(displayName), displayName)
table.insert(result, displayName)
end
end
Expand Down
1 change: 1 addition & 0 deletions src/entities/bounce_block.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ bounceBlock.minimumSize = {16, 16}
bounceBlock.placements = {
{
name = "fire",
alternativeName = "fire_bounce",
data = {
width = 16,
height = 16,
Expand Down
1 change: 1 addition & 0 deletions src/entities/watchtower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ watchtower.texture = "objects/lookout/lookout05"
watchtower.nodeLimits = {0, -1}
watchtower.placements = {
name = "watchtower",
alternativeName = {"lookout", "binoculars"},
data = {
summit = false,
onlyY = false
Expand Down
5 changes: 4 additions & 1 deletion src/lang/en_gb.lang
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ entities.trackSpinner.attributes.description.star=Turns the visual appearance of

# Watchtower
entities.towerviewer.placements.name.watchtower=Watchtower
entities.towerviewer.placements.name.lookout=Lookout
entities.towerviewer.placements.name.binoculars=Binoculars
entities.towerviewer.attributes.description.summit=Whether the watch tower should zoom on the final node or not. Requires nodes to function, otherwise game will crash.
entities.towerviewer.attributes.description.onlyY=Whether the watch tower can only move vertically. If the watch tower has nodes it will still follow them.

Expand All @@ -393,7 +395,8 @@ entities.wallBooster.attributes.description.left=Whether the entity attaches to
entities.wallBooster.attributes.description.notCoreMode=Determines whether the entity should ignore the current core mode and default to ice variant.

# Bounce Block
entities.bounceBlock.placements.name.fire=Bounce Block
entities.bounceBlock.placements.name.fire=Core Block
entities.bounceBlock.placements.name.fire_bounce=Bounce Block
entities.bounceBlock.placements.name.ice=Ice Crumble Block
entities.bounceBlock.attributes.description.notCoreMode=Determines whether the entity should ignore the current core mode and default to ice variant.

Expand Down
3 changes: 1 addition & 2 deletions src/triggers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,9 @@ local function getAlternativeDisplayNames(placementInfo, name, language)
local result = {}

for _, altName in ipairs(alternativeName) do
local displayName = getPlacementLanguage(language, name, alternativeName, "name")
local displayName = getPlacementLanguage(language, name, altName, "name")

if displayName then
print(type(displayName), displayName)
table.insert(result, displayName)
end
end
Expand Down

0 comments on commit c5d22e7

Please sign in to comment.