Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. Thank you for your support. Tom Speirs

Patreon

Custom multi-system games lists - Plugin Dev Log


stigzler

Recommended Posts

Just to check - there's currently no facility or easy work around for this at the moment?

An example would be A GE menu item such as "Tekken Games" which then takes you to a list of all cross-platform tekken games (Tekken2 - PSX, Tekken 5 - PS2 etc).

Before I embark on another little (!?) plugin project

EDIT: Thought I'd turn this into a dev log - hopefully could attract people to coding

I didn't know a thing about coding 18 moths ago. Now I know just a fraction more than nothing! :)

Link to comment
Share on other sites

Aside from making emulators for each game and then grouping them, no. I have an app for this and it's only about 60% done, not ready for public consumption. In my own testing it was easier to achieve this in a standalone app as opposed to the plugin system.

Basically what I have going is an exe that you add parameters to and it splits out a command line based on the game you select at runtime. It also spits out a MAP file for GameEx to use as the game list. It hides itself until the launched process closes so GameEx doesn't try to regain focus.

What I left of on was a way to build the artwork folders for you. I haven't had much time for development so there it sits. :)

Link to comment
Share on other sites

Thanks Adultery. Cor - so it's looking quite convoluted. 

I was initially quite hopeful, as thought I'd figured out a relatively easy way. To outline the theory:

Basically the plan was to leverage CustomMenus and the Favourites system. So the plugin configuration would alter the custommenus.ini to reflect groupings of games added to the favourites list:

cusommenu_ini.png

In custommenu.exe - looks like this:

custommenus.png

The 'item' is basically the favourites list. My idea was to catch GE before it loaded the Favourites page + alter the data.db3 favourite flags to match the games grouped via the plugin. So, for example, if tekken games is selected, flag all tekken games as 1 in the .db3 and the rest to 0. The data.db3 looks like this:

data_db3.png

However, my plan failed at the first hurdle. :( Tested altering the .db3 file whilst GE running, and it doesn't alter the 'internal' favourites list. I'm guessing GE loads the faves list from .db3 to memory at startup + then all future add/remove favourites is done in memory until GE quits + then it's saved back to .db3. Thus, you cannot manipulate favourites to give you a different list on-the-fly. :(

Had a look at "App_CMD_Type" - appears to be nothing available to direct GameEx to re-load the favourites list from .db3. Damn shame as the rest shouldn't have been too difficult to code. The only other thing I didn't test was how easy it is to write back to the .db3 file once read (did .db3 reading in another app and was a doddle i think - so writing shouldn't be too difficult).

Soooo... any ideas? As it stands the only option is to restart gameex every time you select a new list - which obviously doesn't work!

I see App_CMD_Type is essentially an enumerated value. Are there any other values available apart from those listed in the plugin template? 

        Public Enum App_CMD_Type
            ExitGameEx = 0
            ShutdownPC = 1
            RestartPC = 2
            Minimize = 3
            Restore = 4
            ShowPicture = 5
            ShowWebPage = 6
            PlayAudioFile = 7
            LoadSnapImage = 8
            LoadBackgroundImage = 9
            MsgBox = 10
            Log = 11
            RotateTo0 = 12
            RotateTo90 = 13
            RotateTo270 = 14
        End Enum

My guess would be that, frustratingly, there's going to be a single method in the GE code that loads in the favourites from the db3 (and the other data presumably). Sooo.... *whistles* how difficult would it be to code a App_CMD_Type into GE to enable a 'manual' reload of favourites from the db3 file via an AppCmdType call in a plugin?

:)

 

Link to comment
Share on other sites

OK. Getting somewhere. Can't find a way to have the plugin automatically run ExportToMCE, but tested with manual trigger in GE interface. Video demo'ing the idea:

Any ideas around how to do it all in the plugin rather than user having to manual refresh. Maybe I need to come back to it fresher. 

Link to comment
Share on other sites

Score tonight. Sorted the reading from/writing to the data.db3 file - reads the data into a datatable which can be bound to a datagrid view, which allows editing. The simple class:

Imports System.Data.SQLite

Public Class DBOps
    ' Global because you create it in the ImportGEDb3 and use it in the SaveGEDB3 '
    Private daImport As SQLiteDataAdapter

    Public Function ImportGEDb3(Filepath As String) As DataTable
        Dim dt As New DataTable("Data")
        daImport = New SQLiteDataAdapter("Select * from Data", "Data Source='" & Filepath & "'")
        daImport.Fill(dt)

        ' This is critical, it is the SQLiteCommandBuilder that takes '
        ' the SQLiteDataAdapter SELECT statement and builds the required'
        ' INSERT,UPDATE,DELETE commands.'
        Dim builder = New SQLiteCommandBuilder(daImport)
        Return dt
    End Function

    Public Sub SaveGEDb3(dt As datatable)
        If daImport IsNot Nothing Then
            daImport.Update(dt)
        End If
    End Sub
End Class

Also looked further into the custom menus creation. Appears that you prefix the custom menu number with "32" to get the GameEx page number. E.g. in the CustomMenu above, the "Custom Games List" page is 3201.

Still stumped about whether can run ExportToMCE directly from the plugin. Would be a lot better if could, rather than needing the user to choose a list, manually run the refresh, then choose another sub menu to get the list. 

Link to comment
Share on other sites

Started working on the GUI to edit the custom lists. I prolly do this the wrong way round, but I find mocking together a gui helps get my head around how it's all gonna gel together. 

Screenshot%20-%2012_05_2016%20%2C%2022_4

Rough draft, but the .db3>datagrid>edit>.db3 is working very nicely. The key is the Favourites column, which is hidden here. There other nice bonus is you can essentially edit your played/favourited games list. 

  • Like 1
Link to comment
Share on other sites

Gawd - an awful day's coding. Totally unenjoyable! Still tomorrow's another day. A lot of the graft is messing around with gui's getting the thing useable - the basic theory/code is really only about 5% of the graft/time/toil. Getting closer to getting the GUI done and hence getting the data entry/manipulation finished:

Screenshot%20-%2015_05_2016%20%2C%2000_4

Today's lesson: Separate dataviews bound to the same datatable effect each other - they are not independant of one another. A good, quick separator (e.g. to populate a ComboBox from a datatable):

 With ListNodesCB
            .DisplayMember = "Name"
            .ValueMember = "ID"
            .DataSource = New DataView(CListDS.Tables("List").DefaultView.ToTable)
        End With

I'm throwing in the towel and getting some shut eye in the hope of smoother running tomorrow.

Link to comment
Share on other sites

More luck today. However, I did think this'd be a quick project - just mess about with a few GameEx text files - how hard can that be, right? Oh..oh wait... I'm sure I've said that before. 

Still coming together. Mainly worked on getting CustomLists to knock together CustomMenus - dovetails nicely with CustomMenus.exe + also automates the images process. Scratch vid here:

Back tuit.

  • Like 1
Link to comment
Share on other sites

Buffing up. Attending to the finer details. Working mainly on the custom lists 'browsing' thingy (i use the term loosely):

I must thank Active Presenter for making whether it records the cursor of not totally random and unpredictable. 

  • Like 1
Link to comment
Share on other sites

Ok. So the polish stage takes a bit of patience. Tonight, mainly working on code to make CustomLists and GameEx CustomMenus to play nicely together. Problem being, both work on the same file, so had to introduce some kind of system to ensure they synced with each other. In the end, just wrote custom key into to ini structure to indicate which menus written by CL and which by CM. 

Testing is starting up + pleasantly surprised that you can do a lot of the editing on the fly (that is have GameEx running and edit the lists + games 'live'). Few things left to do like loading bars and reloading the data.db3 on user action to enable you to add favourites in gameex and refresh this in CLists live. 

Overall, pleased with this one - feels like a tidy little app - better than my usual sprawling monstrous efforts! And hopefully of use!

  • Like 1
Link to comment
Share on other sites

Added a couple more fings to make use a little easier:

  • On-the-fly refresh of the game list (can add new favourite in gameex, then refresh CustomLists without restarting either - they proper work in tandem). 
  • Game Lookups - the list just held the rom name. For mame - these could be quite mysterious. Wrote little routine to leverage the db names already read into CustomLists to cross reference the rom name with the goodname in each system's database. Can do one game at a time, a selection or all. The gamename is then populated into the datatable. 
  • Other tweaks and twerks. 

Couple more bits, then over to Beta.

  • Like 1
Link to comment
Share on other sites

lo..f'in,l. I'm always a day late and a dollar short - very concious that Evo's around the corner, but just can't help myself. :)

Save the congrats for after we see whether it works or not.. you know my stuff!? :P

Thanks though null - spiriting to get something.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...