Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Vanilla and Northstar compatibility #800

Draft
wants to merge 39 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
42bb3e7
It's fixed
VITALISED Apr 6, 2024
1c98028
Get rid of spammy print
VITALISED Apr 6, 2024
8e04301
It's really not fixed
VITALISED Apr 6, 2024
48e0b71
Note behaviour
VITALISED Apr 6, 2024
8ee2f62
Add vanilla check
VITALISED Apr 6, 2024
84a51ea
Fix for vanilla const not existing
VITALISED Apr 6, 2024
c946f46
Add a handy loc string
VITALISED Apr 6, 2024
a05063c
Use new auth script stuff
VITALISED Apr 28, 2024
bf5acf5
Merge branch 'main' into fix-ui
VITALISED Apr 28, 2024
f9ccd7e
Fix openinvites
VITALISED Apr 28, 2024
b7506fa
Remove old lobbytype function
VITALISED Apr 29, 2024
711a325
Fix entitlement menu not working on vanilla
VITALISED Apr 29, 2024
a2fd37e
Revert random testing stuff
VITALISED Apr 29, 2024
5effa70
Improve combo button stuff, actually readable now
VITALISED Apr 30, 2024
c81a604
Give progression button similar treatment
VITALISED Apr 30, 2024
5cbc103
Don't bother asking user to disable northstar.custom
VITALISED Apr 30, 2024
098465c
Lock buttons between lobbies that don't work
VITALISED Apr 30, 2024
ed08d1a
Move around progression stuff too since we have the space
VITALISED May 1, 2024
591e683
Move to disabling mods to main menu
VITALISED May 1, 2024
bbbde5e
Wrap all Northstar.Custom remotes for vanilla compat
VITALISED May 1, 2024
8414fa0
Disable non-vanilla modes on vanilla mode selector
VITALISED May 1, 2024
0643c47
Switch around attrition and skirmish because why
VITALISED May 1, 2024
371f285
Lock private match store buttons
VITALISED May 1, 2024
d5c08d0
Move remote function code to CustomServers
VITALISED May 1, 2024
7cbf509
Stub buttons better
VITALISED May 1, 2024
b0c6686
Move weapon mods to custom weapons, prevent indexing issues
VITALISED May 2, 2024
df19227
Fix modes menu and server browser playlist stuff
VITALISED May 2, 2024
361d867
Move around communities stuff
VITALISED May 2, 2024
aba850c
Fix minor button issue
VITALISED May 2, 2024
d61aa88
Fix invalid ui player crash
VITALISED May 2, 2024
28ec211
Shuffle around serverfilter stuff
VITALISED May 2, 2024
b47f5b9
Revert changes, drop token on mpbutton
VITALISED May 2, 2024
bba9eb1
ooptm
VITALISED May 2, 2024
09db81d
Update nativefuncs.json with vanilla compat fns
VITALISED May 3, 2024
1bed1b2
Why the fuck did I commit this in
VITALISED May 3, 2024
ad4aaf7
Fix nativefuncs.json again
VITALISED May 3, 2024
2832851
Allow remotes to be created when there's no integrity
VITALISED May 3, 2024
145e3ab
Null out mpButtonActivateFunc if using no integrity
VITALISED May 3, 2024
8edb669
I hate vscode git
VITALISED May 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions .github/nativefuncs.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@
"helpText":"Returns whether or not a given path leads to a folder.",
"returnTypeString":"bool",
"argTypes":"string path"
},
{
"name": "NSIsVanilla",
"helpText": "Checks if the game is currently in vanilla compat mode",
"returnTypeString": "bool",
"argTypes": ""
}
],
"CLIENT":[
Expand Down Expand Up @@ -421,7 +427,13 @@
"helpText":"Returns whether or not a given path leads to a folder.",
"returnTypeString":"bool",
"argTypes":"string path"
}
},
{
"name": "NSIsVanilla",
"helpText": "Checks if the game is currently in vanilla compat mode",
"returnTypeString": "bool",
"argTypes": ""
}
],
"UI":[
{
Expand Down Expand Up @@ -736,12 +748,24 @@
"helpText":"Returns whether or not a given path leads to a folder.",
"returnTypeString":"bool",
"argTypes":"string path"
},
},
{
"name":"NSGetMasterServerAuthResult",
"helpText":"",
"returnTypeString":"MasterServerAuthResult",
"argTypes":""
},
{
"name": "NSResetToken",
"helpText": "Resets serverfilter",
"returnTypeString": "void",
"argTypes": ""
},
{
"name": "NSIsVanilla",
"helpText": "Checks if the game is currently in vanilla compat mode",
"returnTypeString": "bool",
"argTypes": ""
}
]
}
5 changes: 5 additions & 0 deletions Northstar.Client/mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
"Name": "modlist_reverse",
"DefaultValue": "0",
"Flags": "ARCHIVE_PLAYERPROFILE"
},
{
"Name": "ns_communities_disabled_override",
"DefaultValue": "0",
"Flags": "ARCHIVE_PLAYERPROFILE"
}
],
"Scripts": [
Expand Down
181 changes: 150 additions & 31 deletions Northstar.Client/mod/scripts/vscripts/ui/menu_lobby.nut
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ struct

int inboxHeaderIndex
var inboxButton
var switchButton

int customizeHeaderIndex
var pilotButton
var titanButton
var boostsButton
var progressionButton
var storeButton
var storeNewReleasesButton
var storeBundlesButton
Expand All @@ -94,6 +96,7 @@ struct

array<var> lobbyButtons
var playHeader
var nsHeader
var customizeHeader
var callsignHeader

Expand Down Expand Up @@ -179,7 +182,6 @@ void function InitLobbyMenu()
AddMenuFooterOption( menu, BUTTON_BACK, "#BACK_BUTTON_POSTGAME_REPORT", "#POSTGAME_REPORT", OpenPostGameMenu, IsPostGameMenuValid )
AddMenuFooterOption( menu, BUTTON_TRIGGER_RIGHT, "#R_TRIGGER_CHAT", "", null, IsVoiceChatPushToTalk )
// Client side progression toggle
AddMenuFooterOption( menu, BUTTON_Y, "#Y_BUTTON_TOGGLE_PROGRESSION", "#TOGGLE_PROGRESSION", ShowToggleProgressionDialog )

InitChatroom( menu )

Expand Down Expand Up @@ -230,6 +232,9 @@ void function InitLobbyMenu()

void function ShowToggleProgressionDialog( var button )
{
if( Hud_IsLocked( button ) )
return;

bool enabled = Progression_GetPreference()

DialogData dialogData
Expand Down Expand Up @@ -288,21 +293,31 @@ void function SetupComboButtonTest( var menu )
int buttonIndex = 0
file.playHeader = AddComboButtonHeader( comboStruct, headerIndex, "#MENU_HEADER_PLAY" )

// server browser
file.findGameButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_TITLE_SERVER_BROWSER" )
// vanilla

file.findGameButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_TITLE_FIND_GAME" )
file.lobbyButtons.append( file.findGameButton )
Hud_SetLocked( file.findGameButton, true )
Hud_AddEventHandler( file.findGameButton, UIE_CLICK, OpenServerBrowser )
Hud_AddEventHandler( file.findGameButton, UIE_CLICK, BigPlayButton1_Activate )

// private match
file.inviteRoomButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#PRIVATE_MATCH" )
Hud_AddEventHandler( file.inviteRoomButton, UIE_CLICK, StartPrivateMatch )
file.inviteRoomButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_TITLE_INVITE_ROOM" )
Hud_AddEventHandler( file.inviteRoomButton, UIE_CLICK, DoRoomInviteIfAllowed )

file.inviteFriendsButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_TITLE_INVITE_FRIENDS" )
Hud_AddEventHandler( file.inviteFriendsButton, UIE_CLICK, InviteFriendsIfAllowed )

Hud_SetEnabled( file.inviteFriendsButton, false )
Hud_SetVisible( file.inviteFriendsButton, false )
// server browser
// file.serverBrowserButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_TITLE_SERVER_BROWSER" )
// file.lobbyButtons.append( file.serverBrowserButton )
// Hud_SetLocked( file.serverBrowserButton, true )
// Hud_AddEventHandler( file.serverBrowserButton, UIE_CLICK, OpenServerBrowser )

// private match
// file.privateMatchButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#PRIVATE_MATCH" )
// Hud_AddEventHandler( file.privateMatchButton, UIE_CLICK, StartPrivateMatch )


// Hud_SetEnabled( file.inviteFriendsButton, false )
// Hud_SetVisible( file.inviteFriendsButton, false )

// file.toggleMenuModeButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_LOBBY_SWITCH_FD" )
// Hud_AddEventHandler( file.toggleMenuModeButton, UIE_CLICK, ToggleLobbyMode )
Expand All @@ -320,6 +335,8 @@ void function SetupComboButtonTest( var menu )
Hud_AddEventHandler( titanButton, UIE_CLICK, AdvanceMenuEventHandler( GetMenu( "EditTitanLoadoutsMenu" ) ) )
file.boostsButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_TITLE_BOOSTS" )
Hud_AddEventHandler( file.boostsButton, UIE_CLICK, AdvanceMenuEventHandler( GetMenu( "BurnCardMenu" ) ) )
// file.progressionButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#TOGGLE_PROGRESSION" )
// Hud_AddEventHandler( file.progressionButton, UIE_CLICK, ShowToggleProgressionDialog )

headerIndex++
buttonIndex = 0
Expand All @@ -343,17 +360,18 @@ void function SetupComboButtonTest( var menu )
var networksInbox = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_TITLE_INBOX" )
file.inboxButton = networksInbox
file.lobbyButtons.append( networksInbox )
Hud_AddEventHandler( networksInbox, UIE_CLICK, OnInboxButton_Activate )
Hud_AddEventHandler( networksInbox, UIE_CLICK, _OnInboxButton_Activate )
var switchButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#COMMUNITY_SWITCHCOMMUNITY" )
Hud_AddEventHandler( switchButton, UIE_CLICK, OnSwitchButton_Activate )
file.switchButton = switchButton
Hud_AddEventHandler( switchButton, UIE_CLICK, _OnSwitchButton_Activate )
var browseButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#COMMUNITY_BROWSE_NETWORKS" )
file.lobbyButtons.append( browseButton )
Hud_AddEventHandler( browseButton, UIE_CLICK, OnBrowseNetworksButton_Activate )
Hud_AddEventHandler( browseButton, UIE_CLICK, _OnBrowseNetworksButton_Activate )
file.browseNetworkButton = browseButton
#if NETWORK_INVITE
file.inviteFriendsToNetworkButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#INVITE_FRIENDS" )
file.lobbyButtons.append( file.inviteFriendsToNetworkButton )
Hud_AddEventHandler( file.inviteFriendsToNetworkButton, UIE_CLICK, OnInviteFriendsToNetworkButton_Activate )
Hud_AddEventHandler( file.inviteFriendsToNetworkButton, UIE_CLICK, _OnInviteFriendsToNetworkButton_Activate )
#endif

headerIndex++
Expand Down Expand Up @@ -392,6 +410,38 @@ void function SetupComboButtonTest( var menu )
ComboButtons_Finalize( comboStruct )
}

void function _OnInviteFriendsToNetworkButton_Activate( var button )
{
if ( Hud_IsLocked( button ) )
return

OnInviteFriendsToNetworkButton_Activate( button )
}

void function _OnInboxButton_Activate( var button )
{
if ( Hud_IsLocked( button ) )
return

OnInboxButton_Activate( button)
}

void function _OnSwitchButton_Activate( var button )
{
if ( Hud_IsLocked( button ) )
return

OnSwitchButton_Activate( button)
}

void function _OnBrowseNetworksButton_Activate( var button )
{
if ( Hud_IsLocked( button ) )
return

OnBrowseNetworksButton_Activate( button)
}

bool function MatchResultsExist()
{
return true // TODO
Expand All @@ -410,22 +460,27 @@ void function DoRoomInviteIfAllowed( var button )
if ( Hud_IsLocked( button ) )
return

if ( !DoesCurrentCommunitySupportInvites() )
if ( !NSIsVanilla() )
StartPrivateMatch( button )
else
{
OnBrowseNetworksButton_Activate( button )
return
}
if ( !DoesCurrentCommunitySupportInvites() )
{
OnBrowseNetworksButton_Activate( button )
return
}

entity player = GetUIPlayer()
entity player = GetUIPlayer()

if ( IsValid( player ) && Player_NextAvailableMatchmakingTime( player ) > 0 )
{
DisplayMatchmakingPenaltyDialog( player )
return
}
if ( IsValid( player ) && Player_NextAvailableMatchmakingTime( player ) > 0 )
{
DisplayMatchmakingPenaltyDialog( player )
return
}

SendOpenInvite( true )
OpenSelectedPlaylistMenu()
SendOpenInvite( true )
OpenSelectedPlaylistMenu()
}
}

void function DisplayMatchmakingPenaltyDialog( entity player )
Expand Down Expand Up @@ -492,6 +547,9 @@ void function InviteFriendsIfAllowed( var button )
if ( Hud_IsLocked( button ) )
return

if ( !NSIsVanilla() )
ShowToggleProgressionDialog( button )

entity player = GetUIPlayer()
if ( IsValid( player ) && Player_NextAvailableMatchmakingTime( player ) > 0 )
{
Expand Down Expand Up @@ -578,6 +636,8 @@ void function OnLobbyMenu_Open()
// code will start loading DLC info from first party unless already done
InitDLCStore()

DoNSButtonState()

thread UpdateCachedNewItems()
if ( file.putPlayerInMatchmakingAfterDelay )
{
Expand Down Expand Up @@ -683,6 +743,43 @@ void function OnLobbyMenu_Open()
}
}

void function DoNSButtonState()
{
if ( NSIsVanilla() )
{
ComboButton_SetText( file.findGameButton, "#MENU_TITLE_FIND_GAME" )
ComboButton_SetText( file.inviteRoomButton, "#MENU_TITLE_INVITE_ROOM" )
ComboButton_SetText( file.inviteFriendsButton, "#MENU_TITLE_INVITE_FRIENDS" )

Hud_SetLocked( file.inboxButton, false )
Hud_SetLocked( file.browseNetworkButton, false )
Hud_SetLocked( file.switchButton, false )
Hud_SetLocked( file.inviteFriendsToNetworkButton, false )

Hud_SetLocked( file.storeButton, false )
Hud_SetLocked( file.storeNewReleasesButton, false )
Hud_SetLocked( file.storeBundlesButton, false )

}
else
{
ClientCommand( "loadPlaylists" ) // reload playlists only on northstar so server-browser works

ComboButton_SetText( file.findGameButton, "#MENU_TITLE_SERVER_BROWSER" )
ComboButton_SetText( file.inviteRoomButton, "#PRIVATE_MATCH" )
ComboButton_SetText( file.inviteFriendsButton, "#TOGGLE_PROGRESSION" )

Hud_SetLocked( file.inboxButton, true )
Hud_SetLocked( file.browseNetworkButton, true )
Hud_SetLocked( file.switchButton, true )
Hud_SetLocked( file.inviteFriendsToNetworkButton, true )

Hud_SetLocked( file.storeButton, true )
Hud_SetLocked( file.storeNewReleasesButton, true )
Hud_SetLocked( file.storeBundlesButton, true )
}
}

bool function DLCStoreShouldBeMarkedAsNew()
{
if ( !IsFullyConnected() )
Expand All @@ -703,9 +800,12 @@ void function LobbyMenuUpdate( var menu )
while ( GetTopNonDialogMenu() == menu )
{
bool inPendingOpenInvite = InPendingOpenInvite()
Hud_SetLocked( file.findGameButton, !IsPartyLeader() || inPendingOpenInvite )
Hud_SetLocked( file.inviteRoomButton, IsOpenInviteVisible() || GetPartySize() > 1 || inPendingOpenInvite )
Hud_SetLocked( file.inviteFriendsButton, inPendingOpenInvite )
if( NSIsVanilla() )
{
Hud_SetLocked( file.findGameButton, !IsPartyLeader() || inPendingOpenInvite )
Hud_SetLocked( file.inviteRoomButton, IsOpenInviteVisible() || GetPartySize() > 1 || inPendingOpenInvite )
Hud_SetLocked( file.inviteFriendsButton, inPendingOpenInvite )
}

bool canGenUp = false
if ( GetUIPlayer() )
Expand Down Expand Up @@ -1230,8 +1330,13 @@ void function BigPlayButton1_Activate( var button )
if ( Hud_IsLocked( button ) )
return

SendOpenInvite( false )
OpenSelectedPlaylistMenu()
if ( !NSIsVanilla() )
OpenServerBrowser( button )
else
{
SendOpenInvite( false )
OpenSelectedPlaylistMenu()
}
}

function EnableButton( button )
Expand Down Expand Up @@ -1516,6 +1621,11 @@ void function MatchmakingSetCountdownTimer( float time, bool useServerTime = tru

void function OnLobbyLevelInit()
{
if( NSIsVanilla() && ( !GetConVarBool( "ns_communities_disabled_override" ) ) )
SetConVarBool( "communities_enabled", true)
else
SetConVarBool( "communities_enabled", false)

UpdateCallsignElement( file.callsignCard )
RefreshCreditsAvailable()
}
Expand Down Expand Up @@ -1562,17 +1672,26 @@ void function SetPutPlayerInMatchmakingAfterDelay( bool value )

void function OnStoreButton_Activate( var button )
{
if( Hud_IsLocked( button ) )
return

LaunchGamePurchaseOrDLCStore()
}

void function OnStoreNewReleasesButton_Activate( var button )
{
if( Hud_IsLocked( button ) )
return

//LaunchGamePurchaseOrDLCStore( [ "StoreMenu", "StoreMenu_NewReleases" ] )
LaunchGamePurchaseOrDLCStore( [ "StoreMenu", "StoreMenu_WeaponSkins" ] )
}

void function OnStoreBundlesButton_Activate( var button )
{
if( Hud_IsLocked( button ) )
return

LaunchGamePurchaseOrDLCStore( [ "StoreMenu", "StoreMenu_Sales" ] )
}

Expand Down
Loading
Loading