From 43e25ddc40c51377c97d8d92142cef49197f4125 Mon Sep 17 00:00:00 2001 From: Roktaal Date: Sat, 2 Apr 2016 11:44:41 +0200 Subject: [PATCH 1/4] Create style.lua --- prototypes/style.lua | 106 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 prototypes/style.lua diff --git a/prototypes/style.lua b/prototypes/style.lua new file mode 100644 index 0000000..79c5637 --- /dev/null +++ b/prototypes/style.lua @@ -0,0 +1,106 @@ +data:extend( +{ + { + type = "font", + name = "blpflip_font", + from = "default", + size = 10 + } +} +) + +data.raw["gui-style"].default["blpflip_button_horizontal"] = +{ + type = "button_style", + parent = "button_style", + width = 32, + height = 32, + top_padding = 6, + right_padding = 0, + bottom_padding = 0, + left_padding = 0, + font = "blpflip_font", + default_graphical_set = + { + type = "monolith", + monolith_image = + { + filename = "__blueprint_flipper__/graphics/gui.png", + priority = "extra-high-no-scale", + width = 32, + height = 32, + x = 0, + } + }, + hovered_graphical_set = + { + type = "monolith", + monolith_image = + { + filename = "__blueprint_flipper__/graphics/gui.png", + priority = "extra-high-no-scale", + width = 32, + height = 32, + x = 32, + } + }, + clicked_graphical_set = + { + type = "monolith", + monolith_image = + { + filename = "__blueprint_flipper__/graphics/gui.png", + width = 32, + height = 32, + x = 32, + } + } +} + +data.raw["gui-style"].default["blpflip_button_vertical"] = +{ + type = "button_style", + parent = "button_style", + width = 32, + height = 32, + top_padding = 6, + right_padding = 0, + bottom_padding = 0, + left_padding = 0, + font = "blpflip_font", + default_graphical_set = + { + type = "monolith", + monolith_image = + { + filename = "__blueprint_flipper__/graphics/gui.png", + priority = "extra-high-no-scale", + width = 32, + height = 32, + x = 64, + } + }, + hovered_graphical_set = + { + type = "monolith", + monolith_image = + { + filename = "__blueprint_flipper__/graphics/gui.png", + priority = "extra-high-no-scale", + width = 32, + height = 32, + x = 96, + } + }, + clicked_graphical_set = + { + type = "monolith", + monolith_image = + { + filename = "__blueprint_flipper__/graphics/gui.png", + width = 32, + height = 32, + x = 96, + } + } +} From 06925dca3b4b93d58ec4f73b85494eb74f578a00 Mon Sep 17 00:00:00 2001 From: Roktaal Date: Sat, 2 Apr 2016 11:46:37 +0200 Subject: [PATCH 2/4] Create gui.png --- graphics/gui.png | 1 + 1 file changed, 1 insertion(+) create mode 100644 graphics/gui.png diff --git a/graphics/gui.png b/graphics/gui.png new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/graphics/gui.png @@ -0,0 +1 @@ + From 08ce8a2d91eed6dfa0bce0dafde81171bff1ef53 Mon Sep 17 00:00:00 2001 From: Roktaal Date: Sat, 2 Apr 2016 11:46:56 +0200 Subject: [PATCH 3/4] Added files via upload --- graphics/gui.png | Bin 1 -> 1322 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/graphics/gui.png b/graphics/gui.png index 8b137891791fe96927ad78e64b0aad7bded08bdc..1d0157bfc63c776fb2e9c88a57d598199a1dbd4d 100644 GIT binary patch literal 1322 zcmV+_1=aeAP)dwc8g zc$`irE@NY36A}{6&dyve7jiXmQmn#1K0Y?%CnY5X&eyhJ^BvNX;q~?P;^LyTw6wgu zJUTiWBW|~Qb#--qe!iolV_{)Ie7lr?b8{o$Z*Fb|!aq4Vd3kv;Oz<-@GE@W-^Y{1n z&G-cc1xkEW!VeD*f*B}tnwy)WqN3K;)(#F1Fp`~}T~bo=(|Zob>FMe0>}*U-jN!eJ zk&&1~Hno{Seagonz({<2JjYK zva-NmT3TYy1jjerWu%e>T(Eu!(bUw`*VlJ+83-w{gx41D$mJ zfSB>|(zwL2CVad{%}Thetc;B_hlhu8adBN;U9MkNS63HE5ajqfJ3D`n4}qY?z`y`> z!6l>|8XBVN!{+AZii?ZW)6@0%P}z`A)K}q)P5`vV_T&aTJ3IUP`&DL2k1({x@!|#> z8ym;R$5m#kgdk#xiHY!HYild^=FH5@_4PIT-@?K|OjurC)(fFTcb1P-g8gr1W+wPs zTU&une9i|_zWfAKS68!nCmW+No|l&=*rDS1L-}mp$?`EC2%oBtz4H3Y&}V%>1VRH|GKv~Fo>@&0ZYp+3MR za>U-=UOhgvHsn(u5WXOd7C8VBz`y45&(kpnGc`^w?((m>{P~!p$A^uLjeRjPjFSne zsi~-*w1bZdpY}CBj8mzE%}nL9AeBnk%%q Date: Sat, 2 Apr 2016 11:47:35 +0200 Subject: [PATCH 4/4] Added files via upload --- control.lua | 6 +++--- data.lua | 25 +------------------------ info.json | 2 +- 3 files changed, 5 insertions(+), 28 deletions(-) diff --git a/control.lua b/control.lua index 674c73e..de3bb83 100644 --- a/control.lua +++ b/control.lua @@ -36,9 +36,9 @@ end local function doButtons(player_index) if not game.players[player_index].gui.top.blueprint_flipper_flow then - local flow=game.players[player_index].gui.top.add{type="flow",name="blueprint_flipper_flow",direction="vertical"} - flow.add{type="button",name="blueprint_flip",caption="Flip BP Horiz.",style="bpflip_button_style"} - flow.add{type="button",name="blueprint_flop",caption="Flip BP Vert.",style="bpflip_button_style"} + local flow=game.players[player_index].gui.top.add{type="flow", name="blueprint_flipper_flow", direction="vertical"} + flow.add{type="button", name="blueprint_flip", style="blpflip_button_horizontal"} + flow.add{type="button", name="blueprint_flop", style="blpflip_button_vertical"} end end diff --git a/data.lua b/data.lua index 8eeb947..21b59ed 100644 --- a/data.lua +++ b/data.lua @@ -1,24 +1 @@ -data:extend({ - { - type = "font", - name = "bpflip_font", - from = "default", - size = 10, - }, -}) - -local button_style = { - type = "button_style", - parent = "button_style", - font = "bpflip_font", - scalable = false, - top_padding = 0, - bottom_padding = 0, - left_padding = 2, - right_padding = 2, - bottom_margin=0, - top_margin=0, -} - - -data.raw["gui-style"].default["bpflip_button_style"] = button_style +require("prototypes.style") \ No newline at end of file diff --git a/info.json b/info.json index 87c6eb6..40ec55e 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "blueprint_flipper", - "version": "0.1.1", + "version": "0.1.2", "title": "Blueprint Flipper", "author": "GopherAtl", "homepage": "",