require( "scripts/style.lua" );

SliderFont = {
  standardFont,
  24,
  WhiteColor
};

sfxPosY = 124;
musicPosY = 184;

MakeDialog
{
  OptionsWindow
  {
	  name="optionsmenu",
    x = 0, y = 0,
    w = ScreenWight, h = ScreenHeight,

    Bitmap
    {
      image="Menu/dialog",
      x = kCenter,
      y = kCenter,
    };
    Text
    {
	    font = HeaderFont,
	    name = "title",
	    x=kCenter,y=60+110,w=kMax ,h=75,
	    ProfileButtonLabel("options",HeaderFontSize)
    };

	  Text
	  {
		  font = MenuOptionsFont,
		  name = "sfx",
		  x=kCenter-210,
		  y=sfxPosY+105,
		  w=130,
		  h=50,
		  flags = kHAlignCenter + kVAlignCenter,
		  label = "sfxlevel"
	  };

	  Text
	  {
		  font = MenuOptionsFont,
		  name = "music",
		  x=kCenter-210,
		  y=musicPosY+105,
		  w=130,
		  h=50,
		  flags = kHAlignCenter + kVAlignCenter,
		  label = "musiclevel"
	  };

	  SetStyle(CheckboxFullStyle),
	  QEMenuButton
	  {
		  name="fullscreen",
		  label="fullscreen",
		  x=kCenter-140,
		  y=250+110,
		  w=220,
		  command=
		  function()
			  ToggleFullScreen();
		  end
	  };
	  
	  SetStyle(CheckboxCursorStyle),
	  QEMenuButton
	  {
		 name="customcursor",
		  label="optionscursor",
		  x=kCenter-140,
		  y=250+70*2+110,
	  	w=220,
		  command=
		  function()
		  ToggleCustomCursor();
		  end
	  };
	  
	   SetStyle(CheckboxTutorialStyle),
	  QEMenuButton
	  {
		  name="tutorial",
		  label="optionstutorial",
		  x=kCenter-140,
		  y=250+70*1+110,
		  w=220,
		  command=
		  function()
		  ToggleTutorial();
		  end
	  };
	  
	  SetStyle(CheckboxMuteStyle),
	  QEMenuButton
	  {
		  name="mutebox",
		  x=kCenter+200,
		  y=124+110,
		  w=190,
		  label = "mutesound",
		  command =
			  function()
				  ToggleSoundMute();
			  end
	  };

	  SetStyle( BackButtonStyle ),
	  QEMenuButton
	  {
		  x=kCenter+160,
	    y=400+110,
		  name="back",
		  cancel=true,
		  default=true,
		  type = kPush,
		  command = function() SaveOptions(); 
		  CloseFade("optionsmenu","CloseWindow()");
		  end;
	  },
	  
	  SetStyle(MenuButtonCredits);
    QEMenuButton
    {
	    x=kCenter+80,
	    y=300+110,
	    name="credits",
	    label="creditsbutton",
	    command =
		    function()
		    PlaySfx(mainMenuOpenSound);
			  DoModal("scripts/credits.lua");
		    end
    };

	  SetStyle(SliderStyle),
	  Slider
	  {
		  name="sfxlevelslider",
		  bg = "assets/menu/slider_bg",
		  roll = "assets/menu/slider_roll",
		  rollover = "assets/menu/slider_roll_1",
		  x = kCenter-30,
		  y = sfxPosY+110,
		  w = 262,
		  h = 24,
		  rollw = 32,
		  soundover = mainMenuOverSound,
		  soundpress = mainMenuButtonSound,
	  };
	  Slider
	  {
		  name="musiclevelslider",
		  bg = "assets/menu/slider_bg",
		  roll = "assets/menu/slider_roll",
		  rollover = "assets/menu/slider_roll_1",
		  x = kCenter-30,
		  y = musicPosY+110,
		  w = 262,
		  h = 24,
		  rollw = 32,
		  soundover = mainMenuOverSound,
		  soundpress = mainMenuButtonSound,
	  };
	};
}