@@ -479,33 +479,66 @@ showHowToTooltip(void *unused)
479479 gGui -> activeTooltip = tooltip_manager_get_tooltip (TOOLTIP_TYPE_HOWTO );
480480}
481481
482+ static void
483+ copySeedToClipboard (void * unused )
484+ {
485+ UNUSED (unused );
486+ char seed_str [16 ];
487+ SDL_snprintf (seed_str , sizeof (seed_str ), "%u" , get_random_seed ());
488+ SDL_SetClipboardText (seed_str );
489+ gui_event_message ("Seed copied to clipboard" );
490+ toggleInGameMenu (NULL );
491+ }
492+
493+ static void
494+ buildSeedLabel (char * buf , size_t size )
495+ {
496+ SDL_snprintf (buf , size , "SEED:%u" , get_random_seed ());
497+ }
498+
482499static void
483500initInGameMenu (void )
484501{
485- static TEXT_MENU_ITEM menu_items [] = {
486- {"RESUME" , "" , toggleInGameMenu },
487- {"HOW TO PLAY" , "" , showHowToTooltip },
488- {"MAIN MENU" , "" , goToMainMenu },
489- {"QUIT" , "Exit game" , exitGame },
490- };
502+ static char seed_label [32 ];
503+ buildSeedLabel (seed_label , sizeof (seed_label ));
504+
505+ TEXT_MENU_ITEM menu_items [5 ];
506+ int count = 0 ;
507+
508+ menu_items [count ++ ] = (TEXT_MENU_ITEM ){"RESUME" , "Resume the current game" , toggleInGameMenu };
509+ menu_items [count ++ ] = (TEXT_MENU_ITEM ){"HOW TO PLAY" , "Show the in-game guide" , showHowToTooltip };
510+ if (!weeklyGame ) {
511+ menu_items [count ++ ] = (TEXT_MENU_ITEM ){seed_label , "Copy seed to clipboard" , copySeedToClipboard };
512+ }
513+ menu_items [count ++ ] = (TEXT_MENU_ITEM ){"MAIN MENU" , "Return to the main menu" , goToMainMenu };
514+ menu_items [count ++ ] = (TEXT_MENU_ITEM ){"QUIT" , "Exit game" , exitGame };
491515
492- menu_create_text_menu (& inGameMenu , & menu_items [0 ], 4 , gRenderer );
516+ menu_create_text_menu (& inGameMenu , & menu_items [0 ], count , gRenderer );
493517}
494518
495519static void
496520createInGameGameOverMenu (void )
497521{
498- static TEXT_MENU_ITEM menu_items [] = {
499- {"NEW GAME" , "Start a new game with the same settings" , goToCharacterMenu },
500- {"MAIN MENU" , "" , goToMainMenu },
501- {"QUIT" , "Exit game" , exitGame },
502- };
522+ static char seed_label [32 ];
523+ buildSeedLabel (seed_label , sizeof (seed_label ));
503524
504525 if (inGameMenu ) {
505526 menu_destroy (inGameMenu );
506527 inGameMenu = NULL ;
507528 }
508- menu_create_text_menu (& inGameMenu , & menu_items [0 ], 3 , gRenderer );
529+
530+ TEXT_MENU_ITEM menu_items [4 ];
531+ int count = 0 ;
532+
533+ menu_items [count ++ ] =
534+ (TEXT_MENU_ITEM ){"NEW GAME" , "Start a new game with the same settings" , goToCharacterMenu };
535+ if (!weeklyGame ) {
536+ menu_items [count ++ ] = (TEXT_MENU_ITEM ){seed_label , "Copy seed to clipboard" , copySeedToClipboard };
537+ }
538+ menu_items [count ++ ] = (TEXT_MENU_ITEM ){"MAIN MENU" , "Return to the main menu" , goToMainMenu };
539+ menu_items [count ++ ] = (TEXT_MENU_ITEM ){"QUIT" , "Exit game" , exitGame };
540+
541+ menu_create_text_menu (& inGameMenu , & menu_items [0 ], count , gRenderer );
509542}
510543
511544static void
0 commit comments