1
0
mirror of https://github.com/Wyrrrd/Rocket_Turrets.git synced 2026-03-25 23:29:49 +01:00

Added dynamic tips&tricks page

Also:
- removed redundant wikimod integrations
- maintenance
This commit is contained in:
Wyrrrd
2022-08-10 15:40:34 +02:00
parent 323f0272d2
commit 458dfd619e
25 changed files with 122 additions and 287 deletions

View File

@@ -1,79 +0,0 @@
local rocketturrets_thread =
{
name = {"rocketturrets.menu_rocketturrets"},
specified_version = 0,
topics =
{
{
name = {"rocketturrets.title_rocketturrets"},
topic =
{
{type = "image", spritename = "booktorio-cover"},
{type = "text", text = "info.text_intro"}
}
},
{
name = {"info.heading_turrets"},
topic =
{
{type = "title", title = {"info.heading_turrets"}},
{type = "image", spritename = "booktorio-turrets"},
{type = "text", text = "info.text_turrets"}
}
},
{
name = {"info.heading_ammo"},
topic =
{
{type = "title", title = {"info.heading_ammo"}},
{type = "image", spritename = "booktorio-ammo"},
{type = "text", text = "info.text_ammo"}
}
}
}
}
local rocketturrets_bob_thread =
{
name = {"rocketturrets.menu_rocketturrets"},
specified_version = 0,
topics =
{
{
name = {"rocketturrets.title_rocketturrets"},
topic =
{
{type = "image", spritename = "booktorio-cover-bob"},
{type = "text", text = "info.text_intro"}
}
},
{
name = {"info.heading_turrets"},
topic =
{
{type = "image", spritename = "booktorio-turrets-bob"},
{type = "text", text = "info.text_turrets_bob"}
}
},
{
name = {"info.heading_ammo"},
topic =
{
{type = "image", spritename = "booktorio-ammo"},
{type = "text", text = "info.text_ammo"}
}
}
}
}
local function registerThread()
if remote.interfaces["Booktorio"] then
remote.call("Booktorio", "add_thread", rocketturrets_thread)
if script.active_mods["bobwarfare"] then
remote.call("Booktorio", "override_thread", rocketturrets_bob_thread)
end
end
end
script.on_init(registerThread)
script.on_configuration_changed(registerThread)

View File

@@ -1,45 +0,0 @@
if mods["Booktorio"] then
data:extend(
{
{
type = "sprite",
name = "booktorio-ammo",
filename = "__Rocket_Turrets__/graphics/info/ammo.png",
width = 104,
height = 64,
scale = 1
},
{
type = "sprite",
name = "booktorio-cover",
filename = "__Rocket_Turrets__/graphics/info/cover.png",
width = 360,
height = 264,
scale = 1
},
{
type = "sprite",
name = "booktorio-cover-bob",
filename = "__Rocket_Turrets__/graphics/info/cover_bob.png",
width = 360,
height = 264,
scale = 1
},
{
type = "sprite",
name = "booktorio-turrets",
filename = "__Rocket_Turrets__/graphics/info/turrets.png",
width = 154,
height = 154,
scale = 1
},
{
type = "sprite",
name = "booktorio-turrets-bob",
filename = "__Rocket_Turrets__/graphics/info/turrets_bob.png",
width = 698,
height = 154,
scale = 1
}
})
end

View File

@@ -1,9 +1,5 @@
require("integrations.bobplates.ingredients")
local add_prerequisite = function (tech, prereq)
table.insert(data.raw.technology[tech].prerequisites,prereq)
end
if mods["bobplates"] and mods["bobwarfare"] then
-- if bobplates enabled, change tiered turret recipes and tech (if existing)

View File

@@ -16,10 +16,43 @@ if mods["bobwarfare"] then
data.raw["ammo-turret"]["rocket-turret"].preparing_animation.layers[1].hr_version["filename"] = "__Rocket_Turrets__/graphics/entity/hr-rocket-mk1-sheet.png"
data.raw["ammo-turret"]["rocket-turret"].attacking_animation.layers[1].filename = "__Rocket_Turrets__/graphics/entity/rocket-mk1-sheet.png"
data.raw["ammo-turret"]["rocket-turret"].attacking_animation.layers[1].hr_version["filename"] = "__Rocket_Turrets__/graphics/entity/hr-rocket-mk1-sheet.png"
data.raw["ammo-turret"]["rocket-turret"].icon = "__Rocket_Turrets__/graphics/icon/turret-rocket-mk1-icon.png"
data.raw["ammo-turret"]["rocket-turret"].fast_replaceable_group = "turret"
data.raw["item"]["rocket-turret"].icon = "__Rocket_Turrets__/graphics/icon/turret-rocket-mk1-icon.png"
data.raw["technology"]["rocket-turret"].icon = "__Rocket_Turrets__/graphics/technology/rocket-turret-mk1.png"
-- if bobwarfare enabled, change tips&tricks page
data.raw["tips-and-tricks-item"]["rocketturrets"].image = "__Rocket_Turrets__/graphics/tips_modded.png"
data.raw["tips-and-tricks-item"]["rocketturrets"].name = "rocketturrets_modded"
data.raw["tips-and-tricks-item"]["rocketturrets"].trigger = {
type = "or",
triggers = {
{
type = "build-entity",
entity = "rocket-turret"
},
{
type = "build-entity",
entity = "rocket-turret-mk2"
},
{
type = "build-entity",
entity = "rocket-turret-mk3"
},
{
type = "build-entity",
entity = "rocket-turret-mk4"
},
{
type = "build-entity",
entity = "rocket-turret-mk5"
}
}
}
data.raw["tips-and-tricks-item"]["rocketturrets_modded"] = data.raw["tips-and-tricks-item"]["rocketturrets"]
data.raw["tips-and-tricks-item"]["rocketturrets"] = nil
-- if bobwarfare enabled, load tiered turrets
data:extend({

View File

@@ -1,36 +0,0 @@
if script.active_mods["informatron"] then
remote.add_interface("rocketturrets", {
informatron_menu = function(data)
return rocketturrets_menu(data.player_index)
end,
informatron_page_content = function(data)
return rocketturrets_page_content(data.page_name, data.player_index, data.element)
end
})
end
function rocketturrets_menu(player_index)
return {}
end
function rocketturrets_page_content(page_name, player_index, element)
if page_name == "rocketturrets" then
if script.active_mods["bobwarfare"] then
element.add{type="button", name="image_cover", style="informatron-cover-bob"}
element.add{type="label", name="text_intro", caption={"info.text_intro"}}
element.add{type="label", name="heading_turrets", caption={"info.heading_turrets"}, style="heading_1_label"}
element.add{type="button", name="image_turrets", style="informatron-turrets-bob"}
element.add{type="label", name="text_turrets", caption={"info.text_turrets_bob"}}
else
element.add{type="button", name="image_cover", style="informatron-cover"}
element.add{type="label", name="text_intro", caption={"info.text_intro"}}
element.add{type="label", name="heading_turrets", caption={"info.heading_turrets"}, style="heading_1_label"}
element.add{type="button", name="image_turrets", style="informatron-turrets"}
element.add{type="label", name="text_turrets", caption={"info.text_turrets"}}
end
-- the following is the same with and without bobplates
element.add{type="label", name="heading_ammo", caption={"info.heading_ammo"}, style="heading_1_label"}
element.add{type="button", name="image_ammo", style="informatron-ammo"}
element.add{type="label", name="text_ammo", caption={"info.text_ammo"}}
end
end

View File

@@ -1,7 +0,0 @@
if mods["informatron"] then
informatron_make_image("informatron-cover", "__Rocket_Turrets__/graphics/info/cover.png", 380, 264)
informatron_make_image("informatron-cover-bob", "__Rocket_Turrets__/graphics/info/cover_bob.png", 380, 264)
informatron_make_image("informatron-turrets", "__Rocket_Turrets__/graphics/info/turrets.png", 154, 154)
informatron_make_image("informatron-turrets-bob", "__Rocket_Turrets__/graphics/info/turrets_bob.png", 698, 154)
informatron_make_image("informatron-ammo", "__Rocket_Turrets__/graphics/info/ammo.png", 104, 64)
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 437 KiB

View File

@@ -1,17 +0,0 @@
require("integrations.wiki.wiki")
if script.active_mods["wiki"] then
local initialize_wiki
if script.active_mods["bobwarfare"] then
initialize_wiki = function()
remote.call("wiki","register_mod_wiki",rocketturrets_bob_wiki)
end
else
initialize_wiki = function()
remote.call("wiki","register_mod_wiki",rocketturrets_wiki)
end
end
script.on_init(initialize_wiki)
script.on_load(initialize_wiki)
end

View File

@@ -1,9 +0,0 @@
require("integrations.wiki.wiki")
if mods["wiki"] then
if mods["bobwarfare"] then
wiki_register_mod_wiki(rocketturrets_bob_wiki)
else
wiki_register_mod_wiki(rocketturrets_wiki)
end
end

View File

@@ -1,43 +0,0 @@
rocketturrets_wiki =
{
name = "Rocket_Turrets",
title = {"rocketturrets.menu_rocketturrets"},
mod_path = "__Rocket_Turrets__",
{
name = {"rocketturrets.title_rocketturrets"},
topic = {
{type = "image", name = "image_cover", filepath = "__Rocket_Turrets__/graphics/info/cover.png", width = 380, height = 264, scale = 0.95},
{type = "text", text = {"info.text_intro"} },
{type = "line"},
{type = "title", title = {"info.heading_turrets"} },
{type = "image", name = "image_turrets", filepath = "__Rocket_Turrets__/graphics/info/turrets.png", width = 154, height = 154, scale = 0.516},
{type = "text", text = {"info.text_turrets"} },
{type = "line"},
{type = "title", title = {"info.heading_ammo"} },
{type = "image", name = "image_ammo", filepath = "__Rocket_Turrets__/graphics/info/ammo.png", width = 104, height = 64, scale = 1},
{type = "text", text = {"info.text_ammo"} },
}
}
}
rocketturrets_bob_wiki =
{
name = "Rocket_Turrets",
title = {"rocketturrets.menu_rocketturrets"},
mod_path = "__Rocket_Turrets__",
{
name = {"rocketturrets.title_rocketturrets"},
topic = {
{type = "image", name = "image_cover", filepath = "__Rocket_Turrets__/graphics/info/cover_bob.png", width = 380, height = 264, scale = 0.95},
{type = "text", text = {"info.text_intro"} },
{type = "line"},
{type = "title", title = {"info.heading_turrets"} },
{type = "image", name = "image_turrets", filepath = "__Rocket_Turrets__/graphics/info/turrets_bob.png", width = 698, height = 154, scale = 0.516},
{type = "text", text = {"info.text_turrets_bob"} },
{type = "line"},
{type = "title", title = {"info.heading_ammo"} },
{type = "image", name = "image_ammo", filepath = "__Rocket_Turrets__/graphics/info/ammo.png", width = 104, height = 64, scale = 1},
{type = "text", text = {"info.text_ammo"} },
}
}
}