7676extern igame_settings * current_settings ;
7777extern blockGuiGfx ;
7878
79+ #ifndef __MORPHOS__
7980static void translateMenu (struct NewMenu * );
8081static void flagMenuItem (struct NewMenu * , APTR , UWORD );
8182
8283#define TICK (CHECKIT|MENUTOGGLE)
8384#define DIS NM_ITEMDISABLED
8485#define STR_ID (x ) ( (STRPTR)(x) )
86+ #endif // ndef __MORPHOS__
8587
8688#if defined(__amigaos4__ )
8789#define AllocVecShared (size , flags ) AllocVecTags((size), AVT_Type, MEMF_SHARED, AVT_Lock, FALSE, ((flags)&MEMF_CLEAR) ? AVT_ClearWithValue : TAG_IGNORE, 0, TAG_DONE)
8890#else
8991#define AllocVecShared (size , flags ) AllocVec((size), (flags))
9092#endif
9193
94+ #ifndef __MORPHOS__
9295static struct NewMenu MenuMainWin [] =
9396{
9497 { NM_TITLE , STR_ID (MSG_MNlabel2Actions ) , 0 ,0 ,0 ,(APTR )MENU_ACTIONS },
@@ -112,6 +115,7 @@ static struct NewMenu MenuMainWin[] =
112115
113116 { NM_END ,NULL ,0 ,0 ,0 ,NULL }
114117};
118+ #endif // ndef __MORPHOS__
115119
116120static struct Listentry
117121{
@@ -242,21 +246,31 @@ struct ObjApp *CreateApp(void)
242246 struct ObjApp * object ;
243247 APTR strip ;
244248 static char about_text [512 ];
245- static char version_string [16 ];
249+ static char version_string [30 ];
246250
251+ #ifndef __MORPHOS__
247252 translateMenu (MenuMainWin );
253+ #endif // ndef __MORPHOS__
248254
249255 snprintf (version_string , sizeof (version_string ),
250- "%s v %d.%d.%d" ,
256+ "%s %d.%d.%d (%s) " ,
251257 GetMBString (MSG_WI_MainWindow ),
252- MAJOR_VERS , MINOR_VERS , PATCH_VERS
258+ MAJOR_VERS , MINOR_VERS , PATCH_VERS , STR ( RELEASE_DATE )
253259 );
254260
255261 snprintf (about_text , sizeof (about_text ),
256- "%s (%s) \n%s %s\n\nCopyright 2005-%d\n%s"
257- , version_string , STR ( RELEASE_DATE ) , GetMBString (MSG_compiledForAboutWin ), STR (CPU_VERS ), COPY_END_YEAR , GetMBString (MSG_TX_About )
262+ "%s\n%s %s\n\nCopyright 2005-%d\n%s" ,
263+ version_string , GetMBString (MSG_compiledForAboutWin ), STR (CPU_VERS ), COPY_END_YEAR , GetMBString (MSG_TX_About )
258264 );
259265
266+ #ifdef __MORPHOS__
267+ APTR MNlabel2Actions , MNlabelScan , MNMainAddnonWHDLoadgame , MNMainMenuShowHidehiddenentries ;
268+ APTR MNMainBarLabel0 , MNMainAbout ;
269+ APTR MNMainBarLabel1 , MNMainQuit , MNlabel2Game , MNMainProperties , MNMainOpenCurrentDir ;
270+ APTR MNlabel2Tools , MNMainiGameSettings ;
271+ APTR MNlabel2GameRepositories , MNMainBarLabel2 , MNMainMUISettings ;
272+ #endif // ndef __MORPHOS__
273+
260274 APTR MNMainOpenList , MNMainSaveList , MNMainSaveListAs ;
261275 // APTR MNMainMenuDuplicate;
262276 // APTR MNMainDelete;
@@ -281,6 +295,14 @@ struct ObjApp *CreateApp(void)
281295 APTR GR_SettingsButtons , Space_SettingsButtons1 , Space_SettingsButtons2 ;
282296
283297// TODO: Change all the hooks to use SDI_Hook.h and MakeStaticHook()
298+ #ifdef __MORPHOS__
299+ static const struct Hook MenuScanHook = { { NULL ,NULL }, HookEntry , (HOOKFUNC )scan_repositories , NULL };
300+ static const struct Hook MenuShowHideHiddenHook = { { NULL ,NULL }, HookEntry , (HOOKFUNC )list_show_hidden , NULL };
301+ static const struct Hook MenuPropertiesHook = { { NULL ,NULL }, HookEntry , (HOOKFUNC )slaveProperties , NULL };
302+ static const struct Hook MenuAddNonWhdloadHook = { { NULL ,NULL }, HookEntry , (HOOKFUNC )add_non_whdload , NULL };
303+ static const struct Hook OpenCurrentDirHook = { { NULL ,NULL }, HookEntry , (HOOKFUNC )open_current_dir , NULL };
304+ #endif
305+
284306#if defined(__amigaos4__ )
285307 static const struct Hook MenuOpenListHook = { { NULL ,NULL }, (HOOKFUNC )open_list , NULL , NULL };
286308#else
@@ -640,6 +662,22 @@ MakeStaticHook(SettingUseIgameDataTitleHook, settingUseIgameDataTitleChanged);
640662 Child , object -> TX_Status ,
641663 End ;
642664
665+ #ifdef __MORPHOS__
666+ MNlabelScan = MenuitemObject ,
667+ MUIA_Menuitem_Title , GetMBString (MSG_MNlabelScan ),
668+ MUIA_Menuitem_Shortcut , MENU_SCANREPOS_HOTKEY ,
669+ End ;
670+
671+ MNMainAddnonWHDLoadgame = MenuitemObject ,
672+ MUIA_Menuitem_Title , GetMBString (MSG_MNMainAddnonWHDLoadgame ),
673+ MUIA_Menuitem_Shortcut , MENU_ADDNONWHDLOADGAME_HOTKEY ,
674+ End ;
675+
676+ MNMainMenuShowHidehiddenentries = MenuitemObject ,
677+ MUIA_Menuitem_Title , GetMBString (MSG_MNMainMenuShowHidehiddenentries ),
678+ End ;
679+ #endif
680+
643681 MNMainOpenList = MenuitemObject ,
644682 MUIA_Menuitem_Title , GetMBString (MSG_MNMainOpenList ),
645683 MUIA_Menuitem_Shortcut , MENU_OPENLIST_HOTKEY ,
@@ -654,6 +692,47 @@ MakeStaticHook(SettingUseIgameDataTitleHook, settingUseIgameDataTitleChanged);
654692 MUIA_Menuitem_Title , GetMBString (MSG_MNMainSaveListAs ),
655693 End ;
656694
695+ #ifdef __MORPHOS__
696+ MNMainBarLabel0 = MUI_MakeObject (MUIO_Menuitem , NM_BARLABEL , 0 , 0 , 0 );
697+
698+ MNMainAbout = MenuitemObject ,
699+ MUIA_Menuitem_Title , GetMBString (MSG_MNMainAbout ),
700+ MUIA_Menuitem_Shortcut , MENU_ABOUT_HOTKEY ,
701+ End ;
702+
703+ MNMainBarLabel1 = MUI_MakeObject (MUIO_Menuitem , NM_BARLABEL , 0 , 0 , 0 );
704+
705+ MNMainQuit = MenuitemObject ,
706+ MUIA_Menuitem_Title , GetMBString (MSG_MNMainQuit ),
707+ MUIA_Menuitem_Shortcut , MENU_QUIT_HOTKEY ,
708+ End ;
709+
710+ MNlabel2Actions = MenuitemObject ,
711+ MUIA_Menuitem_Title , GetMBString (MSG_MNlabel2Actions ),
712+ MUIA_Family_Child , MNlabelScan ,
713+ MUIA_Family_Child , MNMainAddnonWHDLoadgame ,
714+ MUIA_Family_Child , MNMainMenuShowHidehiddenentries ,
715+ /* MUIA_Family_Child, MNMainBarLabel5, */
716+ /* MUIA_Family_Child, MNMainOpenList, */
717+ /* MUIA_Family_Child, MNMainSaveList, */
718+ /* MUIA_Family_Child, MNMainSaveListAs, */
719+ MUIA_Family_Child , MNMainBarLabel0 ,
720+ MUIA_Family_Child , MNMainAbout ,
721+ MUIA_Family_Child , MNMainBarLabel1 ,
722+ MUIA_Family_Child , MNMainQuit ,
723+ End ;
724+
725+ MNMainProperties = MenuitemObject ,
726+ MUIA_Menuitem_Title , GetMBString (MSG_MNMainProperties ),
727+ MUIA_Menuitem_Shortcut , MENU_PROPERTIES_HOTKEY ,
728+ End ;
729+
730+ MNMainOpenCurrentDir = MenuitemObject ,
731+ MUIA_Menuitem_Title , GetMBString (MSG_MNMainOpenCurrentDir ),
732+ //MUIA_Menuitem_Shortcut, GetMBString(MSG_MNMainOpenCurrentDirChar),
733+ End ;
734+ #endif
735+
657736 // MNMainMenuDuplicate = MenuitemObject,
658737 // MUIA_Menuitem_Title, GetMBString(MSG_MNMainMenuDuplicate),
659738 // End;
@@ -663,15 +742,54 @@ MakeStaticHook(SettingUseIgameDataTitleHook, settingUseIgameDataTitleChanged);
663742 // MUIA_Menuitem_Shortcut, MENU_DELETE_HOTKEY,
664743 // End;
665744
745+ #ifndef __MORPHOS__
666746 if (get_wb_version () < 44 )
667747 {
668748 flagMenuItem (MenuMainWin , (APTR )MENU_GAMEFOLDER , DIS );
669749 }
750+ #else
751+ MNlabel2Game = MenuitemObject ,
752+ MUIA_Menuitem_Title , GetMBString (MSG_MNlabel2Game ),
753+ MUIA_Family_Child , MNMainProperties ,
754+ End ;
755+
756+ MNMainiGameSettings = MenuitemObject ,
757+ MUIA_Menuitem_Title , GetMBString (MSG_MNMainiGameSettings ),
758+ End ;
759+
760+ MNlabel2GameRepositories = MenuitemObject ,
761+ MUIA_Menuitem_Title , GetMBString (MSG_MNlabel2GameRepositories ),
762+ End ;
763+
764+ MNMainBarLabel2 = MUI_MakeObject (MUIO_Menuitem , NM_BARLABEL , 0 , 0 , 0 );
765+
766+ MNMainMUISettings = MenuitemObject ,
767+ MUIA_Menuitem_Title , GetMBString (MSG_MNMainMUISettings ),
768+ End ;
769+
770+ MNlabel2Tools = MenuitemObject ,
771+ MUIA_Menuitem_Title , GetMBString (MSG_MNlabel2Tools ),
772+ MUIA_Family_Child , MNMainiGameSettings ,
773+ MUIA_Family_Child , MNlabel2GameRepositories ,
774+ MUIA_Family_Child , MNMainBarLabel2 ,
775+ MUIA_Family_Child , MNMainMUISettings ,
776+ End ;
777+
778+ object -> MN_MainMenu = MenustripObject ,
779+ MUIA_Family_Child , MNlabel2Actions ,
780+ MUIA_Family_Child , MNlabel2Game ,
781+ MUIA_Family_Child , MNlabel2Tools ,
782+ End ;
783+ #endif
670784
671785 object -> WI_MainWindow = WindowObject ,
672786 MUIA_Window_ScreenTitle , version_string ,
673787 MUIA_Window_Title , GetMBString (MSG_WI_MainWindow ),
788+ #ifndef __MORPHOS__
674789 MUIA_Window_Menustrip , strip = MUI_MakeObject (MUIO_MenustripNM , MenuMainWin , 0 ),
790+ #else
791+ MUIA_Window_Menustrip , object -> MN_MainMenu ,
792+ #endif
675793 MUIA_Window_ID , MAKE_ID ('0' , 'I' , 'G' , 'A' ),
676794 MUIA_Window_AppWindow , TRUE,
677795 WindowContents , GROUP_ROOT ,
@@ -1693,6 +1811,78 @@ MakeStaticHook(SettingUseIgameDataTitleHook, settingUseIgameDataTitleChanged);
16931811 0
16941812 );
16951813
1814+ #ifdef __MORPHOS__
1815+ DoMethod (MNlabelScan ,
1816+ MUIM_Notify , MUIA_Menuitem_Trigger , MUIV_EveryTime ,
1817+ object -> App ,
1818+ 2 ,
1819+ MUIM_CallHook , & MenuScanHook
1820+ );
1821+
1822+ DoMethod (MNMainAddnonWHDLoadgame ,
1823+ MUIM_Notify , MUIA_Menuitem_Trigger , MUIV_EveryTime ,
1824+ object -> App ,
1825+ 2 ,
1826+ MUIM_CallHook , & MenuAddNonWhdloadHook
1827+ );
1828+
1829+ DoMethod (MNMainMenuShowHidehiddenentries ,
1830+ MUIM_Notify , MUIA_Menuitem_Trigger , MUIV_EveryTime ,
1831+ object -> App ,
1832+ 2 ,
1833+ MUIM_CallHook , & MenuShowHideHiddenHook
1834+ );
1835+ DoMethod (MNMainAbout ,
1836+ MUIM_Notify , MUIA_Menuitem_Trigger , MUIV_EveryTime ,
1837+ object -> WI_About ,
1838+ 3 ,
1839+ MUIM_Set , MUIA_Window_Open , TRUE
1840+ );
1841+
1842+ DoMethod (MNMainQuit ,
1843+ MUIM_Notify , MUIA_Menuitem_Trigger , MUIV_EveryTime ,
1844+ object -> App ,
1845+ 2 ,
1846+ MUIM_Application_ReturnID , MUIV_Application_ReturnID_Quit
1847+ );
1848+
1849+ DoMethod (MNMainProperties ,
1850+ MUIM_Notify , MUIA_Menuitem_Trigger , MUIV_EveryTime ,
1851+ object -> App ,
1852+ 2 ,
1853+ MUIM_CallHook , & MenuPropertiesHook
1854+ );
1855+
1856+ //OPEN CURRENT DIR
1857+ DoMethod (MNMainOpenCurrentDir ,
1858+ MUIM_Notify , MUIA_Menuitem_Trigger , MUIV_EveryTime ,
1859+ object -> App ,
1860+ 2 ,
1861+ MUIM_CallHook , & OpenCurrentDirHook
1862+ );
1863+
1864+ DoMethod (MNMainiGameSettings ,
1865+ MUIM_Notify , MUIA_Menuitem_Trigger , MUIV_EveryTime ,
1866+ object -> WI_Settings ,
1867+ 3 ,
1868+ MUIM_Set , MUIA_Window_Open , TRUE
1869+ );
1870+
1871+ DoMethod (MNlabel2GameRepositories ,
1872+ MUIM_Notify , MUIA_Menuitem_Trigger , MUIV_EveryTime ,
1873+ object -> WI_GameRepositories ,
1874+ 3 ,
1875+ MUIM_Set , MUIA_Window_Open , TRUE
1876+ );
1877+
1878+ DoMethod (MNMainMUISettings ,
1879+ MUIM_Notify , MUIA_Menuitem_Trigger , MUIV_EveryTime ,
1880+ object -> App ,
1881+ 2 ,
1882+ MUIM_Application_OpenConfigWindow , 0
1883+ );
1884+ #endif
1885+
16961886 return object ;
16971887}
16981888
0 commit comments