Skip to content

Commit 80d70b1

Browse files
committed
use icon for main button
1 parent b02b384 commit 80d70b1

File tree

7 files changed

+58
-6
lines changed

7 files changed

+58
-6
lines changed

control.lua

+8-2
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ local function initGlob()
170170
global["config-tmp"] = {}
171171
global["storage"] = {}
172172
global.entitiesToInsert = {}
173+
global.version = "0.0.2"
173174
end
174175

175176
global.entitiesToInsert = global.entitiesToInsert or {}
@@ -179,10 +180,15 @@ local function initGlob()
179180
global["storage"] = global["storage"] or {}
180181

181182
for _, player in pairs(game.players) do
183+
if global.version < "0.0.5" then
184+
if player.gui.top["module-inserter-config-button"] then
185+
player.gui.top["module-inserter-config-button"].destroy()
186+
end
187+
global.version = "0.0.5"
188+
end
182189
gui_init(player, false)
183190
end
184-
185-
global.version = "0.0.2"
191+
global.version = "0.0.5"
186192
end
187193

188194
local function oninit() initGlob() end

data-final-fixes.lua

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ for r,_ in pairs(tmpTable) do
103103
table.insert(metaProductivityRecipesR.effects, {type="unlock-recipe", recipe=r})
104104
end
105105

106-
107106
data:extend({metaProductivityRecipesR})
108107

109108
data.raw["gui-style"].default["mi-icon-style"] =

graphics/gui.png

4.1 KB
Loading

graphics/module-inserter-icon.png

17 Bytes
Loading

gui.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ function gui_init(player, after_research)
131131
player.gui.top.add{
132132
type = "button",
133133
name = "module-inserter-config-button",
134-
caption = {"module-inserter-config-button-caption"}
134+
--caption = {"module-inserter-config-button-caption"}
135+
style = "module-inserter-button"
135136
}
136137
end
137138
end

info.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ModuleInserter",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"title": "Module Inserter",
55
"author": "Choumiko",
66
"homepage": "",

prototypes/style.lua

+47-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,50 @@ data.raw["gui-style"].default["module-inserter-small-button"] = {
1313
font = "module-inserter-small-font"
1414
}
1515

16-
16+
data.raw["gui-style"].default["module-inserter-button"] =
17+
{
18+
type = "button_style",
19+
parent = "button_style",
20+
width = 33,
21+
height = 33,
22+
top_padding = 6,
23+
right_padding = 0,
24+
bottom_padding = 0,
25+
left_padding = 0,
26+
font = "module-inserter-small-font",
27+
default_graphical_set =
28+
{
29+
type = "monolith",
30+
monolith_image =
31+
{
32+
filename = "__ModuleInserter__/graphics/gui.png",
33+
priority = "extra-high-no-scale",
34+
width = 32,
35+
height = 32,
36+
x = 64
37+
}
38+
},
39+
hovered_graphical_set =
40+
{
41+
type = "monolith",
42+
monolith_image =
43+
{
44+
filename = "__ModuleInserter__/graphics/gui.png",
45+
priority = "extra-high-no-scale",
46+
width = 32,
47+
height = 32,
48+
x = 96
49+
}
50+
},
51+
clicked_graphical_set =
52+
{
53+
type = "monolith",
54+
monolith_image =
55+
{
56+
filename = "__ModuleInserter__/graphics/gui.png",
57+
width = 32,
58+
height = 32,
59+
x = 96
60+
}
61+
}
62+
}

0 commit comments

Comments
 (0)