GUI width

Place to get help with not working mods / modding interface.
ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

GUI width

Post by ficolas »

kovarex wrote:Ok, I wrote simple wiki page about styles and lua, I hope it is understandable if not, let me know.

https://forums.factorio.com/wiki/index.php/Lua/Style

Edit:
ficolas wrote: minimunwidth field inside style is nil
Maybe because of this typo?
I just tested, because I havent been able to test before (I was in portugal :D ), I have tried as it says in the wiki.

Code: Select all

   button = game.player.gui.add{type="button", name="mybutton", caption="Hello world"}
   button.style = "menu_button_style"
   button.style.minimalwidth = 15
That doesnt work because it needs a position so I tried

Code: Select all

   button = game.player.gui.left.add{type="button", name="mybutton", caption="Hello world"}
   button.style = "menu_button_style" 
   button.style.minimalwidth = 150
I also tried using game.player.gui.left.mybuttom instead of adding the variable button, still doesnt work.
I can change the variable, but it is not shown in the game.

Also, the variables "width" and "height" donesnt even exist.

also the following code:

Code: Select all

	newmenu() --this jst removes the older menu
	game.player.gui.left.add({type="frame", name="menu", caption="Wireless"})
	game.player.gui.left.menu.add({type="flow",name="addsub",caption="",direction="horizontal"})
	game.player.gui.left.menu.add({type="flow",name="buttons",caption="",direction="vertical"})
	
	game.player.gui.left.menu.buttons.add({type="button", name="substract", caption=" - "})
	game.player.gui.left.menu.buttons.add({type="button", name="Toggle", caption="Toggle"})
	game.player.gui.left.menu.buttons.add({ type="button", name="Close", caption="Close"})
	
	
	game.player.gui.left.menu.addsub.add({type="button", name="add", caption=" + "})
	game.player.gui.left.menu.addsub.add({type="button", name="count", caption="1"})
Gives this:
The attachment wireless.png is no longer available
That image gives info about something that will come in my mod :)
Attachments
wireless.png
wireless.png (29.99 KiB) Viewed 3831 times
Last edited by ficolas on Thu Jun 20, 2013 2:30 pm, edited 2 times in total.

drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: GUI width

Post by drs9999 »

Yep,same for me.
Anything related with style is not for working for me, either. Or at least I /we use it in a wrong way...

Maybe you want to try this for the moment:

Code: Select all

	game.player.gui.left.add({type="frame", name="menu", caption="Wireless",direction="vertical"})
		game.player.gui.left.menu.add({type="flow",name="buttons",direction="horizontal"})
			game.player.gui.left.menu.buttons.add({type="button", name="add", caption=" + "})
   			game.player.gui.left.menu.buttons.add({type="button", name="count", caption="1"})
   			game.player.gui.left.menu.buttons.add({type="button", name="substract", caption=" - "})
   		game.player.gui.left.menu.add({type="flow",name="secondflow",direction="vertical"})
			game.player.gui.left.menu.secondflow.add({type="button", name="Toggle", caption="Toggle"})
			game.player.gui.left.menu.secondflow.add({type="button", name="Close", caption="Close"})

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: GUI width

Post by ficolas »

drs9999 wrote:Yep,same for me.
Anything related with style is not for working for me, either. Or at least I /we use it in a wrong way...

Maybe you want to try this for the moment:

Code: Select all

	game.player.gui.left.add({type="frame", name="menu", caption="Wireless",direction="vertical"})
		game.player.gui.left.menu.add({type="flow",name="buttons",direction="horizontal"})
			game.player.gui.left.menu.buttons.add({type="button", name="add", caption=" + "})
   			game.player.gui.left.menu.buttons.add({type="button", name="count", caption="1"})
   			game.player.gui.left.menu.buttons.add({type="button", name="substract", caption=" - "})
   		game.player.gui.left.menu.add({type="flow",name="secondflow",direction="vertical"})
			game.player.gui.left.menu.secondflow.add({type="button", name="Toggle", caption="Toggle"})
			game.player.gui.left.menu.secondflow.add({type="button", name="Close", caption="Close"})
Thanx :)

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: GUI width

Post by ficolas »

Ok if this topic can be moved to bugs and reports, or maybe I should create a new topic

kovarex
Factorio Staff
Factorio Staff
Posts: 8194
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: GUI width

Post by kovarex »

It is fixed for 1.5.2 ...

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: GUI width

Post by ficolas »

kovarex wrote:It is fixed for 1.5.2 ...
Ah ok thanx so I should leave it like it is :)

Post Reply

Return to “Modding help”