foxygit / fake-08-xbox360 Log in
commit 23b8c4f432d17d2aedc3800edf5e03cf640ab0f8
Author:     DPS2004 <dpsophinos@gmail.com>
AuthorDate: Fri Mar 11 08:42:59 2022 -0500
Commit:     DPS2004 <dpsophinos@gmail.com>
CommitDate: Mon May 2 09:40:36 2022 -0400

    resize hotkey can be turned on and off through settings
---
 platform/SDL2Common/source/sdl2basehost.cpp |  2 +-
 source/FakoSettings.h                       |  9 +++++++--
 source/host.h                               |  8 ++++++++
 source/hostCommonFunctions.cpp              | 17 +++++++++++++++++
 4 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/platform/SDL2Common/source/sdl2basehost.cpp b/platform/SDL2Common/source/sdl2basehost.cpp
index 28db663..44fb7f8 100644
--- a/platform/SDL2Common/source/sdl2basehost.cpp
+++ b/platform/SDL2Common/source/sdl2basehost.cpp
@@ -261,7 +261,7 @@ void Host::setTargetFps(int targetFps){
 }

 void Host::changeStretch(){
-    if (stretchKeyPressed) {
+    if (stretchKeyPressed && resizekey == YesResize) {
         StretchOption newStretch = stretch;

         if (stretch == PixelPerfectStretch) {
diff --git a/source/FakoSettings.h b/source/FakoSettings.h
index 58748f5..50d2aeb 100644
--- a/source/FakoSettings.h
+++ b/source/FakoSettings.h
@@ -29,7 +29,7 @@ function _init()

 	end

-	settinglist = {'kbmode','enableresize','stretch','menustyle'}
+	settinglist = {'kbmode','resizekey','stretch','menustyle','bgcolor'}
 	settings = {}
 	for i,v in ipairs(settinglist) do
 		settings[v] = __getsetting(v) + 1
@@ -49,7 +49,7 @@ function _init()
 		{name='video',ops = {
 			{
 				name = 'enable resize hotkeys',
-				vn = 'enableresize',
+				vn = 'resizekey',
 				ch ={'no','yes'}
 			},
 			{
@@ -63,6 +63,11 @@ function _init()
 				name = 'menu style',
 				vn = 'menustyle',
 				ch ={'classic','carts','splore'}
+			},
+			{
+				name = 'bg color',
+				vn = 'bgcolor',
+				ch ={'gray','black','blue','green'}
 			}
 		}}
 	}
diff --git a/source/host.h b/source/host.h
index 3fceb68..2599050 100644
--- a/source/host.h
+++ b/source/host.h
@@ -19,12 +19,19 @@ enum StretchOption {
   FourByThreeStretch
 };

+
 #if LOAD_PACK_INS
 enum PackinLoadOption {
   Unloaded,
   Loaded
 };
 #endif
+
+enum ResizekeyOption {
+  NoResize,
+  YesResize
+};
+
 enum KeyboardOption {
   Emoji,
   Lowercase
@@ -48,6 +55,7 @@ class Host {
 	#endif
     StretchOption stretch = PixelPerfectStretch;
     KeyboardOption kbmode = Emoji;
+	ResizekeyOption resizekey = NoResize;

     float scaleX = 1.0;
     float scaleY = 1.0;
diff --git a/source/hostCommonFunctions.cpp b/source/hostCommonFunctions.cpp
index 63e5963..d5c4d2f 100644
--- a/source/hostCommonFunctions.cpp
+++ b/source/hostCommonFunctions.cpp
@@ -21,6 +21,7 @@ CSimpleIniA settingsIni;
 std::string defaultIni =
 "[settings]\n"
 "stretch = 1\n"
+"resizekey = 0\n"
 "kbmode = 0\n";

 void Host::setUpPaletteColors(){
@@ -145,9 +146,16 @@ void Host::loadSettingsIni(){
 	long packinloadedSetting = settingsIni.GetLongValue("settings", "packinloaded", (long)Unloaded);
 	packinloaded = (PackinLoadOption) packinloadedSetting;
 	#endif
+
+	//resize hotkey
+	long resizekeySetting = settingsIni.GetLongValue("settings", "resizekey", (long)NoResize);
+	resizekey = (ResizekeyOption) resizekeySetting;
+
 	//kbmode
     long kbmodeSetting = settingsIni.GetLongValue("settings", "kbmode", (long)Emoji);
 	kbmode = (KeyboardOption) kbmodeSetting;
+
+
 }

 void Host::saveSettingsIni(){
@@ -158,6 +166,9 @@ void Host::saveSettingsIni(){
 	#if LOAD_PACK_INS
     settingsIni.SetLongValue("settings", "packinloaded", packinloaded);
 	#endif
+
+    settingsIni.SetLongValue("settings", "resizekey", resizekey);
+
     settingsIni.SetLongValue("settings", "kbmode", kbmode);

     std::string settingsIniStr = "";
@@ -203,6 +214,9 @@ int Host::getSetting(std::string sname) {
 	if(sname == "kbmode"){ //why cant you use strings in switch statements in c++ :(
 		Logger_Write("Returning KB mode setting\n");
 		return kbmode;
+	}else if(sname == "resizekey"){
+		Logger_Write("Returning resize key setting\n");
+		return resizekey;
 	}else if(sname == "stretch"){
 		Logger_Write("Returning Stretch setting\n");
 		return stretch;
@@ -219,6 +233,9 @@ void Host::setSetting(std::string sname, int sval) {
 	if(sname == "kbmode"){ //why cant you use strings in switch statements in c++ :(
 		Logger_Write("setting KB mode\n");
 		kbmode = (KeyboardOption) sval;
+	}else if(sname == "resizekey"){
+		Logger_Write("setting resize hotkey\n");
+		resizekey = (ResizekeyOption) sval;
 	}else if(sname == "stretch"){
 		Logger_Write("setting Stretch to");
 		std::string stringval = std::to_string(sval);