Skip to content

Question about using a graphics option button on teh main game screen

Dameon2Dameon2 Member Posts: 46
edited June 2016 in UI Modding
Hey all.

So I'm trying to create a button that toggles zoom lock right on the main game play screen. It sort of workd. when I toggle the button and then enter the menu it toggles on and off the zoom lock button in the menu but it doesnt actually enable or disable the option properly

heres my code
	button
	{
		area 580 963 33 32
		bam RGROBUT
		toggle zoomLockBtnToggle
		action
		"
			if(zoomLockBtnToggle == 0) then
				graphicsToggles[selectedGraphicOpt][3] = 0
			else
				graphicsToggles[selectedGraphicOpt][3] = 1
			end
		"
	}	

Any help would be great :P

Comments

  • Mr2150Mr2150 Member Posts: 1,170
    edited June 2016
    You would need to use the code for:

    Infinity_ChangeOption()

    Also, in the context you are using it graphicsToggles[selectedGraphicOpt][3] doesn't mean anything as 'graphicsToggles' is a table, and 'selectedGraphicOpt' is a variable, I think.

    I've not looked at it myself but the graphicsToggles are 'activated' using that, I think.
  • Dameon2Dameon2 Member Posts: 46
    Mr2150 said:

    You would need to use the code for:

    Infinity_ChangeOption()

    Also, in the context you are using it graphicsToggles[selectedGraphicOpt][3] doesn't mean anything as 'graphicsToggles' is a table, and 'selectedGraphicOpt' is a variable, I think.

    I've not looked at it myself but the graphicsToggles are 'activated' using that, I think.

    thanks for the help, ill muss around a bit more
  • Dameon2Dameon2 Member Posts: 46
    edited June 2016
    Mr2150 said:

    You would need to use the code for:

    Infinity_ChangeOption()

    Also, in the context you are using it graphicsToggles[selectedGraphicOpt][3] doesn't mean anything as 'graphicsToggles' is a table, and 'selectedGraphicOpt' is a variable, I think.

    I've not looked at it myself but the graphicsToggles are 'activated' using that, I think.




    Alrite, I got it working! Works well with a caveat :smiley:

    I used infinity_changeoption() function like you said

    here's the code if anyone is interested, you will have to do your own button placement, but this does work turn zoom lock on and off from the game play screen... basically when you first load up your game, go into teh graphics menu and toggle zoom lock on or off. from that point on the button will be "bound" to zoom lock. basically what ti does it binds itself to the latest graphics option that you changed. Stays bound to that until you change a different graphics option, or exit the game completely, lasts the entire play session without having to go back into the graphics menu.
    	button
    	{
    		area 580 963 33 32
    		bam RGROBUT
    		toggle zoomLockBtnToggle
    		action
    		"
    			if(zoomLockBtnToggle == 0) then
    			Infinity_ChangeOption(graphicsToggles[selectedGraphicOpt][3], 0, 6 )
    			else
    			Infinity_ChangeOption(graphicsToggles[selectedGraphicOpt][3], 1, 6 )
    			end
    		"
    	}	
    and ya, I know it's not actually correct but for now it works for me, zoom lock is the onyl settign i need to change on teh fly and very often, because I've had a bug in BGEE since 1.3 where the background is blurry as hell with zoom lock on, but with zoom lock off, every time you go into a new area or building the graphics are blurry and warped. but toggling it on, then off again, then zooming up one level, then back down, makes it perfectly clear. Really weird bug. I posted a bug report you can read and see pictures of the issue here:

    https://forums.beamdog.com/discussion/58909/bug-blurry-scenery-interiors-ect-windows-steam#latest
Sign In or Register to comment.