Skip to content

Commit

Permalink
Merge branch 'main' into projectile-replays
Browse files Browse the repository at this point in the history
  • Loading branch information
GeckoEidechse authored Nov 5, 2023
2 parents 72fed02 + 54fae18 commit ccec2e7
Show file tree
Hide file tree
Showing 30 changed files with 868 additions and 162 deletions.
6 changes: 6 additions & 0 deletions .github/nativefuncs.json
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,12 @@
"helpText":"",
"returnTypeString":"void",
"argTypes":"struct presence"
},
{
"name":"NSGetMasterServerAuthResult",
"helpText":"",
"returnTypeString":"MasterServerAuthResult",
"argTypes":""
}
]
}
19 changes: 19 additions & 0 deletions .github/workflows/add-to-project.yml
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 }}"
11 changes: 9 additions & 2 deletions Northstar.Client/mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
{
"Name": "modlist_show_convars",
"DefaultValue": "0",
"Flags": 16777216
"Flags": "ARCHIVE_PLAYERPROFILE"
},
{
"Name": "modlist_reverse",
"DefaultValue": "0",
"Flags": 16777216
"Flags": "ARCHIVE_PLAYERPROFILE"
}
],
"Scripts": [
Expand Down Expand Up @@ -128,6 +128,13 @@
{
"Path": "ui/ui_mouse_capture.nut",
"RunOn": "UI"
},
{
"Path": "ui/atlas_auth.nut",
"RunOn": "UI",
"UICallback": {
"After": "AtlasAuthDialog"
}
}
],
"Localisation": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,11 @@ Press Yes if you agree to this. This choice can be changed in the mods menu at a
"INVALID_MASTERSERVER_TOKEN" "Invalid or expired masterserver token"
"JSON_PARSE_ERROR" "Error parsing json response"
"UNSUPPORTED_VERSION" "The version you are using is no longer supported"

"AUTHENTICATION_FAILED_HEADER" "Authentication Failed"
"AUTHENTICATION_FAILED_BODY" "Failed to authenticate with Atlas!"
"AUTHENTICATION_FAILED_ERROR_CODE" "Error code: ^DB6F2C00%s1^"
"AUTHENTICATION_FAILED_HELP" "Help"

// Mod Settings
"MOD_SETTINGS" "Mod Settings"
Expand All @@ -346,7 +351,7 @@ Press Yes if you agree to this. This choice can be changed in the mods menu at a

// Toggleable progression
"TOGGLE_PROGRESSION" "Toggle Progression"
"Y_BUTTON_TOGGLE_PROGRESSION" "%[Y_BUTTON]% Toggle Progression"
"Y_BUTTON_TOGGLE_PROGRESSION" "%[Y_BUTTON|]% Toggle Progression"

"PROGRESSION_TOGGLE_ENABLED_HEADER" "Disable Progression?"
"PROGRESSION_TOGGLE_ENABLED_BODY" "Titans, Weapons, Factions, Skins, etc. will all be unlocked and usable at any time.\n\nThis can be changed at any time in the multiplayer lobby."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ Choisissez Oui si vous êtes d'accord. Ce choix peut être modifié à tout inst
"PROGRESSION_TOGGLE_DISABLED_BODY" "Les Titans, Armes, Factions, Skins et autres seront débloqués par la monté en niveau ou par leur achats en mérites.\n\nPeut être changé à n'importe que moment dans le salon multijoueurs.\n\n^CC000000Warning : Si vous équiper des objets que vous n'avez pas encore débloqués, ils seront déséquipés !"
"PROGRESSION_ENABLED_BODY" "^CCCC0000La progression a été activée.^\n\nLes Titans, Armes, Factions, Skins et autres seront débloqués par la monté en niveau ou par leur achats en mérites.\n\nPeut être changé à n'importe que moment dans le salon multijoueurs."
"TOGGLE_PROGRESSION" "Activer la progression"
"Y_BUTTON_TOGGLE_PROGRESSION" "%[Y_BUTTON]% Activer la progression"
"Y_BUTTON_TOGGLE_PROGRESSION" "%[Y_BUTTON|]% Activer la progression"
"PROGRESSION_ANNOUNCEMENT_BODY" "^CCCC0000Le système de progression peut être activé !^\n\nNorthstar supporte désormais le système de progression du jeu original, vous permettant de choisir si vous souhaitez débloquer les armes, skins, titans etc. en gagnant des niveaux et en complétant des défis.\n\nVous pouvez activer la progression en utilisant le bouton en bas de l'écran d'accueil.\n\nCeci peut être changé à tout moment."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
"sns_reset_pulse_blade_cooldown_on_pulse_blade_kill" "Сброс перезарядки пульс. клинка при убийстве им"
"gg_assist_reward" "Множитель награды за помощь в убийстве"
"TOGGLE_PROGRESSION" "Вкл/выкл прогресс"
"Y_BUTTON_TOGGLE_PROGRESSION" "%[Y_BUTTON]% Вкл/выкл прогресс"
"Y_BUTTON_TOGGLE_PROGRESSION" "%[Y_BUTTON|]% Вкл/выкл прогресс"
"PROGRESSION_TOGGLE_DISABLED_HEADER" "Включить прогресс?"
"PROGRESSION_ENABLED_HEADER" "Прогресс включён!"
"PROGRESSION_ENABLED_BODY" "^CCCC0000Прогресс включён.^\n\nНедоступных титанов, оружие, фракции, раскраски, и т.п. теперь нужно разблокировать, или купить за Заслуги.\n\nЭту настройку всегда можно изменить в лобби сетевой игры."
Expand All @@ -341,5 +341,9 @@
"PROGRESSION_TOGGLE_ENABLED_BODY" "Все титаны, оружие, фракции, раскраски, и т.п. станут разблокированы.\n\nЭту настройку всегда можно изменить в лобби сетевой игры."
"PROGRESSION_TOGGLE_DISABLED_BODY" "Будут доступны только разблокированные или купленные вами титаны, оружие, фракции, раскраски, и т.п.\n\nЭту настройку всегда можно изменить в лобби сетевой игры.\n\n^CC000000Внимание: недоступные предметы в экипировке будут заменены на доступные!"
"PROGRESSION_ANNOUNCEMENT_BODY" "^CCCC0000Прогресс!^\n\nВ Northstar теперь работает оригинальная система прогресса разблокировок. Титанов, оружие, фракции, раскраски, и т.п. теперь можно разблокировать через получение новых уровней и прохождение испытаний.\n\nПрогресс можно включить с помощью кнопки внизу меню лобби.\n\nЭту настройку всегда можно изменить."
"AUTHENTICATION_FAILED_BODY" "Не удалось войти в Atlas!"
"AUTHENTICATION_FAILED_ERROR_CODE" "Код ошибки: ^DB6F2C00%s1^"
"AUTHENTICATION_FAILED_HELP" "Справка"
"AUTHENTICATION_FAILED_HEADER" "Ошибка аутентификации"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ Presiona Sí al estar de acuerdo. Esta opcion se puede cambiar en el menú de mo
"PROGRESSION_ENABLED_HEADER" "¡Progreso habilitado!"
"PROGRESSION_DISABLED_HEADER" "¡Progreso deshabilitado!"
"TOGGLE_PROGRESSION" "Cambiar modo de progresión"
"Y_BUTTON_TOGGLE_PROGRESSION" "%[Y_BUTTON]% Cambiar modo de progresión"
"Y_BUTTON_TOGGLE_PROGRESSION" "%[Y_BUTTON|]% Cambiar modo de progresión"
"PROGRESSION_TOGGLE_DISABLED_BODY" "Titanes, Armas, Facciones, Aspectos y otros serán desbloqueados sólo al subir de nivel, o a través de Logros.\n\nÉsta opción puede ser cambiada cuando quieras en la sala de espera.\n\n^CC000000Advertencia: ¡Cualquier equipamiento o utensilio será reiniciado si no lo tienes desbloqueado!"
"MOD_SETTINGS_SERVER" "Servidor"
"MOD_SETTINGS_RESET_ALL" "Reiniciar completamente"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
"PROGRESSION_TOGGLE_DISABLED_BODY" "泰坦,武器, 陣營,皮膚以及其他一切需要解鎖的物品將通過升級或是使用點數購買來進行解鎖。.\n\n您可以隨時在多人大廳中更改此項。\n\n^CC000000警告:如果您已經裝備了尚未解鎖的物品,它們將會被重置!"
"PROGRESSION_TOGGLE_ENABLED_BODY" "泰坦,武器,陣營,皮膚及所有其他一切需要解鎖的物品都將隨時可以進行解鎖並使用。\n\n您可以隨時在多人大廳中更改此項。"
"TOGGLE_PROGRESSION" "遊戲進度"
"Y_BUTTON_TOGGLE_PROGRESSION" "%[Y_BUTTON]% 遊戲進度"
"Y_BUTTON_TOGGLE_PROGRESSION" "%[Y_BUTTON|]% 遊戲進度"
"PROGRESSION_TOGGLE_ENABLED_HEADER" "停用個人進度?"
"PROGRESSION_DISABLED_HEADER" "個人進度已關閉!"
"PROGRESSION_DISABLED_BODY" "^CCCC0000個人進度已停用^\n\n泰坦,武器,陣營,皮膚及所有其他一切需要解鎖的物品將隨時可以進行解鎖並使用。\n\n您可以隨時在多人大廳中更改此項。"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,10 @@ global struct ServerInfo
string region
array< RequiredModInfo > requiredMods
}

global struct MasterServerAuthResult
{
bool success
string errorCode
string errorMessage
}
56 changes: 56 additions & 0 deletions Northstar.Client/mod/scripts/vscripts/ui/atlas_auth.nut
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 Northstar.Client/mod/scripts/vscripts/ui/menu_edit_pilot_loadouts.nut
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 )
}
Loading

0 comments on commit ccec2e7

Please sign in to comment.