-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into projectile-replays
- Loading branch information
Showing
30 changed files
with
868 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: add-to-project | ||
|
||
on: | ||
issues: | ||
types: | ||
- opened | ||
pull_request_target: | ||
types: | ||
- opened | ||
|
||
jobs: | ||
add-to-project: | ||
name: Add to project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
project-url: "https://github.com/orgs/R2Northstar/projects/3" | ||
github-token: "${{ secrets.ADD_TO_PROJECT_PAT }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
global function AtlasAuthDialog | ||
|
||
void function AtlasAuthDialog() | ||
{ | ||
thread AtlasAuthDialog_Threaded() | ||
} | ||
|
||
void function AtlasAuthDialog_Threaded() | ||
{ | ||
// wait at least 1 frame so that the main menu can be loaded first | ||
WaitFrame() | ||
|
||
while ( !NSIsMasterServerAuthenticated() || GetConVarBool( "ns_auth_allow_insecure" ) ) | ||
WaitFrame() | ||
|
||
if ( GetConVarBool( "ns_auth_allow_insecure" ) ) | ||
return | ||
|
||
MasterServerAuthResult res = NSGetMasterServerAuthResult() | ||
|
||
// do nothing on successful authentication | ||
if ( res.success ) | ||
return | ||
|
||
EmitUISound( "blackmarket_purchase_fail" ) | ||
|
||
DialogData dialogData | ||
dialogData.image = $"ui/menu/common/dialog_error" | ||
dialogData.header = Localize( "#AUTHENTICATION_FAILED_HEADER" ) | ||
|
||
// if we got a special error message from Atlas, display it | ||
if ( res.errorMessage != "" ) | ||
dialogData.message = res.errorMessage | ||
else | ||
dialogData.message = Localize( "#AUTHENTICATION_FAILED_BODY" ) | ||
|
||
if ( res.errorCode != "" ) | ||
dialogData.message += format( "\n\n%s", Localize( "#AUTHENTICATION_FAILED_ERROR_CODE", res.errorCode ) ) | ||
|
||
string link = "https://r2northstar.gitbook.io/r2northstar-wiki/installing-northstar/troubleshooting" | ||
// link to generic troubleshooting page if we don't have an error code from Atlas | ||
if ( res.errorCode != "" ) | ||
link = format( "%s#%s", link, res.errorCode ) | ||
|
||
CloseAllDialogs() | ||
AddDialogButton( dialogData, "#OK" ) | ||
AddDialogButton( dialogData, Localize( "#AUTHENTICATION_FAILED_HELP" ), void function() : ( dialogData, link ) | ||
{ | ||
// todo: get MS to redirect, so i can use an MS link or something? | ||
LaunchExternalWebBrowser( link, WEBBROWSER_FLAG_FORCEEXTERNAL ) | ||
// keep the dialog open | ||
OpenDialog( dialogData ) | ||
} ) | ||
|
||
OpenDialog( dialogData ) | ||
} |
170 changes: 170 additions & 0 deletions
170
Northstar.Client/mod/scripts/vscripts/ui/menu_edit_pilot_loadouts.nut
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
untyped | ||
|
||
global function InitEditPilotLoadoutsMenu | ||
|
||
struct | ||
{ | ||
var menu | ||
var loadoutPanel | ||
var[NUM_PERSISTENT_PILOT_LOADOUTS] loadoutHeaders | ||
var[NUM_PERSISTENT_PILOT_LOADOUTS] activateButtons | ||
bool enteringEdit = false | ||
var unlockReq | ||
} file | ||
|
||
void function InitEditPilotLoadoutsMenu() | ||
{ | ||
file.menu = GetMenu( "EditPilotLoadoutsMenu" ) | ||
var menu = file.menu | ||
|
||
AddMenuEventHandler( menu, eUIEvent.MENU_OPEN, OnPilotLoadoutsMenu_Open ) | ||
AddMenuEventHandler( menu, eUIEvent.MENU_CLOSE, OnPilotLoadoutsMenu_Close ) | ||
AddMenuEventHandler( menu, eUIEvent.MENU_INPUT_MODE_CHANGED, OnPilotLoadoutsMenu_InputModeChanged ) | ||
|
||
for ( int i = 0; i < NUM_PERSISTENT_PILOT_LOADOUTS; i++ ) | ||
{ | ||
var activateButton = Hud_GetChild( menu, "Button" + i ) | ||
activateButton.s.rowIndex <- i | ||
Hud_SetVisible( activateButton, true ) | ||
Hud_AddEventHandler( activateButton, UIE_CLICK, OnLoadoutButton_Activate ) | ||
Hud_AddEventHandler( activateButton, UIE_GET_FOCUS, OnLoadoutButton_Focused ) | ||
Hud_AddEventHandler( activateButton, UIE_LOSE_FOCUS, OnLoadoutButton_LostFocus ) | ||
file.activateButtons[i] = activateButton | ||
} | ||
|
||
Hud_SetFocused( file.activateButtons[0] ) | ||
|
||
file.loadoutPanel = Hud_GetChild( menu, "PilotLoadoutDisplay" ) | ||
file.unlockReq = Hud_GetChild( menu, "UnlockReq" ) | ||
|
||
AddMenuFooterOption( menu, BUTTON_A, "#A_BUTTON_SELECT" ) | ||
AddMenuFooterOption( menu, BUTTON_B, "#B_BUTTON_BACK", "#BACK" ) | ||
} | ||
|
||
void function OnPilotLoadoutsMenu_Open() | ||
{ | ||
entity player = GetUIPlayer() | ||
if ( player == null ) | ||
return | ||
|
||
RunMenuClientFunction( "ClearEditingPilotLoadoutIndex" ) | ||
|
||
int loadoutIndex = uiGlobal.pilotSpawnLoadoutIndex | ||
UpdatePilotLoadoutButtons( loadoutIndex, file.activateButtons ) | ||
UpdatePilotLoadoutPanel( file.loadoutPanel, GetCachedPilotLoadout( loadoutIndex ) ) | ||
UI_SetPresentationType( ePresentationType.PILOT ) | ||
|
||
RefreshCreditsAvailable() | ||
} | ||
|
||
void function OnPilotLoadoutsMenu_Close() | ||
{ | ||
entity player = GetUIPlayer() | ||
if ( player == null ) | ||
return | ||
|
||
foreach ( i, button in file.activateButtons ) | ||
{ | ||
string pilotLoadoutRef = "pilot_loadout_" + ( i + 1 ) | ||
if ( !IsItemNew( player, pilotLoadoutRef ) ) | ||
continue | ||
|
||
ClearNewStatus( button, pilotLoadoutRef ) | ||
} | ||
} | ||
|
||
void function OnPilotLoadoutsMenu_InputModeChanged() | ||
{ | ||
UpdatePilotLoadoutPanelBinds( file.loadoutPanel ) | ||
} | ||
|
||
void function OnLoadoutButton_Focused( var button ) | ||
{ | ||
int index = expect int( button.s.rowIndex ) | ||
|
||
// update the editingLoadoutIndex on focus so that it always matches | ||
// with the pilot loadout panel | ||
uiGlobal.editingLoadoutIndex = index | ||
uiGlobal.editingLoadoutType = "pilot" | ||
|
||
UpdatePilotLoadout( index ) | ||
|
||
string pilotLoadoutRef = "pilot_loadout_" + ( index + 1 ) | ||
string unlockReq = GetItemUnlockReqText( pilotLoadoutRef ) | ||
RHud_SetText( file.unlockReq, unlockReq ) | ||
} | ||
|
||
void function UpdatePilotLoadout( int loadoutIndex ) | ||
{ | ||
PilotLoadoutDef loadout = GetCachedPilotLoadout( loadoutIndex ) | ||
|
||
UpdatePilotLoadoutPanel( file.loadoutPanel, loadout ) | ||
RunMenuClientFunction( "UpdatePilotModel", loadoutIndex ) | ||
} | ||
|
||
void function OnLoadoutButton_Activate( var button ) | ||
{ | ||
if ( !IsFullyConnected() ) | ||
return | ||
|
||
if ( Hud_IsLocked( button ) ) | ||
{ | ||
int index = expect int ( button.s.rowIndex ) | ||
string pilotLoadoutRef = "pilot_loadout_" + ( index + 1 ) | ||
|
||
array<var> buttons | ||
foreach ( button in file.activateButtons ) | ||
{ | ||
buttons.append( button ) | ||
} | ||
|
||
OpenBuyItemDialog( buttons, button, GetItemName( pilotLoadoutRef ), pilotLoadoutRef ) | ||
return | ||
} | ||
|
||
int loadoutIndex = expect int ( button.s.rowIndex ) | ||
SetEditLoadout( "pilot", loadoutIndex ) | ||
|
||
if ( EDIT_LOADOUT_SELECTS ) | ||
{ | ||
bool indexChanged = loadoutIndex != uiGlobal.pilotSpawnLoadoutIndex | ||
|
||
if ( indexChanged ) | ||
{ | ||
EmitUISound( "Menu_LoadOut_Pilot_Select" ) | ||
|
||
if ( !IsLobby() ) | ||
uiGlobal.updatePilotSpawnLoadout = true | ||
} | ||
|
||
uiGlobal.pilotSpawnLoadoutIndex = loadoutIndex | ||
ClientCommand( "RequestPilotLoadout " + loadoutIndex ) | ||
} | ||
|
||
if ( PRE_RELEASE_DEMO && loadoutIndex < 3 ) | ||
{ | ||
UpdatePilotLoadoutButtons( loadoutIndex, file.activateButtons ) | ||
return | ||
} | ||
|
||
RunMenuClientFunction( "SetEditingPilotLoadoutIndex", loadoutIndex ) | ||
AdvanceMenu( GetMenu( "EditPilotLoadoutMenu" ) ) | ||
} | ||
|
||
void function OnLoadoutButton_LostFocus( var button ) | ||
{ | ||
entity player = GetUIPlayer() | ||
if ( !IsValid( player ) ) | ||
return | ||
|
||
int loadoutIndex = expect int ( button.s.rowIndex ) | ||
string pilotLoadoutRef = "pilot_loadout_" + ( loadoutIndex + 1 ) | ||
ClearNewStatus( button, pilotLoadoutRef ) | ||
|
||
if ( IsItemLocked( player, pilotLoadoutRef ) ) | ||
return | ||
|
||
PilotLoadoutDef loadout = GetCachedPilotLoadout( loadoutIndex ) | ||
if ( (RefHasAnyNewSubitem( player, loadout.primary ) || RefHasAnyNewSubitem( player, loadout.secondary ) || RefHasAnyNewSubitem( player, loadout.weapon3 )) ) | ||
Hud_SetNew( button, true ) | ||
} |
Oops, something went wrong.