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

Plugin Coding Queries - New Query


stigzler

Recommended Posts

QUERY #1 (RESOLVED!):

Still reasonably new to plugin coding... I'm seeking help from the coding geniuses on here.....

I'm lacking some basic knowledge on this one. My project:

DSQuery.png

GemDS is a dataset made via Dataset Design view. I'm trying to access this dataset in the GameEx.Plugin.vb class, but because it's a clas (and not a form) I can't figure for the life of me how to do this!! If it were a form, I'd do this:

DSQuery2.png

But, of course, because GameEx.Plugin is a class - there are no controls to 'add.'

Sorry - know this may seem obvious to you proper coding guys - but it's got me stumped!

As ever, would appreciate any help. :)

Dunno if helps, but full code here:

https://gemvoy.codeplex.com/SourceControl/latest#GEmvoy/GEmvoy/Code/GameEx.Plugin.vb

Link to comment
Share on other sites

First things first, try to keep as much code as you can out of the plugin itself. If you can access the class from your own namespace, do that and then call your methods from the plug-in instead.

I create my datasets myself instead of using the toolbox. I'm not sure what you're after here, but the best way to manage datasets is through code so you have total control.

That being said, you can write a class that manages the data in your dataset through properties or shared functions or whatever you prefer, and you can pass your data back and forth freely without doing anything special.

/my 2c

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

Query #2: Getting Rom file extension from Plugin

Hit a weird one tonight. However, it's super-crucial to this plugin I'm writing, so do hope it can be resolved. The game data available from the GameEx Plugin:

 <StructLayout(LayoutKind.Sequential)> _        Public Structure Database            Public Category As String            Public Year As String            Public Developer As String            Public Description As String        End Structure               <StructLayout(LayoutKind.Sequential)> _        Public Structure Mame_Info            Public Players As String            Public Control As String            Public CloneOf As String            Public Orientation As String            Public VideoWidth As Integer            Public VideoHeight As Integer            Public Cocktail As Boolean        End Structure        <StructLayout(LayoutKind.Sequential)> _        Public Structure Game_Info            Public EmulatorNumber As Integer            Public EmulatorName As String            Public GameName As String            Public ROMPath As String            Public ROMName As String            Public GameData As Database            Public MameInfo As Mame_Info            Public RomFilter As String            Public SnapPath As String            Public TitlePath As String            Public CmdLine As String        End Structure

However, ROMName just gives you the ROM name without extension. Can't see any other way to get the extension of the selected ROM.

I see in your Quicklaunch plugin, Adultery, one of your tokens has the rom with the extension - how did you extract this from GE? Can't think of any way to do it, unless it's tucked away in a .ini or .cfg somewhere upon game selection.

Everything grinds to a halt accordingly! Probably a good thing as have red eyes and been coding all weekend.

Would appreciate any help.

Link to comment
Share on other sites

That info (ROM file with extension) comes over in the GameRun event as the GameData.Description variable. The bio for the game only comes over in that field if it is during the GameShowInfo event. I do however get it myself first through code using a block that parses through your ROM file locations and runs through all your filters in an array, but that's something I did on my own and doesn't happen natively in GameEx.

So basically if you need it before the GameRun event is triggered, you have to code around that on your own. :)

Link to comment
Share on other sites

Ah! I assumed that this held the game bio. That did the trick thanks adultery.

However, does raise another q. Wheres the game bio as I was assuming description held this... do you have to grab that from somewhere else? Doh scrap that. Just reread your post and see have to grab that at the show info event?

Link to comment
Share on other sites

Yup. :)

It should be noted though that if a user doesn't use that screen (bypasses the game info screen) that event isn't parsed which is why I coded around it by accessing the database if no info is found. Just FYI.

Link to comment
Share on other sites

The mysteries of the GameEx black box... :)

So - is the Game_Info structure the same in Event_CommandLine and Event_GameRun (as it is different in GameShowInfo).

I need to be calling routines with game specific info. Was calling from GameRun before, but can't find a life of me find a way to put a form over fullscreen GameEx. I'm hoping can make same call from CommandLine and that GE minimises at this point.

I'm assuming .bringtofront and .topmost=true aren't working because gameex is DX or something?

EDIT: Bah! made no difference, apart from the fullscreen GameEx screen just going black. I'm just needing a tiny little form popping up over the GE window prior to game launch telling used files unzipping etc.. any ideas?

Link to comment
Share on other sites

You can't do that without d3d. GameEx isn't a form. You basically need to inject your rendering into the d3d buffer. It's not easy, and to be honest I gave up on the instant messaging plugin I did because of it even though it's fully functional aside from that detail.

It's definitely possible (Steam does it for PC games), it's just way too advanced for me to learn quickly. Sorry, but that's all I can tell ya on that.

Link to comment
Share on other sites

I've never tried on GameEx specifically but have done it for GameExtender, but yeah, you can probably grab the app handle and force it to minimize. I do something similar to force GameEx back into focus after Xpadder launches and steals focus from GameEx. Kinda. It's a little more complicated than that though. :)

Google Windows API: ShowWindow to get started. I may be able to provide a code snippet after work.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...