Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiplacon authored Oct 22, 2022
1 parent 6ee0fd6 commit a3c76aa
Show file tree
Hide file tree
Showing 16 changed files with 288 additions and 75 deletions.
27 changes: 27 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
---------------------------------------------------------------------------------------------------
Version: 1.1.8
Date: 10/22/2022
Bugfixes:
- Fixed a startup crash when disabling certain parts of the mod because I had arranged them wrong in the code. Reported by modo_lv
- Fixed a crash when using the Zipline Terminal when joining an existing save or updating from certain past versions because I had an AND check instead of an OR check. Reported by Marc-Harony
---------------------------------------------------------------------------------------------------
Version: 1.1.7
Date: 10/1/2022
Bugfixes:
- Fixed a crash when using the zipline terminal on a new save because I missed creating a certain value for new players. Reported by JJQ
---------------------------------------------------------------------------------------------------
Version: 1.1.6
Date: 9/19/2022
Bugfixes:
- Fixed that whether the personal roboport was on or off was not transferred between getting on/off zipines. Reported by Roy192
---------------------------------------------------------------------------------------------------
Version: 1.1.5
Date: 9/17/2022
Changes:
- Added options for the Zipline Terminal selection list to show camera, minimap or none.
- Removed the fixed width of the Zipline Terminal GUI
Bugfixes:
- Hopefully fixed a crash with the 1.1.2 migration. Reported by arkenstone007
- Changed the zipline trolley recipes to actually be locked until researched
- Fixed locale for Bounce Pads of 5 and 15 tile bounce range
- Fixed that whether logistics request was on or off was not transferred between getting on/off zipines
---------------------------------------------------------------------------------------------------
Version: 1.1.4
Date: 9/13/2022
Bugfixes:
Expand Down
7 changes: 3 additions & 4 deletions data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,15 @@ if (settings.startup["RTTrainRampSetting"].value == true) then
require("prototypes.TrainGoBrrrr.prototypes.ramps")
require("prototypes.TrainGoBrrrr.sprites.base")
require("prototypes.TrainGoBrrrr.GhostLoco")
if (settings.startup["RTImpactSetting"].value == true) then
require("prototypes.TrainGoBrrrr.ImpactWagon")
end
end

if (settings.startup["RTZiplineSetting"].value == true) then
require("prototypes.zipline")
end

if (settings.startup["RTImpactSetting"].value == true) then
require("prototypes.TrainGoBrrrr.ImpactWagon")
end


data:extend({
{
Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "RenaiTransportation",
"version": "1.1.4",
"version": "1.1.8",
"title": "Renai Transportation",
"author": "Kiplacon",
"factorio_version": "1.1",
Expand Down
4 changes: 4 additions & 0 deletions locale/en/config.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[entity-name]
BouncePlate=Bounce Pad
BouncePlate5=Bounce Pad
BouncePlate15=Bounce Pad
PrimerBouncePlate=Precise Primer Bounce Pad
PrimerSpreadBouncePlate=Spread Primer Bounce Pad
SignalBouncePlate=Signal Bounce Pad
DirectedBouncePlate=Directed Bounce Pad
DirectedBouncePlate5=Directed Bounce Pad
DirectedBouncePlate15=Directed Bounce Pad
DirectorBouncePlate=Director Bounce Pad

OpenContainer=Open Chest
Expand Down
12 changes: 7 additions & 5 deletions migrations/RT-1.1.2.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
for each, terminalStuff in pairs(global.ZiplineTerminals) do
if (terminalStuff.entity.valid) then
terminalStuff.tag = terminalStuff.entity.force.add_chart_tag(terminalStuff.entity.surface, {position=terminalStuff.entity.position, text=terminalStuff.name, icon={type="item", name="RTZiplineTerminalItem"}})
else
global.ZiplineTerminals[each] = nil
if (global.ZiplineTerminals) then
for each, terminalStuff in pairs(global.ZiplineTerminals) do
if (terminalStuff.entity.valid) then
terminalStuff.tag = terminalStuff.entity.force.add_chart_tag(terminalStuff.entity.surface, {position=terminalStuff.entity.position, text=terminalStuff.name, icon={type="item", name="RTZiplineTerminalItem"}})
else
global.ZiplineTerminals[each] = nil
end
end
end
3 changes: 3 additions & 0 deletions migrations/RT-1.1.5.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
for ThePlayer, TheirProperties in pairs(global.AllPlayers) do
TheirProperties.preferences = {}
end
22 changes: 22 additions & 0 deletions migrations/RT-1.1.7.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
for ThePlayer, TheirProperties in pairs(global.AllPlayers) do
if (TheirProperties.preferences == nil) then
TheirProperties.preferences = {}
end
if (TheirProperties.state == nil) then
TheirProperties.state = "default"
end
if (TheirProperties.PlayerLauncher == nil) then
TheirProperties.PlayerLauncher={}
end
if (TheirProperties.zipline == nil) then
TheirProperties.zipline = {}
end
if (TheirProperties.RangeAdjusting == nil) then
TheirProperties.RangeAdjusting = false
end
if (TheirProperties.SettingRampRange == nil) then
TheirProperties.SettingRampRange = {SettingRange=false}
end
end

--{state="default", PlayerLauncher={}, zipline={}, RangeAdjusting=false, SettingRampRange={SettingRange=false}, GUI={}, preferences={}}
67 changes: 33 additions & 34 deletions prototypes/technology.lua
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,39 @@ if (settings.startup["RTTrainRampSetting"].value == true) then
}
}
})


if (settings.startup["RTImpactSetting"].value == true) then
data:extend({
{
type = "technology",
name = "RTImpactTech",
icon = "__RenaiTransportation__/graphics/tech/Impact.png",
icon_size = 128,
effects =
{
{
type = "unlock-recipe",
recipe = "RTImpactWagonRecipe"
},
{
type = "unlock-recipe",
recipe = "RTImpactUnloaderRecipe"
}
},
prerequisites = {"se~no", "railway", "concrete", "advanced-electronics"},
unit =
{
count = 200,
ingredients =
{
{"automation-science-pack", 1},
{"logistic-science-pack", 1}
},
time = 45
}
}
})
end

if (settings.startup["RTThrowersSetting"].value == true and settings.startup["RTTrainBounceSetting"].value == true) then
data:extend({
Expand Down Expand Up @@ -574,36 +606,3 @@ if (settings.startup["RTZiplineSetting"].value == true) then
},
})
end

if (settings.startup["RTImpactSetting"].value == true) then
data:extend({
{
type = "technology",
name = "RTImpactTech",
icon = "__RenaiTransportation__/graphics/tech/Impact.png",
icon_size = 128,
effects =
{
{
type = "unlock-recipe",
recipe = "RTImpactWagonRecipe"
},
{
type = "unlock-recipe",
recipe = "RTImpactUnloaderRecipe"
}
},
prerequisites = {"se~no", "railway", "concrete", "advanced-electronics"},
unit =
{
count = 200,
ingredients =
{
{"automation-science-pack", 1},
{"logistic-science-pack", 1}
},
time = 45
}
}
})
end
8 changes: 4 additions & 4 deletions prototypes/zipline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ data:extend({
{ --------- zipline recipie ----------
type = "recipe",
name = "RTZiplineRecipe2",
enabled = true,
enabled = false,
energy_required = 0.5,
ingredients =
{
Expand Down Expand Up @@ -354,7 +354,7 @@ data:extend({
{ --------- zipline recipie ----------
type = "recipe",
name = "RTZiplineRecipe3",
enabled = true,
enabled = false,
energy_required = 0.5,
ingredients =
{
Expand Down Expand Up @@ -404,7 +404,7 @@ data:extend({
{ --------- zipline recipie ----------
type = "recipe",
name = "RTZiplineRecipe4",
enabled = true,
enabled = false,
energy_required = 0.5,
ingredients =
{
Expand Down Expand Up @@ -454,7 +454,7 @@ data:extend({
{ --------- zipline recipie ----------
type = "recipe",
name = "RTZiplineRecipe5",
enabled = true,
enabled = false,
energy_required = 0.5,
ingredients =
{
Expand Down
73 changes: 51 additions & 22 deletions script/GUIs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,34 @@ function ShowZiplineTerminalGUI(player, clicked)
if (player.gui.center.RTZiplineTerminalGUI) then
player.gui.center.RTZiplineTerminalGUI.destroy()
end
local PlayerProperties = global.AllPlayers[player.index]
player.gui.center.add{type="frame", name="RTZiplineTerminalGUI", direction="vertical", tags={ID=clicked.unit_number}}
add_titlebar(player.gui.center.RTZiplineTerminalGUI, {"zipline-stuff.select"}, "stigma")
local TerminalHeader = player.gui.center.RTZiplineTerminalGUI.add{type="table", name="TerminalHeader", column_count=3}
local ttt = TerminalHeader.add{type="label", caption={"zipline-stuff.terminal"}}
ttt.style.font = "heading-1"
TerminalHeader.add{type="label", name="TerminalName", caption=global.ZiplineTerminals[clicked.unit_number].name}.style.font = "heading-1"
TerminalHeader.add{
type = "sprite-button",
style = "frame_action_button",
sprite = "utility/rename_icon_small_white",
hovered_sprite = "utility/rename_icon_small_black",
clicked_sprite = "utility/rename_icon_small_black",
tooltip = {"zipline-stuff.rename"},
tags = {RTEffect="RTStartRenameTerminal"}
}
if (clicked.name == "RTZiplineTerminal") then
local TerminalHeader = player.gui.center.RTZiplineTerminalGUI.add{type="table", name="TerminalHeader", column_count=3}
local ttt = TerminalHeader.add{type="label", caption={"zipline-stuff.terminal"}}
ttt.style.font = "heading-1"
TerminalHeader.add{type="label", name="TerminalName", caption=global.ZiplineTerminals[clicked.unit_number].name}.style.font = "heading-1"
TerminalHeader.add{
type = "sprite-button",
style = "frame_action_button",
sprite = "utility/rename_icon_small_white",
hovered_sprite = "utility/rename_icon_small_black",
clicked_sprite = "utility/rename_icon_small_black",
tooltip = {"zipline-stuff.rename"},
tags = {RTEffect="RTStartRenameTerminal"}
}

------------- preview selection
local PreviewHeader = player.gui.center.RTZiplineTerminalGUI.add{type="table", name="PreviewHeader", column_count=3}
PreviewHeader.add{type="button", name="cam", caption="Camera", tags={RTEffect="ZiplineCamera"}}
PreviewHeader.add{type="button", name="map", caption="Minimap", tags={RTEffect="ZiplineMinimap"}}
PreviewHeader.add{type="button", name="none", caption="None", tags={RTEffect="ZiplineNone"}}
end

local scroller = player.gui.center.RTZiplineTerminalGUI.add{type="scroll-pane", name="scroller"}
scroller.style.height = 700
scroller.style.width = 315
--scroller.style.width = 315
local layout = scroller.add{type="table", name="layout", column_count=2}
local a = {}
for each, terminal in pairs(global.ZiplineTerminals) do
Expand All @@ -66,14 +76,33 @@ function ShowZiplineTerminalGUI(player, clicked)
for each, terminal in pairs(sorted) do
local entity = terminal.entity
if (entity.valid == true and entity.electric_network_id == clicked.electric_network_id and entity.unit_number ~= clicked.unit_number) then
local TerminalButton = layout.add{type="button", name=each, caption=terminal.name, tags={RTEffect="ZiplineAutoPath", start=clicked.unit_number, finish=entity.unit_number}}
TerminalButton.style.font = "heading-1"
TerminalButton.style.horizontally_stretchable = true
local cam = layout.add{type="camera", caption="caption", position=entity.position, zoom=0.4}
cam.style.width = 175
cam.style.height = 175
layout.add{type="line"}
layout.add{type="line"}
if (PlayerProperties.preferences == nil or PlayerProperties.preferences.ZiplineTerminalPreview == nil or PlayerProperties.preferences.ZiplineTerminalPreview == "camera") then
if (PlayerProperties.preferences == nil) then
PlayerProperties.preferences = {}
end
local TerminalButton = layout.add{type="button", name=each, caption=terminal.name, tags={RTEffect="ZiplineAutoPath", start=clicked.unit_number, finish=entity.unit_number}}
TerminalButton.style.font = "heading-1"
TerminalButton.style.horizontally_stretchable = true
local cam = layout.add{type="camera", caption="caption", position=entity.position, zoom=0.4}
cam.style.width = 175
cam.style.height = 175
layout.add{type="line"}
layout.add{type="line"}
elseif (PlayerProperties.preferences.ZiplineTerminalPreview == "minimap") then
local TerminalButton = layout.add{type="button", name=each, caption=terminal.name, tags={RTEffect="ZiplineAutoPath", start=clicked.unit_number, finish=entity.unit_number}}
TerminalButton.style.font = "heading-1"
TerminalButton.style.horizontally_stretchable = true
local cam = layout.add{type="minimap", caption="caption", position=entity.position, zoom=1}
cam.style.width = 175
cam.style.height = 175
layout.add{type="line"}
layout.add{type="line"}
elseif (PlayerProperties.preferences.ZiplineTerminalPreview == "none") then
local TerminalButton = layout.add{type="button", name=each, caption=terminal.name, tags={RTEffect="ZiplineAutoPath", start=clicked.unit_number, finish=entity.unit_number}}
TerminalButton.style.font = "heading-1"
TerminalButton.style.horizontally_stretchable = true
layout.add{type="label", caption=""}
end
elseif (entity.valid == false) then
global.ZiplineTerminals[each] = nil
end
Expand Down
4 changes: 3 additions & 1 deletion script/MiscFunctions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ function SwapToGhost(player)
"character_loot_pickup_distance_bonus",
"character_trash_slot_count_bonus",
"character_maximum_following_robot_count_bonus",
"character_health_bonus"
"character_health_bonus",
"character_personal_logistic_requests_enabled",
"allow_dispatching_robots"
}
for each, modifier in pairs(CharacterModifiers) do
NEWHOST[modifier] = OG[modifier]
Expand Down
Loading

0 comments on commit a3c76aa

Please sign in to comment.