forked from Ports/perfect_dark
Merge branch 'port' of https://github.com/fgsfdsfgs/perfect_dark into port-net
This commit is contained in:
commit
2362444efd
8 files changed
+39
-3
No files matched your search
@@ -50,7 +50,7 @@ jobs:
|
||||
retention-days: 0
|
||||
|
||||
build-i686-linux:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
|
||||
@@ -333,6 +333,14 @@ static inline void inputInitController(const s32 cidx, const s32 jidx)
|
||||
|
||||
sysLogPrintf(LOG_NOTE, "input: assigned controller '%d: (%s)' (id %d) to player %d",
|
||||
jidx, SDL_GameControllerName(pads[cidx]), inputControllerGetId(pads[cidx]), cidx);
|
||||
|
||||
SDL_Joystick* joy = SDL_GameControllerGetJoystick(pads[cidx]);
|
||||
if (joy) {
|
||||
char guidStr[1024] = "";
|
||||
SDL_JoystickGUID guid = SDL_JoystickGetGUID(joy);
|
||||
SDL_JoystickGetGUIDString(guid, guidStr, sizeof(guidStr));
|
||||
sysLogPrintf(LOG_NOTE, "input: GUID for controller %d: %s", jidx, guidStr);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void inputCloseController(const s32 cidx)
|
||||
|
||||
@@ -197,5 +197,6 @@ PD_CONSTRUCTOR static void gameConfigInit(void)
|
||||
configRegisterUInt(strFmt("Game.Player%d.CrosshairColour", i), &g_PlayerExtCfg[j].crosshaircolour, 0, 0xFFFFFFFF);
|
||||
configRegisterUInt(strFmt("Game.Player%d.CrosshairSize", i), &g_PlayerExtCfg[j].crosshairsize, 0, 4);
|
||||
configRegisterInt(strFmt("Game.Player%d.CrosshairHealth", i), &g_PlayerExtCfg[j].crosshairhealth, 0, CROSSHAIR_HEALTH_ON_WHITE);
|
||||
configRegisterInt(strFmt("Game.Player%d.UseKeyReloads", i), &g_PlayerExtCfg[j].usereloads, 0, false);
|
||||
}
|
||||
}
|
||||
@@ -965,6 +965,21 @@ struct menudialogdef g_ExtendedAudioMenuDialog = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
static MenuItemHandlerResult menuhandlerUseKeyReloads(s32 operation, struct menuitem *item, union handlerdata *data)
|
||||
{
|
||||
switch (operation) {
|
||||
case MENUOP_CHECKDISABLED:
|
||||
return !g_PlayerExtCfg[g_ExtMenuPlayer].extcontrols;
|
||||
case MENUOP_GET:
|
||||
return g_PlayerExtCfg[g_ExtMenuPlayer].usereloads;
|
||||
case MENUOP_SET:
|
||||
g_PlayerExtCfg[g_ExtMenuPlayer].usereloads = data->checkbox.value;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static MenuItemHandlerResult menuhandlerCrouchMode(s32 operation, struct menuitem *item, union handlerdata *data)
|
||||
{
|
||||
static const char *opts[] = {
|
||||
@@ -1269,6 +1284,14 @@ struct menuitem g_ExtendedGameMenuItems[] = {
|
||||
0,
|
||||
menuhandlerCrosshairHealth,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"Use Key Reloads",
|
||||
0,
|
||||
menuhandlerUseKeyReloads,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_SEPARATOR,
|
||||
0,
|
||||
|
||||
+3
-1
@@ -2008,7 +2008,9 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
|
||||
|
||||
g_Vars.currentplayer->bondactivateorreload = 0;
|
||||
|
||||
s32 usereloads = (controlmode != CONTROLMODE_PC);
|
||||
#ifndef PLATFORM_N64
|
||||
usereloads = usereloads || PLAYER_EXTCFG().usereloads;
|
||||
if (controlmode == CONTROLMODE_PC && movedata.alt1tapcount) {
|
||||
g_Vars.currentplayer->bondactivateorreload = g_Vars.currentplayer->bondactivateorreload | JO_ACTION_RELOAD;
|
||||
}
|
||||
@@ -2016,7 +2018,7 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
|
||||
if (movedata.btapcount) {
|
||||
g_Vars.currentplayer->activatetimelast = g_Vars.currentplayer->activatetimethis;
|
||||
g_Vars.currentplayer->activatetimethis = g_Vars.lvframe60;
|
||||
if (controlmode == CONTROLMODE_PC) {
|
||||
if (!usereloads) {
|
||||
g_Vars.currentplayer->bondactivateorreload = g_Vars.currentplayer->bondactivateorreload | JO_ACTION_ACTIVATE;
|
||||
} else {
|
||||
g_Vars.currentplayer->bondactivateorreload = movedata.btapcount ?
|
||||
|
||||
+1
-1
@@ -1330,7 +1330,7 @@ Gfx *lvRender(Gfx *gdl)
|
||||
if (!currentPlayerInteract(false)) {
|
||||
#ifndef PLATFORM_N64
|
||||
// n64 behavior: interact sucessful, cancel reload
|
||||
if (!PLAYER_EXTCFG().extcontrols) {
|
||||
if (!PLAYER_EXTCFG().extcontrols || PLAYER_EXTCFG().usereloads) {
|
||||
g_Vars.currentplayer->bondactivateorreload = (g_Vars.currentplayer->bondactivateorreload & ~JO_ACTION_RELOAD);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -133,6 +133,7 @@ struct mpweapon g_MpWeapons[NUM_MPWEAPONS] = {
|
||||
.crosshaircolour = 0x00ff0028, \
|
||||
.crosshairsize = 2, \
|
||||
.crosshairhealth = CROSSHAIR_HEALTH_OFF, \
|
||||
.usereloads = false, \
|
||||
}
|
||||
|
||||
struct extplayerconfig g_PlayerExtCfg[MAX_LOCAL_PLAYERS] = {
|
||||
|
||||
@@ -6167,6 +6167,7 @@ struct extplayerconfig {
|
||||
u32 crosshaircolour;
|
||||
u32 crosshairsize;
|
||||
s32 crosshairhealth;
|
||||
s32 usereloads;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user