mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-27 09:20:51 +00:00
- added mouse and controller menus
The controller menu obviously does not work yet, it needs quite a bit of backing code fron GZDoom first.
This commit is contained in:
parent
65ae00fb74
commit
6245a0e2e2
8 changed files with 145 additions and 41 deletions
|
@ -182,16 +182,6 @@ void ctrlGetInput(void)
|
|||
gInputMode = kInputMessage;
|
||||
}
|
||||
|
||||
if (buttonMap.ButtonDown(gamefunc_AutoRun))
|
||||
{
|
||||
buttonMap.ClearButton(gamefunc_AutoRun);
|
||||
gAutoRun = !gAutoRun;
|
||||
if (gAutoRun)
|
||||
viewSetMessage("Auto run ON");
|
||||
else
|
||||
viewSetMessage("Auto run OFF");
|
||||
}
|
||||
|
||||
if (buttonMap.ButtonDown(gamefunc_Map_Toggle))
|
||||
{
|
||||
buttonMap.ClearButton(gamefunc_Map_Toggle);
|
||||
|
|
|
@ -61,12 +61,12 @@ static const ButtonDesc gamefuncs[] = {
|
|||
{ gamefunc_Crouch, "Crouch"},
|
||||
{ gamefunc_Look_Up, "Look_Up"},
|
||||
{ gamefunc_Look_Down, "Look_Down"},
|
||||
{ gamefunc_Look_Left, "Look_Left"},
|
||||
{ gamefunc_Look_Right, "Look_Right"},
|
||||
{ gamefunc_Look_Left, "Look_Left"},
|
||||
{ gamefunc_Look_Right, "Look_Right"},
|
||||
{ gamefunc_Strafe_Left, "Strafe_Left"},
|
||||
{ gamefunc_Strafe_Right, "Strafe_Right"},
|
||||
{ gamefunc_Aim_Up, "Aim_Up"},
|
||||
{ gamefunc_Aim_Down, "Aim_Down"},
|
||||
{ gamefunc_Aim_Up, "Aim_Up"},
|
||||
{ gamefunc_Aim_Down, "Aim_Down"},
|
||||
{ gamefunc_Weapon_1, "Weapon_1"},
|
||||
{ gamefunc_Weapon_2, "Weapon_2"},
|
||||
{ gamefunc_Weapon_3, "Weapon_3"},
|
||||
|
@ -87,8 +87,8 @@ static const ButtonDesc gamefuncs[] = {
|
|||
{ gamefunc_TurnAround, "Turn_Around"},
|
||||
{ gamefunc_SendMessage, "Send_Message"},
|
||||
{ gamefunc_Map, "Map"},
|
||||
{ gamefunc_Shrink_Screen, "Shrink_Screen"},
|
||||
{ gamefunc_Enlarge_Screen, "Enlarge_Screen"},
|
||||
{ gamefunc_Shrink_Screen, "Shrink_Screen"},
|
||||
{ gamefunc_Enlarge_Screen, "Enlarge_Screen"},
|
||||
{ gamefunc_Center_View, "Center_View"},
|
||||
{ gamefunc_Holster_Weapon, "Holster_Weapon"},
|
||||
{ gamefunc_Show_Opponents_Weapon, "Show_Opponents_Weapon"},
|
||||
|
@ -103,7 +103,6 @@ static const ButtonDesc gamefuncs[] = {
|
|||
{ gamefunc_Show_DukeMatch_Scores, "Show_DukeMatch_Scores"},
|
||||
{ gamefunc_Dpad_Select, "Dpad_Select"},
|
||||
{ gamefunc_Dpad_Aiming, "Dpad_Aiming"},
|
||||
{ gamefunc_AutoRun, "AutoRun"},
|
||||
{ gamefunc_Last_Weapon, "Last_Used_Weapon"},
|
||||
{ gamefunc_Alt_Weapon, "Alt_Weapon"},
|
||||
{ gamefunc_Third_Person_View, "Third_Person_View"},
|
||||
|
|
|
@ -70,7 +70,6 @@ enum GameFunction_t
|
|||
gamefunc_Show_DukeMatch_Scores,
|
||||
gamefunc_Dpad_Select,
|
||||
gamefunc_Dpad_Aiming,
|
||||
gamefunc_AutoRun,
|
||||
gamefunc_Last_Weapon,
|
||||
gamefunc_Alt_Weapon,
|
||||
gamefunc_Third_Person_View,
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
**---------------------------------------------------------------------------
|
||||
**
|
||||
*/
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "basics.h"
|
||||
|
@ -113,7 +113,7 @@ static GameFuncDesc con_gamefuncs[] = {
|
|||
{"+Show_DukeMatch_Scores", "Show_Scoreboard"},
|
||||
{"+Dpad_Select", "Dpad_Select"},
|
||||
{"+Dpad_Aiming", "Dpad_Aiming"},
|
||||
{"+AutoRun", "AutoRun"},
|
||||
{"toggle cl_autorun", "AutoRun"},
|
||||
{"+Last_Used_Weapon", "Last_Used_Weapon"},
|
||||
{"QuickSave", "Quick_Save"},
|
||||
{"QuickLoad", "Quick_Load"},
|
||||
|
@ -274,4 +274,3 @@ const char *C_CON_GetButtonFunc(int num)
|
|||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,23 @@
|
|||
|
||||
CVARD(Bool, cl_crosshair, true, CVAR_ARCHIVE, "enable/disable crosshair");
|
||||
CVARD(Bool, cl_automsg, false, CVAR_ARCHIVE, "enable/disable automatically sending messages to all players") // Not implemented for Blood
|
||||
CVARD(Bool, cl_autorun, true, CVAR_ARCHIVE, "enable/disable autorun")
|
||||
CUSTOM_CVARD(Bool, cl_autorun, true, CVAR_ARCHIVE, "enable/disable autorun")
|
||||
{
|
||||
#if 0 // todo: print a message
|
||||
|
||||
if (gAutoRun)
|
||||
viewSetMessage("Auto run ON");
|
||||
else
|
||||
viewSetMessage("Auto run OFF");
|
||||
|
||||
|
||||
RUN MODE OFF
|
||||
RUN MODE ON
|
||||
cl_autorun= 1-cl_autorun;
|
||||
P_DoQuote(QUOTE_RUN_MODE_OFF + cl_autorun, &myplayer);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
CVARD(Bool, cl_runmode, true, CVAR_ARCHIVE, "enable/disable modernized run key operation")
|
||||
CVARD(Bool, cl_autosave, true, CVAR_ARCHIVE, "enable/disable autosaves") // Not implemented for Blood (but looks like the other games never check it either.)
|
||||
CVARD(Bool, cl_autosavedeletion, true, CVAR_ARCHIVE, "enable/disable automatic deletion of autosaves") // Not implemented for Blood
|
||||
|
|
|
@ -4725,13 +4725,6 @@ void G_HandleLocalKeys(void)
|
|||
G_UpdateScreenArea();
|
||||
}
|
||||
|
||||
if (buttonMap.ButtonDown(gamefunc_AutoRun))
|
||||
{
|
||||
buttonMap.ClearButton(gamefunc_AutoRun);
|
||||
cl_autorun= 1-cl_autorun;
|
||||
P_DoQuote(QUOTE_RUN_MODE_OFF + cl_autorun, &myplayer);
|
||||
}
|
||||
|
||||
if (buttonMap.ButtonDown(gamefunc_Map))
|
||||
{
|
||||
buttonMap.ClearButton(gamefunc_Map);
|
||||
|
|
|
@ -6271,13 +6271,6 @@ void G_HandleLocalKeys(void)
|
|||
G_UpdateScreenArea();
|
||||
}
|
||||
|
||||
if (buttonMap.ButtonDown(gamefunc_AutoRun))
|
||||
{
|
||||
buttonMap.ClearButton(gamefunc_AutoRun);
|
||||
cl_autorun = !cl_autorun;
|
||||
P_DoQuote(QUOTE_RUN_MODE_OFF+cl_autorun,g_player[myconnectindex].ps);
|
||||
}
|
||||
|
||||
if (buttonMap.ButtonDown(gamefunc_Map))
|
||||
{
|
||||
buttonMap.ClearButton(gamefunc_Map);
|
||||
|
|
|
@ -702,8 +702,15 @@ OptionMenu "ActionControlsMenu"// protected
|
|||
|
||||
StaticText ""
|
||||
Control "$CNTRLMNU_MOUSELOOK" , "+mouse_aiming"
|
||||
Control "$CNTRLMNU_AIMUP" , "+aim_up"
|
||||
Control "$CNTRLMNU_AIMDOWN" , "+aim_down"
|
||||
Control "$CNTRLMNU_LOOKUP" , "+look_up"
|
||||
Control "$CNTRLMNU_LOOKDOWN" , "+look_down"
|
||||
ifgame(Duke, Nam, WW2GI, Fury, Redneck, RedneckRides)
|
||||
{
|
||||
Control "$CNTRLMNU_LOOKLEFT" , "+look_left"
|
||||
Control "$CNTRLMNU_LOOKRIGHT" , "+look_right"
|
||||
}
|
||||
Control "$CNTRLMNU_CENTERVIEW" , "+center_view"
|
||||
|
||||
StaticText ""
|
||||
|
@ -871,11 +878,11 @@ OptionMenu "OtherControlsMenu"// protected
|
|||
Control "$CNTRLMNU_ADJUST_GAMMA" , "bumpgamma"
|
||||
|
||||
StaticText ""
|
||||
Control "$CNTRLMNU_OPEN_HELP" , "menu_help"
|
||||
Control "$CNTRLMNU_OPEN_SAVE" , "menu_save"
|
||||
Control "$CNTRLMNU_OPEN_LOAD" , "menu_load"
|
||||
Control "$CNTRLMNU_OPEN_OPTIONS" , "menu_options"
|
||||
Control "$CNTRLMNU_OPEN_DISPLAY" , "menu_display"
|
||||
Control "$CNTRLMNU_OPEN_HELP" , "openhelpmenu"
|
||||
Control "$CNTRLMNU_OPEN_SAVE" , "opensavemenu"
|
||||
Control "$CNTRLMNU_OPEN_LOAD" , "openloadmenu"
|
||||
Control "$CNTRLMNU_OPEN_OPTIONS" , "openmenu optionsmenu"
|
||||
Control "$CNTRLMNU_OPEN_DISPLAY" , "openmenu displayoptions"
|
||||
Control "$CNTRLMNU_EXIT_TO_MAIN" , "menu_endgame"
|
||||
Control "$CNTRLMNU_MENU_QUIT" , "menu_quit"
|
||||
|
||||
|
@ -884,3 +891,111 @@ OptionMenu "OtherControlsMenu"// protected
|
|||
Control "$CNTRLMNU_QUICKLOAD" , "quickload"
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
//
|
||||
// Mouse Menu
|
||||
//
|
||||
//-------------------------------------------------------------------------------------------
|
||||
|
||||
OptionValue "Corners"
|
||||
{
|
||||
-1, "$OPTVAL_OFF"
|
||||
0, "$OPTVAL_UPPERLEFT"
|
||||
1, "$OPTVAL_UPPERRIGHT"
|
||||
2, "$OPTVAL_LOWERLEFT"
|
||||
3, "$OPTVAL_LOWERRIGHT"
|
||||
}
|
||||
|
||||
OptionValue "MenuMouse"
|
||||
{
|
||||
0, "$TXT_NO"
|
||||
1, "$TXT_YES"
|
||||
2, "$OPTVAL_TOUCHSCREENLIKE"
|
||||
}
|
||||
|
||||
OptionString "Cursors"
|
||||
{
|
||||
"None", "$OPTVAL_DEFAULT"
|
||||
"cursor", "$OPTSTR_SIMPLEARROW"
|
||||
"-", "$OPTSTR_SYSTEMCURSOR"
|
||||
}
|
||||
|
||||
OptionMenu "MouseOptions" protected
|
||||
{
|
||||
Title "$MOUSEMNU_TITLE"
|
||||
Option "$MOUSEMNU_ENABLEMOUSE", "in_mouse", "YesNo"
|
||||
Option "$MOUSEMNU_MOUSEINMENU", "m_use_mouse", "MenuMouse", "use_mouse"
|
||||
Option "$MOUSEMNU_SHOWBACKBUTTON", "m_show_backbutton", "Corners", "use_mouse"
|
||||
// todo Option "$MOUSEMNU_CURSOR", "vid_cursor", "Cursors"
|
||||
StaticText ""
|
||||
Slider "$MOUSEMNU_SENSITIVITY", "mouse_sensitivity", 0.5, 2.5, 0.1
|
||||
Option "$MOUSEMNU_NOPRESCALE", "m_noprescale", "NoYes"
|
||||
Option "$MOUSEMNU_SMOOTHMOUSE", "m_filter", "YesNo"
|
||||
StaticText ""
|
||||
Slider "$MOUSEMNU_TURNSPEED", "m_yaw", 0, 2.5, 0.1
|
||||
Slider "$MOUSEMNU_MOUSELOOKSPEED", "m_pitch", 0, 2.5, 0.1
|
||||
Slider "$MOUSEMNU_FORWBACKSPEED", "m_forward", 0, 2.5, 0.1
|
||||
Slider "$MOUSEMNU_STRAFESPEED", "m_side", 0, 2.5, 0.1
|
||||
StaticText ""
|
||||
Option "$MOUSEMNU_ALWAYSMOUSELOOK", "in_mousemode", "OnOff"
|
||||
Option "$MOUSEMNU_INVERTMOUSE", "in_mouseflip", "OnOff"
|
||||
Option "$MOUSEMNU_LOOKSPRING", "in_aimmode", "OnOff" // Functionm exists but is very broken. Definitely needs fixing.
|
||||
// Do we need this? Option "$MOUSEMNU_LOOKSTRAFE", "lookstrafe", "OnOff"
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
//
|
||||
// Joystick Menu
|
||||
//
|
||||
//-------------------------------------------------------------------------------------------
|
||||
|
||||
OptionMenu "JoystickOptionsDefaults" protected
|
||||
{
|
||||
Title "$JOYMNU_OPTIONS"
|
||||
Option "$JOYMNU_ENABLE", "use_joystick", "YesNo"
|
||||
Option "$JOYMNU_NOMENU", "m_blockcontrollers", "YesNo"
|
||||
/*IfOption(Windows)
|
||||
{
|
||||
Option "$JOYMNU_DINPUT", "joy_dinput", "YesNo"
|
||||
Option "$JOYMNU_XINPUT", "joy_xinput", "YesNo"
|
||||
Option "$JOYMNU_PS2", "joy_ps2raw", "YesNo"
|
||||
}*/
|
||||
StaticText ""
|
||||
StaticTextSwitchable "$JOYMNU_NOCON", "$JOYMNU_CONFIG", "ConfigureMessage"
|
||||
StaticTextSwitchable " ", "$JOYMNU_DISABLED1", "ConnectMessage1"
|
||||
StaticTextSwitchable " ", "$JOYMNU_DISABLED2", "ConnectMessage2"
|
||||
|
||||
// The rest will be filled in by joystick code if devices get connected or disconnected
|
||||
}
|
||||
|
||||
OptionMenu "JoystickOptions" protected
|
||||
{
|
||||
Title "$JOYMNU_OPTIONS"
|
||||
}
|
||||
|
||||
OptionValue "JoyAxisMapNames"
|
||||
{
|
||||
-1, "$OPTVAL_NONE"
|
||||
0, "$OPTVAL_TURNING"
|
||||
1, "$OPTVAL_LOOKINGUPDOWN"
|
||||
2, "$OPTVAL_MOVINGFORWARD"
|
||||
3, "$OPTVAL_STRAFING"
|
||||
4, "$OPTVAL_MOVINGUPDOWN"
|
||||
}
|
||||
|
||||
OptionValue "Inversion"
|
||||
{
|
||||
0, "$OPTVAL_NOTINVERTED"
|
||||
1, "$OPTVAL_INVERTED"
|
||||
}
|
||||
|
||||
OptionMenu "JoystickConfigMenu" protected
|
||||
{
|
||||
Title "$JOYMNU_TITLE"
|
||||
Class "JoystickConfigMenu"
|
||||
// Will be filled in by joystick code.
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue