aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Client/mod/scripts/vscripts/ui
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-11 22:28:45 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-11 22:28:45 +0000
commit30bc58c9ab1563a1dcbbb671db9ee446dc7df37d (patch)
tree9647ad6b78b055071808e0834e9a7f96858a7810 /Northstar.Client/mod/scripts/vscripts/ui
parent8cd6924c1112213442b755866a5b6811efae236c (diff)
downloadNorthstarMods-30bc58c9ab1563a1dcbbb671db9ee446dc7df37d.tar.gz
NorthstarMods-30bc58c9ab1563a1dcbbb671db9ee446dc7df37d.zip
more fixes
Diffstat (limited to 'Northstar.Client/mod/scripts/vscripts/ui')
-rw-r--r--Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut68
1 files changed, 51 insertions, 17 deletions
diff --git a/Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut b/Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut
index ca7a1f7b..9a0850c0 100644
--- a/Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut
+++ b/Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut
@@ -128,6 +128,7 @@ void function InitMainMenuPanel()
//AddPanelFooterOption( file.panel, BUTTON_BACK, "", "", ClosePostGameMenu )
thread TrackInstallProgress()
+ UpdateCustomMainMenuPromos()
}
void function OnShowMainMenuPanel()
@@ -225,9 +226,6 @@ void function UpdatePlayButton( var button )
while ( GetTopNonDialogMenu() == file.menu )
{
- bool isSpotlightReady = file.promoData.version != 0 ? true : false
- Hud_SetVisible( file.spotlightPanel, isSpotlightReady )
-
if ( !Hud_IsFocused( button ) )
{
RuiSetBool( file.serviceStatus, "isVisible", false )
@@ -755,31 +753,63 @@ bool function HasLatestPatch()
}
#endif // PS4_PROG
+// custom mainmenupromos stuff
+
+// nopping these
void function UpdatePromoData()
{
- file.promoData = GetMainMenuPromos()
-
- UpdateWhatsNewData()
- UpdateSpotlightData()
}
void function UICodeCallback_MainMenuPromosUpdated()
{
- printt( "MainMenuPromos updated" )
+}
+
+enum eMainMenuPromoDataProperty
+{
+ newInfoTitle1,
+ newInfoTitle2,
+ newInfoTitle3,
+
+ largeButtonTitle,
+ largeButtonText,
+ largeButtonUrl,
+ largeButtonImageIndex,
+
+ smallButton1Title,
+ smallButton1Url,
+ smallButton1ImageIndex,
+
+ smallButton2Title,
+ smallButton2Url,
+ smallButton2ImageIndex
+}
+
+void function UpdateCustomMainMenuPromos()
+{
+ NSRequestCustomMainMenuPromos()
+
+ thread UpdateCustomMainMenuPromosThreaded()
+}
- UpdatePromoData()
+void function UpdateCustomMainMenuPromosThreaded()
+{
+ while ( !NSHasCustomMainMenuPromoData() )
+ WaitFrame()
+
+ UpdateWhatsNewData()
+ UpdateSpotlightData()
}
void function UpdateWhatsNewData()
{
// file.promoData.newInfo_ImageIndex
//RuiSetString( file.whatsNew, "line1Text", "`2%$rui/menu/main_menu/whats_new_bulletpoint%`0 Updated Live Fire Maps!\n`2%$rui/menu/main_menu/whats_new_bulletpoint%`0 Prime Titans`0 in the Store\n`2%$rui/menu/main_menu/whats_new_bulletpoint% DOUBLE XP`0 weekend!" )//file.promoData.newInfo_Title1 )
- RuiSetString( file.whatsNew, "line1Text", file.promoData.newInfo_Title1 )
- RuiSetString( file.whatsNew, "line2Text", file.promoData.newInfo_Title2 )
- RuiSetString( file.whatsNew, "line3Text", file.promoData.newInfo_Title3 )
+ RuiSetString( file.whatsNew, "line1Text", expect string( NSGetCustomMainMenuPromoData( eMainMenuPromoDataProperty.newInfoTitle1 ) ) )
+ RuiSetString( file.whatsNew, "line2Text", expect string( NSGetCustomMainMenuPromoData( eMainMenuPromoDataProperty.newInfoTitle2 ) ) )
+ RuiSetString( file.whatsNew, "line3Text", expect string( NSGetCustomMainMenuPromoData( eMainMenuPromoDataProperty.newInfoTitle3 ) ) )
bool isVisible = true
- if ( file.promoData.newInfo_Title1 == "" && file.promoData.newInfo_Title2 == "" && file.promoData.newInfo_Title3 == "" )
+ if ( NSGetCustomMainMenuPromoData( eMainMenuPromoDataProperty.newInfoTitle1 ) == "" && NSGetCustomMainMenuPromoData( eMainMenuPromoDataProperty.newInfoTitle2 ) == "" && NSGetCustomMainMenuPromoData( eMainMenuPromoDataProperty.newInfoTitle3 ) == "" )
isVisible = false
RuiSetBool( file.whatsNew, "isVisible", isVisible )
@@ -787,9 +817,9 @@ void function UpdateWhatsNewData()
void function UpdateSpotlightData()
{
- SetSpotlightButtonData( file.spotlightButtons[0], file.promoData.largeButton_Url, file.promoData.largeButton_ImageIndex, file.promoData.largeButton_Title, file.promoData.largeButton_Text )
- SetSpotlightButtonData( file.spotlightButtons[1], file.promoData.smallButton1_Url, file.promoData.smallButton1_ImageIndex, file.promoData.smallButton1_Title )
- SetSpotlightButtonData( file.spotlightButtons[2], file.promoData.smallButton2_Url, file.promoData.smallButton2_ImageIndex, file.promoData.smallButton2_Title )
+ SetSpotlightButtonData( file.spotlightButtons[0], expect string( NSGetCustomMainMenuPromoData( eMainMenuPromoDataProperty.largeButtonUrl ) ), expect int( NSGetCustomMainMenuPromoData( eMainMenuPromoDataProperty.largeButtonImageIndex ) ), expect string( NSGetCustomMainMenuPromoData( eMainMenuPromoDataProperty.largeButtonTitle ) ), expect string( NSGetCustomMainMenuPromoData( eMainMenuPromoDataProperty.largeButtonText ) ) )
+ SetSpotlightButtonData( file.spotlightButtons[1], expect string( NSGetCustomMainMenuPromoData( eMainMenuPromoDataProperty.smallButton1Url ) ), expect int( NSGetCustomMainMenuPromoData( eMainMenuPromoDataProperty.smallButton1ImageIndex ) ), expect string( NSGetCustomMainMenuPromoData( eMainMenuPromoDataProperty.smallButton1Title ) ) )
+ SetSpotlightButtonData( file.spotlightButtons[2], expect string( NSGetCustomMainMenuPromoData( eMainMenuPromoDataProperty.smallButton2Url ) ), expect int( NSGetCustomMainMenuPromoData( eMainMenuPromoDataProperty.smallButton2ImageIndex ) ), expect string( NSGetCustomMainMenuPromoData( eMainMenuPromoDataProperty.smallButton2Title ) ) )
}
void function SetSpotlightButtonData( var button, string link, int imageIndex, string title, string details = "skip" )
@@ -806,6 +836,7 @@ void function SetSpotlightButtonData( var button, string link, int imageIndex, s
RuiSetString( rui, "detailsText", details )
button.s.link = link
+ Hud_SetVisible( file.spotlightPanel, true )
}
void function SpotlightButton_Activate( var button )
@@ -847,6 +878,9 @@ void function SpotlightButton_Activate( var button )
}
else
{
- LaunchExternalWebBrowser( link, WEBBROWSER_FLAG_MUTEGAME )
+ if ( link.find( "https://discord.gg" ) == 0 )
+ LaunchExternalWebBrowser( link, WEBBROWSER_FLAG_FORCEEXTERNAL )
+ else
+ LaunchExternalWebBrowser( link, WEBBROWSER_FLAG_MUTEGAME )
}
}