@ -97,12 +97,24 @@ void Menu::InitializeSettingsWindow(){
}
}
}
}
} ) END ;
} ) END ;
settingsList - > ADD ( " Screen Shake Checkbox " , Checkbox ) ( geom2d : : rect < float > { { 4.f , 40 } , { 16.f , 16.f } } , [ ] ( ToggleFuncData data ) {
settingsList - > ADD ( " Show Max HP Checkbox " , Checkbox ) ( geom2d : : rect < float > { { 4.f , 40 } , { 16.f , 16.f } } , [ ] ( ToggleFuncData data ) {
GameSettings : : SetMaxHealthDisplay ( data . checked ) ;
return true ;
} , false ) END ;
settingsList - > ADD ( " Show Max HP Label " , MenuLabel ) ( geom2d : : rect < float > { { 22.f , 40 } , { windowSize . x / 2 - 24.f , 16.f } } , " Show Max Health " , 1.f , ComponentAttr : : SHADOW | ComponentAttr : : LEFT_ALIGN ) END ;
settingsList - > ADD ( " Show Max Mana Checkbox " , Checkbox ) ( geom2d : : rect < float > { { windowSize . x / 2 + 4.f , 40 } , { 16.f , 16.f } } , [ ] ( ToggleFuncData data ) {
GameSettings : : SetMaxManaDisplay ( data . checked ) ;
return true ;
} , false ) END ;
settingsList - > ADD ( " Show Max Mana Label " , MenuLabel ) ( geom2d : : rect < float > { { windowSize . x / 2 + 22.f , 40 } , { windowSize . x / 2 - 24.f , 16.f } } , " Show Max Mana " , 1.f , ComponentAttr : : SHADOW | ComponentAttr : : LEFT_ALIGN ) END ;
settingsList - > ADD ( " Screen Shake Checkbox " , Checkbox ) ( geom2d : : rect < float > { { 4.f , 60 } , { 16.f , 16.f } } , [ ] ( ToggleFuncData data ) {
GameSettings : : SetScreenShake ( data . checked ) ;
GameSettings : : SetScreenShake ( data . checked ) ;
return true ;
return true ;
} , true ) END ;
} , true ) END ;
settingsList - > ADD ( " Screen Shake Label " , MenuLabel ) ( geom2d : : rect < float > { { 22.f , 40 } , { windowSize . x / 2 - 24.f , 16.f } } , " Screen Shake " , 1.f , ComponentAttr : : SHADOW | ComponentAttr : : LEFT_ALIGN ) END ;
settingsList - > ADD ( " Screen Shake Label " , MenuLabel ) ( geom2d : : rect < float > { { 22.f , 6 0} , { windowSize . x / 2 - 24.f , 16.f } } , " Screen Shake " , 1.f , ComponentAttr : : SHADOW | ComponentAttr : : LEFT_ALIGN ) END ;
settingsList - > ADD ( " Controller Rumble Checkbox " , Checkbox ) ( geom2d : : rect < float > { { 4.f , 60 } , { 16.f , 16.f } } , [ ] ( ToggleFuncData data ) {
settingsList - > ADD ( " Controller Rumble Checkbox " , Checkbox ) ( geom2d : : rect < float > { { 4.f , 8 0} , { 16.f , 16.f } } , [ ] ( ToggleFuncData data ) {
if ( Menu : : IsCurrentlyActive ( SETTINGS ) ) {
if ( Menu : : IsCurrentlyActive ( SETTINGS ) ) {
GameSettings : : SetRumble ( data . checked ) ;
GameSettings : : SetRumble ( data . checked ) ;
if ( GameSettings : : RumbleEnabled ( GameSettings : : OVERRIDE ) ) {
if ( GameSettings : : RumbleEnabled ( GameSettings : : OVERRIDE ) ) {
@ -114,20 +126,20 @@ void Menu::InitializeSettingsWindow(){
}
}
return true ;
return true ;
} , true ) END ;
} , true ) END ;
settingsList - > ADD ( " Controller Rumble Label " , MenuLabel ) ( geom2d : : rect < float > { { 22.f , 6 0} , { windowSize . x / 2 - 24.f , 16.f } } , " Gamepad Rumble " , 1.f , ComponentAttr : : SHADOW | ComponentAttr : : LEFT_ALIGN ) END ;
settingsList - > ADD ( " Controller Rumble Label " , MenuLabel ) ( geom2d : : rect < float > { { 22.f , 8 0} , { windowSize . x / 2 - 24.f , 16.f } } , " Gamepad Rumble " , 1.f , ComponentAttr : : SHADOW | ComponentAttr : : LEFT_ALIGN ) END ;
settingsList - > ADD ( " Terrain Collision Boxes Checkbox " , Checkbox ) ( geom2d : : rect < float > { { windowSize . x / 2 + 4.f , 4 0} , { 16.f , 16.f } } , [ ] ( ToggleFuncData data ) {
settingsList - > ADD ( " Terrain Collision Boxes Checkbox " , Checkbox ) ( geom2d : : rect < float > { { windowSize . x / 2 + 4.f , 6 0} , { 16.f , 16.f } } , [ ] ( ToggleFuncData data ) {
GameSettings : : SetTerrainCollisionBoxes ( data . checked ) ;
GameSettings : : SetTerrainCollisionBoxes ( data . checked ) ;
return true ;
return true ;
} , true ) END ;
} , true ) END ;
settingsList - > ADD ( " Terrain Collision Boxes Label " , MenuLabel ) ( geom2d : : rect < float > { { windowSize . x / 2 + 22.f , 4 0} , { windowSize . x / 2 - 24.f , 16.f } } , " Terrain Collision Boxes " , 1.f , ComponentAttr : : SHADOW | ComponentAttr : : LEFT_ALIGN ) END ;
settingsList - > ADD ( " Terrain Collision Boxes Label " , MenuLabel ) ( geom2d : : rect < float > { { windowSize . x / 2 + 22.f , 6 0} , { windowSize . x / 2 - 24.f , 16.f } } , " Terrain Collision Boxes " , 1.f , ComponentAttr : : SHADOW | ComponentAttr : : LEFT_ALIGN ) END ;
settingsList - > ADD ( " Keyboard Play Auto-Aim Checkbox " , Checkbox ) ( geom2d : : rect < float > { { windowSize . x / 2 + 4.f , 6 0} , { 16.f , 16.f } } , [ ] ( ToggleFuncData data ) {
settingsList - > ADD ( " Keyboard Play Auto-Aim Checkbox " , Checkbox ) ( geom2d : : rect < float > { { windowSize . x / 2 + 4.f , 8 0} , { 16.f , 16.f } } , [ ] ( ToggleFuncData data ) {
GameSettings : : SetKeyboardAutoAim ( data . checked ) ;
GameSettings : : SetKeyboardAutoAim ( data . checked ) ;
return true ;
return true ;
} , false ) END ;
} , false ) END ;
settingsList - > ADD ( " Keyboard Play Auto-Aim Label " , MenuLabel ) ( geom2d : : rect < float > { { windowSize . x / 2 + 22.f , 6 0} , { windowSize . x / 2 - 24.f , 16.f } } , " Aim Assist \n (No Mouse Players) " , 1.f , ComponentAttr : : SHADOW | ComponentAttr : : LEFT_ALIGN ) END ;
settingsList - > ADD ( " Keyboard Play Auto-Aim Label " , MenuLabel ) ( geom2d : : rect < float > { { windowSize . x / 2 + 22.f , 8 0} , { windowSize . x / 2 - 24.f , 16.f } } , " Aim Assist \n (No Mouse Players) " , 1.f , ComponentAttr : : SHADOW | ComponentAttr : : LEFT_ALIGN ) END ;
auto fullscreenToggle = settingsList - > ADD ( " Fullscreen Toggle Checkbox " , Checkbox ) ( geom2d : : rect < float > { { windowSize . x / 2 + 4.f , 8 0} , { 16.f , 16.f } } , [ ] ( ToggleFuncData data ) {
auto fullscreenToggle = settingsList - > ADD ( " Fullscreen Toggle Checkbox " , Checkbox ) ( geom2d : : rect < float > { { windowSize . x / 2 + 4.f , 10 0} , { 16.f , 16.f } } , [ ] ( ToggleFuncData data ) {
if ( data . checked ) { //When going to fullscreen mode, the windowed mode positioning needs to be saved to be restored later.
if ( data . checked ) { //When going to fullscreen mode, the windowed mode positioning needs to be saved to be restored later.
GameSettings : : SetWindowPos ( game - > GetActualWindowPos ( ) ) ;
GameSettings : : SetWindowPos ( game - > GetActualWindowPos ( ) ) ;
}
}
@ -137,13 +149,13 @@ void Menu::InitializeSettingsWindow(){
game - > SetFullscreen ( data . checked , GameSettings : : GetWindowPos ( ) ) ;
game - > SetFullscreen ( data . checked , GameSettings : : GetWindowPos ( ) ) ;
return true ;
return true ;
} , game - > IsFullscreen ( ) ) END ;
} , game - > IsFullscreen ( ) ) END ;
auto fullscreenToggleLabel = settingsList - > ADD ( " Fullscreen Toggle Label " , MenuLabel ) ( geom2d : : rect < float > { { windowSize . x / 2 + 22.f , 8 0} , { windowSize . x / 2 - 24.f , 16.f } } , " Fullscreen " , 1.f , ComponentAttr : : SHADOW | ComponentAttr : : LEFT_ALIGN ) END ;
auto fullscreenToggleLabel = settingsList - > ADD ( " Fullscreen Toggle Label " , MenuLabel ) ( geom2d : : rect < float > { { windowSize . x / 2 + 22.f , 10 0} , { windowSize . x / 2 - 24.f , 16.f } } , " Fullscreen " , 1.f , ComponentAttr : : SHADOW | ComponentAttr : : LEFT_ALIGN ) END ;
# ifdef __EMSCRIPTEN__
# ifdef __EMSCRIPTEN__
fullscreenToggle - > Disable ( ) ;
fullscreenToggle - > Disable ( ) ;
fullscreenToggleLabel - > Disable ( ) ;
fullscreenToggleLabel - > Disable ( ) ;
# endif
# endif
settingsList - > ADD ( " Button Set Toggle Box " , MenuIconButton ) ( geom2d : : rect < float > { { windowSize . x / 8.f , 8 0} , { windowSize . x / 4.f , 16.f } } , GFX [ " themes/xb.png " ] . Decal ( ) , [ ] ( MenuFuncData data ) {
settingsList - > ADD ( " Button Set Toggle Box " , MenuIconButton ) ( geom2d : : rect < float > { { windowSize . x / 8.f , 10 0} , { windowSize . x / 4.f , 16.f } } , GFX [ " themes/xb.png " ] . Decal ( ) , [ ] ( MenuFuncData data ) {
switch ( GameSettings : : GetIconType ( ) ) {
switch ( GameSettings : : GetIconType ( ) ) {
case IconType : : XB : {
case IconType : : XB : {
GameSettings : : SetIconType ( IconType : : PS ) ;
GameSettings : : SetIconType ( IconType : : PS ) ;
@ -189,13 +201,13 @@ void Menu::InitializeSettingsWindow(){
} ;
} ;
# pragma endregion
# pragma endregion
settingsList - > ADD ( " Keyboard Bindings Button " , MenuComponent ) ( geom2d : : rect < float > { { 28 , 10 0.f } , vf2d { settingsList - > rect . size . x - 12 - 56 , 24 } } , " Keyboard Bindings " , [ & ] ( MenuFuncData data ) {
settingsList - > ADD ( " Keyboard Bindings Button " , MenuComponent ) ( geom2d : : rect < float > { { 28 , 12 0.f } , vf2d { settingsList - > rect . size . x - 12 - 56 , 24 } } , " Keyboard Bindings " , [ & ] ( MenuFuncData data ) {
ChangeKeybindDisplayType ( KEY ) ;
ChangeKeybindDisplayType ( KEY ) ;
Component < MenuLabel > ( INPUT_KEY_DISPLAY , " Keyboard Mapping Label " ) - > SetLabel ( " Keyboard Mappings " ) ;
Component < MenuLabel > ( INPUT_KEY_DISPLAY , " Keyboard Mapping Label " ) - > SetLabel ( " Keyboard Mappings " ) ;
Menu : : OpenMenu ( INPUT_KEY_DISPLAY ) ;
Menu : : OpenMenu ( INPUT_KEY_DISPLAY ) ;
return true ;
return true ;
} , vf2d { 1.5f , 2.f } ) END ;
} , vf2d { 1.5f , 2.f } ) END ;
settingsList - > ADD ( " Controller Bindings Button " , MenuComponent ) ( geom2d : : rect < float > { { 28 , 12 8.f } , vf2d { settingsList - > rect . size . x - 12 - 56 , 24 } } , " Controller Bindings " , [ & ] ( MenuFuncData data ) {
settingsList - > ADD ( " Controller Bindings Button " , MenuComponent ) ( geom2d : : rect < float > { { 28 , 14 8.f } , vf2d { settingsList - > rect . size . x - 12 - 56 , 24 } } , " Controller Bindings " , [ & ] ( MenuFuncData data ) {
ChangeKeybindDisplayType ( CONTROLLER ) ;
ChangeKeybindDisplayType ( CONTROLLER ) ;
Component < MenuLabel > ( INPUT_KEY_DISPLAY , " Keyboard Mapping Label " ) - > SetLabel ( " Controller Mappings " ) ;
Component < MenuLabel > ( INPUT_KEY_DISPLAY , " Keyboard Mapping Label " ) - > SetLabel ( " Controller Mappings " ) ;
Menu : : OpenMenu ( INPUT_KEY_DISPLAY ) ;
Menu : : OpenMenu ( INPUT_KEY_DISPLAY ) ;
@ -224,9 +236,19 @@ void Menu::InitializeSettingsWindow(){
. down = " SFX Slider " , } } ,
. down = " SFX Slider " , } } ,
{ " SFX Slider " , {
{ " SFX Slider " , {
. up = " BGM Slider " ,
. up = " BGM Slider " ,
. down = " Terrain Collision Boxes Checkbox " , } } ,
. down = " Show Max Mana Checkbox " , } } ,
{ " Terrain Collision Boxes Checkbox " , {
{ " Show Max HP Checkbox " , {
. up = " SFX Slider " ,
. down = " Screen Shake Checkbox " ,
. left = " Show Max Mana Checkbox " ,
. right = " Show Max Mana Checkbox " , } } ,
{ " Show Max Mana Checkbox " , {
. up = " SFX Slider " ,
. up = " SFX Slider " ,
. down = " Terrain Collision Boxes Checkbox " ,
. left = " Show Max HP Checkbox " ,
. right = " Show Max HP Checkbox " , } } ,
{ " Terrain Collision Boxes Checkbox " , {
. up = " Show Max Mana Checkbox " ,
. down = " Keyboard Play Auto-Aim Checkbox " ,
. down = " Keyboard Play Auto-Aim Checkbox " ,
. left = " Screen Shake Checkbox " ,
. left = " Screen Shake Checkbox " ,
. right = " Screen Shake Checkbox " , } } ,
. right = " Screen Shake Checkbox " , } } ,
@ -236,7 +258,7 @@ void Menu::InitializeSettingsWindow(){
. left = " Controller Rumble Checkbox " ,
. left = " Controller Rumble Checkbox " ,
. right = " Controller Rumble Checkbox " , } } ,
. right = " Controller Rumble Checkbox " , } } ,
{ " Screen Shake Checkbox " , {
{ " Screen Shake Checkbox " , {
. up = " SFX Slider " ,
. up = " Show Max HP Checkbox " ,
. down = " Controller Rumble Checkbox " ,
. down = " Controller Rumble Checkbox " ,
. left = " Terrain Collision Boxes Checkbox " ,
. left = " Terrain Collision Boxes Checkbox " ,
. right = " Terrain Collision Boxes Checkbox " , } } ,
. right = " Terrain Collision Boxes Checkbox " , } } ,