Skip to content

Commit 76abbf0

Browse files
committed
Electronics categories #424
1 parent 88fcbd8 commit 76abbf0

File tree

22 files changed

+110
-141
lines changed

22 files changed

+110
-141
lines changed

bobassembly/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Version: 2.0.2
33
Date: ???
44
Changes:
55
- Added uk locale #176
6+
- Reworked how electronics recipe categories are assigned #424
67
- Added zh-TW locale #432
78
---------------------------------------------------------------------------------------------------
89
Version: 2.0.1

bobassembly/info.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"contact": "",
88
"homepage": "https://forums.factorio.com/viewforum.php?f=51",
99
"dependencies": [
10-
"base >= 2.0.33",
11-
"boblibrary >= 2.0.0",
10+
"base >= 2.0.49",
11+
"boblibrary >= 2.0.1",
1212
"? bobplates >= 2.0.0"
1313
],
1414
"description": "Requires Bob's functions library mod\n\nThis mod adds assembling machines 4, 5 and 6, and updates the recipe for assembling machine 3 to fit my progression pattern.\nThe mod also adds higher tiers of Electric furnace, Chemical plant and Oil refinery.\nIt also includes the Electronic assembling machine chain, and additional tiers of machines added by Bob's Metals, Chemicals and Intermediates mod.\n\nDesigned to work best with my full mod pack.\nAll additional machine tiers other than assembling machines can be turned off in the mod options."

bobassembly/prototypes/assembly-electronics-updates.lua

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,26 +76,13 @@ if settings.startup["bobmods-assembly-electronicmachines"].value == true then
7676
end
7777

7878
-- add new electronics crafting categories
79-
if data.raw.player then
80-
bobmods.lib.machine.type_if_add_category("player", "crafting", "bob-electronics")
81-
elseif data.raw.character then
82-
bobmods.lib.machine.type_if_add_category("character", "crafting", "bob-electronics")
83-
end
84-
if data.raw["god-controller"] then
85-
bobmods.lib.machine.type_if_add_category("god-controller", "crafting", "bob-electronics")
86-
end
87-
bobmods.lib.machine.type_if_add_category("assembling-machine", "crafting", "bob-electronics")
88-
bobmods.lib.machine.type_if_add_category("assembling-machine", "crafting", "bob-electronics-machine")
89-
bobmods.lib.machine.type_if_add_category("assembling-machine", "crafting-with-fluid", "bob-electronics-with-fluid")
90-
91-
data.raw.recipe["copper-cable"].category = "bob-electronics"
92-
93-
data.raw.recipe["electronic-circuit"].category = "bob-electronics"
94-
data.raw.recipe["advanced-circuit"].category = "bob-electronics"
95-
data.raw.recipe["processing-unit"].category = "bob-electronics-machine"
79+
bobmods.lib.recipe.add_additional_category("copper-cable", "electronics")
80+
bobmods.lib.recipe.add_additional_category("electronic-circuit", "electronics")
81+
bobmods.lib.recipe.add_additional_category("advanced-circuit", "electronics")
82+
bobmods.lib.recipe.add_additional_category("processing-unit", "electronics")
9683

9784
if data.raw.recipe["bob-advanced-processing-unit"] then
98-
data.raw.recipe["bob-advanced-processing-unit"].category = "bob-electronics-machine"
85+
bobmods.lib.recipe.add_additional_category("bob-advanced-processing-unit", "electronics")
9986
end
10087
if data.raw.item["bob-advanced-processing-unit"] then
10188
bobmods.lib.recipe.replace_ingredient(

bobassembly/prototypes/assembly-electronics.lua

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,11 @@ if settings.startup["bobmods-assembly-electronicmachines"].value == true then
3030
data:extend({
3131
{
3232
type = "recipe-category",
33-
name = "bob-electronics",
33+
name = "electronics",
3434
},
3535
{
3636
type = "recipe-category",
37-
name = "bob-electronics-machine",
38-
},
39-
{
40-
type = "recipe-category",
41-
name = "bob-electronics-with-fluid",
37+
name = "electronics-with-fluid",
4238
},
4339
})
4440

@@ -156,7 +152,7 @@ if settings.startup["bobmods-assembly-electronicmachines"].value == true then
156152
},
157153
idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.6 },
158154
},
159-
crafting_categories = { "bob-electronics", "bob-electronics-machine", "bob-electronics-with-fluid" },
155+
crafting_categories = { "electronics", "electronics-with-fluid" },
160156
crafting_speed = 1,
161157
energy_source = {
162158
type = "electric",
@@ -331,7 +327,7 @@ if settings.startup["bobmods-assembly-electronicmachines"].value == true then
331327
},
332328
idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.6 },
333329
},
334-
crafting_categories = { "bob-electronics", "bob-electronics-machine", "bob-electronics-with-fluid" },
330+
crafting_categories = { "electronics", "electronics-with-fluid" },
335331
crafting_speed = 2.25,
336332
energy_source = {
337333
type = "electric",
@@ -512,7 +508,7 @@ if settings.startup["bobmods-assembly-electronicmachines"].value == true then
512508
},
513509
idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.6 },
514510
},
515-
crafting_categories = { "bob-electronics", "bob-electronics-machine", "bob-electronics-with-fluid" },
511+
crafting_categories = { "electronics", "electronics-with-fluid" },
516512
crafting_speed = 4,
517513
energy_source = {
518514
type = "electric",

bobclasses/info.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"contact": "",
88
"homepage": "https://forums.factorio.com/viewforum.php?f=51",
99
"dependencies": [
10-
"base >= 1.2.0",
11-
"boblibrary >= 2.0.0",
10+
"base >= 2.0.49",
11+
"boblibrary >= 2.0.1",
1212
"? bobplates >= 2.0.0",
1313
"? boblogistics >= 2.0.0"
1414
],

bobclasses/prototypes/recipe-updates.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ elseif data.raw.item["bob-aluminium-plate"] then
3434
bobmods.lib.tech.add_prerequisite("bob-bodies", "bob-aluminium-processing")
3535
end
3636

37-
if data.raw["recipe-category"]["bob-electronics"] then
38-
data.raw.recipe["bob-player-brain"].category = "bob-electronics"
39-
data.raw.recipe["bob-player-brain-2"].category = "bob-electronics"
40-
end
37+
bobmods.lib.recipe.add_additional_category("bob-player-brain", "electronics")
38+
bobmods.lib.recipe.add_additional_category("bob-player-brain-2", "electronics")
4139

4240
if data.raw.item["bob-solder"] then
4341
bobmods.lib.recipe.add_ingredient("bob-player-brain", { type = "item", name = "bob-solder", amount = 5 })

bobelectronics/data-updates.lua

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require("prototypes.recipe-updates")
22
require("prototypes.technology-updates")
33

4-
data.raw.recipe["copper-cable"].category = "bob-electronics"
54
data.raw.item["copper-cable"].subgroup = "bob-electronic-components"
65
data.raw.item["copper-cable"].order = "0-a1"
76

@@ -20,13 +19,6 @@ if data.raw["recipe-category"]["bob-mixing-furnace"] then
2019
end
2120
end
2221

23-
-- add new electronics crafting categories
24-
bobmods.lib.machine.type_if_add_category("character", "crafting", "bob-electronics")
25-
bobmods.lib.machine.type_if_add_category("god-controller", "crafting", "bob-electronics")
26-
bobmods.lib.machine.type_if_add_category("assembling-machine", "crafting", "bob-electronics")
27-
bobmods.lib.machine.type_if_add_category("assembling-machine", "crafting", "bob-electronics-machine")
28-
bobmods.lib.machine.type_if_add_category("assembling-machine", "crafting-with-fluid", "bob-electronics-with-fluid")
29-
3022
if mods["quality"] then
3123
bobmods.lib.recipe.update_recycling_recipe({
3224
"bob-basic-electronic-components",

bobelectronics/info.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"contact": "",
88
"homepage": "https://forums.factorio.com/viewforum.php?f=51",
99
"dependencies": [
10-
"base >= 1.2.0",
11-
"boblibrary >= 2.0.0",
10+
"base >= 2.0.49",
11+
"boblibrary >= 2.0.1",
1212
"? bobplates >= 2.0.0"
1313
],
1414
"description": "Requires Bob's functions library mod.\n\nThis mod changes the way you build electronics, making the process more realistic.\nFirst you have to assemble electronic components, then combine them into circuit boards.\nUnlike in the base game, each tier of circuit board does NOT require the previous tier.\nIt also adds a 4th tier of electronics used for high end machinery.\n\nAlthough it can work by itself, it is designed to function best with my entire set of mods installed."

bobelectronics/prototypes/category.lua

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
data:extend({
2-
{
3-
type = "recipe-category",
4-
name = "bob-electronics",
5-
},
6-
{
7-
type = "recipe-category",
8-
name = "bob-electronics-machine",
9-
},
10-
{
11-
type = "recipe-category",
12-
name = "bob-electronics-with-fluid",
13-
},
142
{
153
type = "item-subgroup",
164
name = "bob-resource",

bobelectronics/prototypes/electronics.lua

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if data.raw.item["bob-tin-plate"] then
3333
{
3434
type = "recipe",
3535
name = "bob-tinned-copper-cable",
36-
category = "bob-electronics",
36+
category = "crafting",
3737
enabled = false,
3838
ingredients = {
3939
{ type = "item", name = "copper-cable", amount = 3 },
@@ -62,7 +62,7 @@ data:extend({
6262
{
6363
type = "recipe",
6464
name = "bob-insulated-cable",
65-
category = "bob-electronics",
65+
category = "crafting",
6666
enabled = false,
6767
ingredients = {
6868
{ type = "item", name = "copper-cable", amount = 2 },
@@ -91,7 +91,7 @@ if data.raw.item["bob-gold-plate"] then
9191
{
9292
type = "recipe",
9393
name = "bob-gilded-copper-cable",
94-
category = "bob-electronics-machine",
94+
category = "advanced-crafting",
9595
enabled = false,
9696
ingredients = {
9797
{ type = "item", name = "copper-cable", amount = 3 },
@@ -122,7 +122,7 @@ if data.raw.item["bob-solder-alloy"] then
122122
{
123123
type = "recipe",
124124
name = "bob-solder",
125-
category = "bob-electronics",
125+
category = "crafting",
126126
energy_required = 2,
127127
enabled = false,
128128
auto_recycle = false,
@@ -154,7 +154,7 @@ data:extend({
154154
{
155155
type = "recipe",
156156
name = "bob-basic-electronic-components",
157-
category = "bob-electronics-machine",
157+
category = "advanced-crafting",
158158
energy_required = 2,
159159
enabled = false,
160160
ingredients = {
@@ -184,7 +184,7 @@ data:extend({
184184
{
185185
type = "recipe",
186186
name = "bob-electronic-components",
187-
category = "bob-electronics-machine",
187+
category = "advanced-crafting",
188188
energy_required = 3.5,
189189
enabled = false,
190190
ingredients = {
@@ -214,7 +214,7 @@ data:extend({
214214
{
215215
type = "recipe",
216216
name = "bob-integrated-electronics",
217-
category = "bob-electronics-with-fluid",
217+
category = "crafting-with-fluid",
218218
energy_required = 5,
219219
enabled = false,
220220
ingredients = {
@@ -245,7 +245,7 @@ data:extend({
245245
{
246246
type = "recipe",
247247
name = "bob-processing-electronics",
248-
category = "bob-electronics-with-fluid",
248+
category = "crafting-with-fluid",
249249
energy_required = 7,
250250
enabled = false,
251251
ingredients = {
@@ -285,7 +285,7 @@ data:extend({
285285
{
286286
type = "recipe",
287287
name = "bob-wooden-board",
288-
category = "bob-electronics",
288+
category = "crafting",
289289
auto_recycle = false,
290290
ingredients = {
291291
{ type = "item", name = "wood", amount = 1 },
@@ -324,7 +324,7 @@ data:extend({
324324
{
325325
type = "recipe",
326326
name = "bob-phenolic-board",
327-
category = "bob-electronics-machine",
327+
category = "advanced-crafting",
328328
enabled = false,
329329
auto_recycle = false,
330330
ingredients = {
@@ -365,7 +365,7 @@ data:extend({
365365
{
366366
type = "recipe",
367367
name = "bob-fibreglass-board",
368-
category = "bob-electronics-machine",
368+
category = "advanced-crafting",
369369
enabled = false,
370370
auto_recycle = false,
371371
ingredients = {
@@ -402,7 +402,7 @@ data:extend({
402402
{
403403
type = "recipe",
404404
name = "bob-basic-circuit-board",
405-
category = "bob-electronics",
405+
category = "crafting",
406406
enabled = false,
407407
energy_required = 1,
408408
ingredients = {
@@ -443,7 +443,7 @@ data:extend({
443443
{
444444
type = "recipe",
445445
name = "bob-circuit-board",
446-
category = "bob-electronics-with-fluid",
446+
category = "crafting-with-fluid",
447447
energy_required = 5,
448448
enabled = false,
449449
ingredients = {
@@ -486,7 +486,7 @@ data:extend({
486486
{
487487
type = "recipe",
488488
name = "bob-superior-circuit-board",
489-
category = "bob-electronics-with-fluid",
489+
category = "crafting-with-fluid",
490490
energy_required = 10,
491491
enabled = false,
492492
ingredients = {
@@ -529,7 +529,7 @@ data:extend({
529529
{
530530
type = "recipe",
531531
name = "bob-multi-layer-circuit-board",
532-
category = "bob-electronics-with-fluid",
532+
category = "crafting-with-fluid",
533533
energy_required = 15,
534534
enabled = false,
535535
ingredients = {
@@ -560,7 +560,7 @@ data:extend({
560560
{
561561
type = "recipe",
562562
name = "electronic-circuit",
563-
category = "bob-electronics",
563+
category = "crafting",
564564
energy_required = 1,
565565
enabled = false,
566566
ingredients = {
@@ -589,7 +589,7 @@ data:extend({
589589
{
590590
type = "recipe",
591591
name = "advanced-circuit",
592-
category = "bob-electronics",
592+
category = "crafting",
593593
energy_required = 5,
594594
enabled = false,
595595
ingredients = {
@@ -619,7 +619,7 @@ data:extend({
619619
{
620620
type = "recipe",
621621
name = "processing-unit",
622-
category = "bob-electronics",
622+
category = "advanced-crafting",
623623
energy_required = 10,
624624
enabled = false,
625625
ingredients = {
@@ -650,7 +650,7 @@ data:extend({
650650
{
651651
type = "recipe",
652652
name = "bob-advanced-processing-unit",
653-
category = "bob-electronics",
653+
category = "advanced-crafting",
654654
energy_required = 15,
655655
enabled = false,
656656
ingredients = {
@@ -696,3 +696,23 @@ data:extend({
696696
data.raw["produce-per-hour-achievement"]["computer-age-1"].amount = 1000
697697
data.raw["produce-per-hour-achievement"]["computer-age-2"].amount = 5000
698698
data.raw["produce-per-hour-achievement"]["computer-age-3"].amount = 15000
699+
700+
bobmods.lib.recipe.add_additional_category("bob-tinned-copper-cable", "electronics")
701+
bobmods.lib.recipe.add_additional_category("bob-insulated-cable", "electronics")
702+
bobmods.lib.recipe.add_additional_category("bob-gilded-copper-cable", "electronics")
703+
bobmods.lib.recipe.add_additional_category("bob-solder", "electronics")
704+
bobmods.lib.recipe.add_additional_category("bob-basic-electronic-components", "electronics")
705+
bobmods.lib.recipe.add_additional_category("bob-electronic-components", "electronics")
706+
bobmods.lib.recipe.add_additional_category("bob-integrated-electronics", "electronics-with-fluid")
707+
bobmods.lib.recipe.add_additional_category("bob-processing-electronics", "electronics-with-fluid")
708+
bobmods.lib.recipe.add_additional_category("bob-wooden-board", "electronics")
709+
bobmods.lib.recipe.add_additional_category("bob-phenolic-board", "electronics")
710+
bobmods.lib.recipe.add_additional_category("bob-fibreglass-board", "electronics")
711+
bobmods.lib.recipe.add_additional_category("bob-basic-circuit-board", "electronics")
712+
bobmods.lib.recipe.add_additional_category("bob-circuit-board", "electronics-with-fluid")
713+
bobmods.lib.recipe.add_additional_category("bob-superior-circuit-board", "electronics-with-fluid")
714+
bobmods.lib.recipe.add_additional_category("bob-multi-layer-circuit-board", "electronics-with-fluid")
715+
bobmods.lib.recipe.add_additional_category("electronic-circuit", "electronics")
716+
bobmods.lib.recipe.add_additional_category("advanced-circuit", "electronics")
717+
bobmods.lib.recipe.add_additional_category("processing-unit", "electronics")
718+
bobmods.lib.recipe.add_additional_category("bob-advanced-processing-unit", "electronics")

0 commit comments

Comments
 (0)