Skip to content

Commit

Permalink
use icon for main button
Browse files Browse the repository at this point in the history
  • Loading branch information
Choumiko committed Aug 27, 2015
1 parent b02b384 commit 80d70b1
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 6 deletions.
10 changes: 8 additions & 2 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ local function initGlob()
global["config-tmp"] = {}
global["storage"] = {}
global.entitiesToInsert = {}
global.version = "0.0.2"
end

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

for _, player in pairs(game.players) do
if global.version < "0.0.5" then
if player.gui.top["module-inserter-config-button"] then
player.gui.top["module-inserter-config-button"].destroy()
end
global.version = "0.0.5"
end
gui_init(player, false)
end

global.version = "0.0.2"
global.version = "0.0.5"
end

local function oninit() initGlob() end
Expand Down
1 change: 0 additions & 1 deletion data-final-fixes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ for r,_ in pairs(tmpTable) do
table.insert(metaProductivityRecipesR.effects, {type="unlock-recipe", recipe=r})
end


data:extend({metaProductivityRecipesR})

data.raw["gui-style"].default["mi-icon-style"] =
Expand Down
Binary file added graphics/gui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/module-inserter-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ function gui_init(player, after_research)
player.gui.top.add{
type = "button",
name = "module-inserter-config-button",
caption = {"module-inserter-config-button-caption"}
--caption = {"module-inserter-config-button-caption"}
style = "module-inserter-button"
}
end
end
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": "ModuleInserter",
"version": "0.0.4",
"version": "0.0.5",
"title": "Module Inserter",
"author": "Choumiko",
"homepage": "",
Expand Down
48 changes: 47 additions & 1 deletion prototypes/style.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,50 @@ data.raw["gui-style"].default["module-inserter-small-button"] = {
font = "module-inserter-small-font"
}


data.raw["gui-style"].default["module-inserter-button"] =
{
type = "button_style",
parent = "button_style",
width = 33,
height = 33,
top_padding = 6,
right_padding = 0,
bottom_padding = 0,
left_padding = 0,
font = "module-inserter-small-font",
default_graphical_set =
{
type = "monolith",
monolith_image =
{
filename = "__ModuleInserter__/graphics/gui.png",
priority = "extra-high-no-scale",
width = 32,
height = 32,
x = 64
}
},
hovered_graphical_set =
{
type = "monolith",
monolith_image =
{
filename = "__ModuleInserter__/graphics/gui.png",
priority = "extra-high-no-scale",
width = 32,
height = 32,
x = 96
}
},
clicked_graphical_set =
{
type = "monolith",
monolith_image =
{
filename = "__ModuleInserter__/graphics/gui.png",
width = 32,
height = 32,
x = 96
}
}
}

0 comments on commit 80d70b1

Please sign in to comment.