Skip to content

Commit

Permalink
Remove unnecessary global variables #178
Browse files Browse the repository at this point in the history
  • Loading branch information
KiwiHawk committed May 20, 2024
1 parent 5fafdc2 commit f3bcf07
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
5 changes: 5 additions & 0 deletions bobassembly/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 1.3.0
Date: ???
Changes:
- Code tidy: Remove unnecessary global variables #178
---------------------------------------------------------------------------------------------------
Version: 1.2.2
Date: 21. 02. 2024
Changes:
Expand Down
2 changes: 1 addition & 1 deletion bobassembly/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bobassembly",
"version": "1.2.2",
"version": "1.3.0",
"factorio_version": "1.1",
"title": "Bob's Assembling machines mod",
"author": "Bobingabout",
Expand Down
6 changes: 3 additions & 3 deletions bobassembly/prototypes/chemical-plant-updates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ if settings.startup["bobmods-assembly-chemicalplants"].value == true then
data.raw["assembling-machine"]["chemical-plant"].icon_size = 32
data.raw["assembling-machine"]["chemical-plant"].icon_mipmaps = nil
data.raw["assembling-machine"]["chemical-plant"].animation =
bob_chemical_plant_animation({ r = 0.7, g = 0.2, b = 0.1 })
bobmods.bob_chemical_plant_animation({ r = 0.7, g = 0.2, b = 0.1 })
-- data.raw["assembling-machine"]["chemical-plant"].working_visualisations = bob_chemical_plant_working_visualisations()

data.raw.item["chemical-plant-2"].icon = "__bobassembly__/graphics/icons/new-colors/chemical-plant-2.png"
Expand All @@ -100,13 +100,13 @@ if settings.startup["bobmods-assembly-chemicalplants"].value == true then
"__bobassembly__/graphics/icons/new-colors/chemical-plant-2.png"
data.raw["assembling-machine"]["chemical-plant-2"].icon_size = 32
data.raw["assembling-machine"]["chemical-plant-2"].animation =
bob_chemical_plant_animation({ r = 0.1, g = 0.5, b = 0.7 })
bobmods.bob_chemical_plant_animation({ r = 0.1, g = 0.5, b = 0.7 })

data.raw.item["chemical-plant-3"].icon = "__bobassembly__/graphics/icons/chemical-plant-2.png"
data.raw.item["chemical-plant-3"].icon_size = 32
data.raw["assembling-machine"]["chemical-plant-3"].icon = "__bobassembly__/graphics/icons/chemical-plant-2.png"
data.raw["assembling-machine"]["chemical-plant-3"].icon_size = 32
data.raw["assembling-machine"]["chemical-plant-3"].animation =
bob_chemical_plant_animation({ r = 0.7, g = 0.1, b = 0.7 })
bobmods.bob_chemical_plant_animation({ r = 0.7, g = 0.1, b = 0.7 })
end
end
18 changes: 9 additions & 9 deletions bobassembly/prototypes/chemical-plant.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if settings.startup["bobmods-assembly-chemicalplants"].value == true then
data.raw.item["chemical-plant"].subgroup = "bob-chemical-machine"
data.raw.item["chemical-plant"].order = "e[chemical-plant-1]"

function bob_chemical_plant_old_facing(tint, x)
local function bob_chemical_plant_old_facing(tint, x)
return {
layers = {
{
Expand Down Expand Up @@ -70,7 +70,7 @@ if settings.startup["bobmods-assembly-chemicalplants"].value == true then
}
end

function bob_chemical_plant_old_animation(tint)
local function bob_chemical_plant_old_animation(tint)
return {
north = bob_chemical_plant_old_facing(tint, 0),
east = bob_chemical_plant_old_facing(tint, 1),
Expand All @@ -79,7 +79,7 @@ if settings.startup["bobmods-assembly-chemicalplants"].value == true then
}
end

function bob_chemical_plant_old_working_visualisations()
local function bob_chemical_plant_old_working_visualisations()
return {
{
north_position = util.by_pixel(30, -24),
Expand Down Expand Up @@ -186,7 +186,7 @@ if settings.startup["bobmods-assembly-chemicalplants"].value == true then
}
end

function bob_chemical_plant_fluid_boxes()
local function bob_chemical_plant_fluid_boxes()
return {
{
production_type = "input",
Expand Down Expand Up @@ -217,7 +217,7 @@ if settings.startup["bobmods-assembly-chemicalplants"].value == true then
}
end

function bob_chemical_plant_facing(tint, offset)
local function bob_chemical_plant_facing(tint, offset)
return {
layers = {
{
Expand Down Expand Up @@ -306,7 +306,7 @@ if settings.startup["bobmods-assembly-chemicalplants"].value == true then
}
end

function bob_chemical_plant_animation(tint)
function bobmods.bob_chemical_plant_animation(tint)
return {
north = bob_chemical_plant_facing(tint, 0),
east = bob_chemical_plant_facing(tint, 1),
Expand Down Expand Up @@ -417,7 +417,7 @@ if settings.startup["bobmods-assembly-chemicalplants"].value == true then
},
crafting_categories = { "chemistry" },
fluid_boxes = bob_chemical_plant_fluid_boxes(),
animation = bob_chemical_plant_animation({ r = 0.5, g = 0.1, b = 0.7 }),
animation = bobmods.bob_chemical_plant_animation({ r = 0.5, g = 0.1, b = 0.7 }),
working_visualisations = data.raw["assembling-machine"]["chemical-plant"].working_visualisations,
working_sound = data.raw["assembling-machine"]["chemical-plant"].working_sound,
vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
Expand Down Expand Up @@ -451,7 +451,7 @@ if settings.startup["bobmods-assembly-chemicalplants"].value == true then
},
crafting_categories = { "chemistry" },
fluid_boxes = bob_chemical_plant_fluid_boxes(),
animation = bob_chemical_plant_animation({ r = 0.7, g = 0.2, b = 0.1 }),
animation = bobmods.bob_chemical_plant_animation({ r = 0.7, g = 0.2, b = 0.1 }),
working_visualisations = data.raw["assembling-machine"]["chemical-plant"].working_visualisations,
working_sound = data.raw["assembling-machine"]["chemical-plant"].working_sound,
vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
Expand Down Expand Up @@ -485,7 +485,7 @@ if settings.startup["bobmods-assembly-chemicalplants"].value == true then
},
crafting_categories = { "chemistry" },
fluid_boxes = bob_chemical_plant_fluid_boxes(),
animation = bob_chemical_plant_animation({ r = 0.1, g = 0.7, b = 0.1 }),
animation = bobmods.bob_chemical_plant_animation({ r = 0.1, g = 0.7, b = 0.1 }),
working_visualisations = data.raw["assembling-machine"]["chemical-plant"].working_visualisations,
working_sound = data.raw["assembling-machine"]["chemical-plant"].working_sound,
vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
Expand Down

0 comments on commit f3bcf07

Please sign in to comment.