forked from Ports/perfect_dark
Merge branch 'port' of https://github.com/fgsfdsfgs/perfect_dark into port-net
This commit is contained in:
commit
fceacee0e2
19 files changed
+239
-65
No files matched your search
+2
-6
@@ -3474,9 +3474,7 @@ void menuClose(void)
|
||||
g_Menus[g_MpPlayerNum].openinhibit = 10;
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
if (inputMouseIsEnabled()) {
|
||||
inputLockMouse(true);
|
||||
}
|
||||
inputAutoLockMouse(true);
|
||||
#endif
|
||||
|
||||
if (g_MenuData.root == MENUROOT_MPPAUSE) {
|
||||
@@ -3587,9 +3585,7 @@ void menuPushRootDialog(struct menudialogdef *dialogdef, s32 root)
|
||||
g_PlayersWithControl[g_Menus[g_MpPlayerNum].playernum] = false;
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
if (inputMouseIsEnabled()) {
|
||||
inputLockMouse(false);
|
||||
}
|
||||
inputAutoLockMouse(false);
|
||||
#endif
|
||||
|
||||
func0f0f1494();
|
||||
|
||||
+26
-1
@@ -1372,7 +1372,7 @@ bool menuitemKeyboardTick(struct menuitem *item, struct menuinputs *inputs, u32
|
||||
if (dialog && g_MenuUsingMouse && !inputs->leftright && !inputs->updown) {
|
||||
const s32 dleft = dialog->x + 4;
|
||||
const s32 dright = dleft + 12 * 10;
|
||||
const s32 dtop = dialog->y + 13 + 12;
|
||||
const s32 dtop = menuitemGetTop(item, dialog) + 12;
|
||||
const s32 dbottom = dtop + 11 * 5;
|
||||
const s32 mx = inputs->mousex;
|
||||
const s32 my = inputs->mousey;
|
||||
@@ -4514,3 +4514,28 @@ Gfx *menuitemOverlay(Gfx *gdl, s16 x, s16 y, s16 x2, s16 y2, struct menuitem *it
|
||||
|
||||
return gdl;
|
||||
}
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
|
||||
s32 menuitemGetTop(struct menuitem *item, struct menudialog *dialog)
|
||||
{
|
||||
struct menu *menu = &g_Menus[g_MpPlayerNum];
|
||||
s32 dtop = dialog->y + LINEHEIGHT + 1;
|
||||
|
||||
for (s32 i = 0; i < dialog->numcols; ++i) {
|
||||
const s32 colindex = i + dialog->colstart;
|
||||
|
||||
for (s32 j = 0; j < menu->cols[colindex].numrows; ++j) {
|
||||
const s32 rowindex = j + menu->cols[colindex].rowstart;
|
||||
struct menuitem *pitem = &dialog->definition->items[menu->rows[rowindex].itemindex];
|
||||
if (pitem == item) {
|
||||
return dtop;
|
||||
}
|
||||
dtop += menu->rows[rowindex].height;
|
||||
}
|
||||
}
|
||||
|
||||
return dtop;
|
||||
}
|
||||
|
||||
#endif
|
||||
+1
-3
@@ -33,9 +33,7 @@
|
||||
void menuStop(void)
|
||||
{
|
||||
#ifndef PLATFORM_N64
|
||||
if (inputMouseIsEnabled()) {
|
||||
inputLockMouse(true);
|
||||
}
|
||||
inputAutoLockMouse(true);
|
||||
#endif
|
||||
|
||||
if (var80062944) {
|
||||
|
||||
@@ -85,6 +85,14 @@ struct menuitem g_CtcOptionsMenuItems[] = {
|
||||
MPOPTION_FRIENDLYFIRE,
|
||||
menuhandlerMpDisplayTeam,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"No Player on Radar",
|
||||
MPOPTION_NOPLAYERONRADAR,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
|
||||
@@ -80,6 +80,14 @@ struct menuitem g_MpCombatOptionsMenuItems[] = {
|
||||
MPOPTION_FRIENDLYFIRE,
|
||||
menuhandlerMpDisplayTeam,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"No Player on Radar",
|
||||
MPOPTION_NOPLAYERONRADAR,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_SEPARATOR,
|
||||
|
||||
@@ -83,6 +83,14 @@ struct menuitem g_HtmOptionsMenuItems[] = {
|
||||
MPOPTION_FRIENDLYFIRE,
|
||||
menuhandlerMpDisplayTeam,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"No Player on Radar",
|
||||
MPOPTION_NOPLAYERONRADAR,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
|
||||
@@ -83,6 +83,14 @@ struct menuitem g_HtbOptionsMenuItems[] = {
|
||||
MPOPTION_FRIENDLYFIRE,
|
||||
menuhandlerMpDisplayTeam,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"No Player on Radar",
|
||||
MPOPTION_NOPLAYERONRADAR,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
|
||||
@@ -104,6 +104,14 @@ struct menuitem g_KohOptionsMenuItems[] = {
|
||||
MPOPTION_FRIENDLYFIRE,
|
||||
menuhandlerMpDisplayTeam,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"No Player on Radar",
|
||||
MPOPTION_NOPLAYERONRADAR,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
|
||||
@@ -81,6 +81,14 @@ struct menuitem g_PacOptionsMenuItems[] = {
|
||||
MPOPTION_FRIENDLYFIRE,
|
||||
menuhandlerMpDisplayTeam,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"No Player on Radar",
|
||||
MPOPTION_NOPLAYERONRADAR,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
|
||||
@@ -1105,6 +1105,15 @@ void playerSpawn(void)
|
||||
}
|
||||
} else {
|
||||
#ifndef PLATFORM_N64
|
||||
if (cheatIsActive(CHEAT_CLOAKINGDEVICE)) {
|
||||
invGiveSingleWeapon(WEAPON_CLOAKINGDEVICE);
|
||||
#if VERSION >= VERSION_PAL_FINAL
|
||||
bgunSetAmmoQuantity(AMMOTYPE_CLOAK, TICKS(7200));
|
||||
#else
|
||||
bgunSetAmmoQuantity(AMMOTYPE_CLOAK, 7200);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (cheatIsActive(CHEAT_PERFECTDARKNESS)) {
|
||||
invGiveSingleWeapon(WEAPON_NIGHTVISION);
|
||||
}
|
||||
|
||||
@@ -336,6 +336,9 @@ Gfx *radarRender(Gfx *gdl)
|
||||
gdl = func0f153134(gdl);
|
||||
|
||||
// Draw dots for human players
|
||||
#ifndef PLATFORM_N64
|
||||
if (!(g_MpSetup.options & MPOPTION_NOPLAYERONRADAR)) {
|
||||
#endif
|
||||
for (i = 0; i < PLAYERCOUNT(); i++) {
|
||||
if (i != playernum) {
|
||||
if (g_Vars.players[i]->isdead == false
|
||||
@@ -356,6 +359,9 @@ Gfx *radarRender(Gfx *gdl)
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifndef PLATFORM_N64
|
||||
}
|
||||
#endif
|
||||
|
||||
// Draw dots for coop AI buddies
|
||||
if (!g_Vars.normmplayerisrunning && g_MissionConfig.iscoop) {
|
||||
@@ -377,7 +383,11 @@ Gfx *radarRender(Gfx *gdl)
|
||||
}
|
||||
|
||||
// Draw dots for MP simulants
|
||||
#ifdef PLATFORM_N64
|
||||
if (g_Vars.normmplayerisrunning) {
|
||||
#else
|
||||
if (g_Vars.normmplayerisrunning && !(g_MpSetup.options & MPOPTION_NOPLAYERONRADAR)) {
|
||||
#endif
|
||||
for (i = 0; i < g_BotCount; i++) {
|
||||
if (!chrIsDead(g_MpBotChrPtrs[i])
|
||||
&& (g_MpBotChrPtrs[i]->hidden & CHRHFLAG_CLOAKED) == 0
|
||||
|
||||
@@ -2919,6 +2919,7 @@
|
||||
#define MPOPTION_AUTORANDOMWEAPON_START 0x00800000
|
||||
#define MPOPTION_AUTORANDOMWEAPON_END 0x01000000
|
||||
#define MPOPTION_FRIENDLYFIRE 0x02000000
|
||||
#define MPOPTION_NOPLAYERONRADAR 0x04000000
|
||||
|
||||
#define MPPAUSEMODE_UNPAUSED 0
|
||||
#define MPPAUSEMODE_PAUSED 1
|
||||
|
||||
@@ -83,4 +83,8 @@ bool menuitemTick(struct menuitem *item, struct menudialog *dialog, struct menui
|
||||
void menuitemInit(struct menuitem *item, union menuitemdata *data);
|
||||
Gfx *menuitemOverlay(Gfx *gdl, s16 x, s16 y, s16 x2, s16 y2, struct menuitem *item, struct menudialog *dialog, union menuitemdata *data);
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
s32 menuitemGetTop(struct menuitem *item, struct menudialog *dialog);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user