@@ -130,13 +130,15 @@ class BaseMenu {
130130 static continueImg = $ < Image > ( '#ContinueSaveThumb' ) ! ;
131131
132132 static bgMapLoad : uuid | undefined = undefined ;
133+ static bgMapAuthorLabel = $ < Label > ( '#BgName' ) ! ;
134+ static bgMapAuthorImg = $ < Image > ( '#BgAvatar' ) ! ;
133135
134136 static mapSelection = 0 ;
135137 static maps = [
136- 'p2ce_background_chmb18_ovg' ,
137- 'p2ce_background_laser_intro' ,
138- 'p2ce_background_gentle_hum' ,
139- 'p2ce_background_mikatastrophe-dark'
138+ { map : 'p2ce_background_chmb18_ovg' , author : { name : 'Beckeroo' , image : 'beckeroo.jpg' } } ,
139+ { map : 'p2ce_background_gentle_hum' , author : { name : 'Beckeroo' , image : 'beckeroo.jpg' } } ,
140+ { map : 'p2ce_background_laser_intro' , author : { name : 'pivotman319' , image : 'pivotman319.jpg' } } ,
141+ { map : 'p2ce_background_mikatastrophe-dark' , author : { name : 'mikatastrophe' , image : 'mikatastrophe.png' } } ,
140142 ] ;
141143 static music ;
142144
@@ -284,10 +286,13 @@ class BaseMenu {
284286
285287 static rerollMap ( ) {
286288 this . mapSelection = Math . floor ( Math . random ( ) * this . maps . length ) ;
287- $ . Msg ( `BASE MENU: Rolled background map: ${ this . mapSelection } , ${ this . maps [ this . mapSelection ] } ` ) ;
289+ const map = this . maps [ this . mapSelection ] ;
290+ $ . Msg ( `BASE MENU: Rolled background map: ${ this . mapSelection } , ${ map . map } ` ) ;
291+ this . bgMapAuthorLabel . text = map . author . name ;
292+ this . bgMapAuthorImg . SetImage ( `file://{images}/menu/featured/author_${ map . author . image } ` ) ;
288293 $ . DispatchEvent (
289294 'MainMenuSetBackgroundImage' ,
290- `file://{images}/menu/featured/${ this . maps [ this . mapSelection ] } .png`
295+ `file://{images}/menu/featured/${ map . map } .png`
291296 ) ;
292297 }
293298
@@ -332,7 +337,7 @@ class BaseMenu {
332337 this . bgMapLoad = GameInterfaceAPI . RegisterGameEventHandler (
333338 'map_load_failed' ,
334339 ( mapName : string , isBackgroundMap : boolean ) => {
335- if ( ! isBackgroundMap || mapName !== `maps\\${ this . maps [ this . mapSelection ] } .bsp` ) return ;
340+ if ( ! isBackgroundMap || mapName !== `maps\\${ this . maps [ this . mapSelection ] . map } .bsp` ) return ;
336341 $ . Warning ( '!!!!! Could not load featured background map !!!!!' ) ;
337342 $ . Schedule ( 0.001 , ( ) => {
338343 $ . DispatchEvent ( 'MainMenuSwitchReverse' , false ) ;
@@ -343,7 +348,7 @@ class BaseMenu {
343348 }
344349
345350 $ . RegisterForUnhandledEvent ( 'MapLoaded' , ( map : string , bg : boolean ) => {
346- if ( bg && map === `maps\\${ this . maps [ this . mapSelection ] } .bsp` ) {
351+ if ( bg && map === `maps\\${ this . maps [ this . mapSelection ] . map } .bsp` ) {
347352 $ . DispatchEvent ( 'MainMenuHideBackgroundImage' , false ) ;
348353 $ . DispatchEvent ( 'MainMenuSwitchReverse' , false ) ;
349354 $ . DispatchEvent ( 'MainBackgroundLoaded' ) ;
@@ -356,7 +361,7 @@ class BaseMenu {
356361
357362 $ . Schedule ( 0.1 , ( ) => {
358363 GameInterfaceAPI . ConsoleCommand ( 'disconnect' ) ;
359- GameInterfaceAPI . ConsoleCommand ( `map_background "${ this . maps [ this . mapSelection ] } "` ) ;
364+ GameInterfaceAPI . ConsoleCommand ( `map_background "${ this . maps [ this . mapSelection ] . map } "` ) ;
360365 } ) ;
361366 }
362367
0 commit comments