Skip to content

Commit ef4ada5

Browse files
authored
Merge pull request #223 from walkero-gr/fix-morphos-menus
Fixed MorphOS menus
2 parents abbe647 + 7f8cae2 commit ef4ada5

File tree

5 files changed

+213
-16
lines changed

5 files changed

+213
-16
lines changed

CHANGELOG.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
## iGame VERSION_TAG - [RELEASE_DATE]
2+
### Changed
3+
- Simplified the version string and added the release date in the screen title
4+
5+
### Fixed
6+
- Fixed the menus in MorphOS that were broken for some time now
7+
8+
## iGame 2.4.1 - [2023-07-19]
29
### Added
310
- Now the Genre list is populated from the igame.data files and the genre file, if it exists, although it is not necessary. The genre filtering is working with these new values
4-
- Added a new cycle box that lets the user to filter the results based on the chipset. This requires in settings the "Prefer igame.data files" to be enabled
11+
- Added a new cycle box that lets the user filter the results based on the chipset. This requires in settings the "Prefer igame.data files" to be enabled
512

613
### Changed
7-
- When realtime filtering is enabled at least 3 characters are required so as to be initiated. Less than 3 characters are ignored, unless the filtering by pressing the enter button is enabled.
8-
- Removed the filtering options from the Genre list and moved to its own select box above entries list
14+
- When real-time filtering is enabled at least 3 characters are required so as to be initiated. Less than 3 characters are ignored, unless the filtering by pressing the enter button is enabled.
15+
- Removed the filtering options from the Genre list and moved them to their own select box above the entries list
916
- Now, even if the list entries list is populated a new repository scan will update the Chipset and Genre information based on the data found in igame.data files.
1017
- If the "Prefer igame.data files" is not enabled those files are not used during the scan of repositories
1118

Makefile.docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ src/funcs_$(CPU).o: src/funcs.c src/iGame_strings.h src/strfuncs.h \
132132
src/chipsetList.h
133133

134134
src/iGameGUI_$(CPU).o: src/iGameGUI.c src/iGameGUI.h src/iGame_strings.h \
135-
src/fsfuncs.h src/iGameExtern.h
135+
src/fsfuncs.h src/iGameExtern.h src/version.h
136136

137137
src/iGameMain_$(CPU).o: src/iGameMain.c src/iGameExtern.h
138138

src/iGameExtern.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@
5454
// #define SCREENASPECT_HOTKEY 's'
5555
// #define SCALEMODEMASK(u,d,p,s) (((u)?GGSMF_SCALEUP:0)|((d)?GGSMF_SCALEDOWN:0)|((p)?GGSMF_KEEPASPECT_PICTURE:0)|((s)?GGSMF_KEEPASPECT_SCREEN:0))
5656

57-
// #define MENU_SCANREPOS_HOTKEY "R"
58-
// #define MENU_ADDNONWHDLOADGAME_HOTKEY "A"
57+
#define MENU_SCANREPOS_HOTKEY "R"
58+
#define MENU_ADDNONWHDLOADGAME_HOTKEY "A"
5959
#define MENU_OPENLIST_HOTKEY "O"
6060
#define MENU_SAVELIST_HOTKEY "S"
61-
// #define MENU_ABOUT_HOTKEY "?"
62-
// #define MENU_QUIT_HOTKEY "Q"
63-
// #define MENU_PROPERTIES_HOTKEY "P"
64-
// #define MENU_DELETE_HOTKEY "D"
61+
#define MENU_ABOUT_HOTKEY "?"
62+
#define MENU_QUIT_HOTKEY "Q"
63+
#define MENU_PROPERTIES_HOTKEY "P"
64+
#define MENU_DELETE_HOTKEY "D"
6565

6666
#define MAX_SLAVE_TITLE_SIZE 128
6767
#define MAX_GENRE_NAME_SIZE 32

src/iGameGUI.c

Lines changed: 195 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,22 @@
7676
extern igame_settings *current_settings;
7777
extern blockGuiGfx;
7878

79+
#ifndef __MORPHOS__
7980
static void translateMenu(struct NewMenu *);
8081
static 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__
9295
static 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

116120
static 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

src/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@
3939
#define COPY_END_YEAR 2023
4040

4141
#ifndef VERSION
42-
#define VERSION "$VER: iGame v" STR(MAJOR_VERS) "." STR(MINOR_VERS) "." STR(PATCH_VERS) " for " STR(CPU_VERS) " (" STR(RELEASE_DATE) ")"
42+
#define VERSION "$VER: iGame " STR(MAJOR_VERS) "." STR(MINOR_VERS) "." STR(PATCH_VERS) " (" STR(RELEASE_DATE) ")"
4343
#endif

0 commit comments

Comments
 (0)