Page 1 of 1

GUI width

Posted: Wed Jun 19, 2013 4:25 pm
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 :)

Re: GUI width

Posted: Wed Jun 19, 2013 4:41 pm
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"})

Re: GUI width

Posted: Wed Jun 19, 2013 4:47 pm
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 :)

Re: GUI width

Posted: Thu Jun 20, 2013 2:31 pm
by ficolas
Ok if this topic can be moved to bugs and reports, or maybe I should create a new topic

Re: GUI width

Posted: Thu Jun 20, 2013 2:46 pm
by kovarex
It is fixed for 1.5.2 ...

Re: GUI width

Posted: Thu Jun 20, 2013 3:35 pm
by ficolas
kovarex wrote:It is fixed for 1.5.2 ...
Ah ok thanx so I should leave it like it is :)