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

Adultery

GameEx Author
  • Posts

    10152
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Adultery

  1. GoG has been good to me this week! Thanks Drac!!
  2. So you're using gamelist.txt for this... Wouldn't it be smarter to export the MAME.XML into a text file then do a stream read of it and convert it into an XML from there? If you're making it for PinballX, it's more likely this would be more useful with the MAME.EXE since many users won't use GameEx. Unless you plan on exporting a raw gamelist.txt with no filters (GameEx won't allow you to include mchanical anyhow) and supply it every time a MAME revision comes out... In this example snippet I write the XML to a file, Then I use that to look for rom name patterns and send the results out as a DataTable. I pulled this out of MAME Commander, so it does all types of search criteria (# of coins, # of buttons, # of players, Horiz or Vert, by Release Year, etc). It's all right there in the MAME.XML. And if you stream it through, you don't even have to load the whole file into memory. You can look for your criteria and build the XML as you go,and I modified my code to do that instead of adding the DataRow. Don't be confused by that part, I had a helper block that formats the columns and whatnot before filling the table with data and I took the references out. So really, this could be a sub the way it's used here. Here's a really rough example. But it probably would need some tweaking to work... I don't have the MAME.XML structure in front of me. First, let's save the MAME.XML as a file. Be patient, it takes a little bit. I use a "Please Wait" animation while this happens on MC. Public Sub Create_MAME_XML(ByVal xmlpath As String, Optional ByVal rom As String = Nothing) Dim p As New Process() Dim pi As New ProcessStartInfo() Try pi.FileName = Global.DracLabs.Settings.MAME_Path pi.WorkingDirectory = Path.GetDirectoryName(Global.MameCommander.Settings.MAME_Path) If rom IsNot Nothing Then pi.Arguments = "-listxml " & rom Else pi.Arguments = "-listxml" pi.RedirectStandardOutput = True pi.CreateNoWindow = True pi.UseShellExecute = False p.StartInfo = pi p.Start() Using sw As StreamWriter = File.CreateText(xmlpath) sw.Write(p.StandardOutput.ReadToEnd) End Using p.WaitForExit() p.Close() Catch ex As Exception log.Log_Error("Could not create XML!", "Create XML", ex.Message, ex.StackTrace) End Try End Sub Next, we do the search based on what might be in the rom name. For example, 1942 would return 1944w; 1944j; 1944; etc. Private Function Search_Rom_Name(ByVal Rom_Name As String) As DataTable Dim dt As DataTable = New DataTable("RomContains") Using xml_reader As XmlTextReader = New XmlTextReader(MAME_XML) While xml_reader.Read() If xml_reader.Name = "game" OrElse xml_reader.Name = "machine" Then Dim xml_doc As New XmlDocument() xml_doc.LoadXml(xml_reader.ReadOuterXml) Dim root As XmlElement = xml_doc.DocumentElement Dim rom As String = root.GetAttribute("name") If rom.Contains(Rom_Name.ToLower) Then 'Here you can pull up your working XML and add what you need into a node using a format you can read it in. 'This is where I was adding results into the DataTable before. Build_PinballX_XML(xml_doc) End If End If End While End Using Return dt End Function Finally, we take the search results and convert it into XML that PinballX understands: Private Sub Add_To_PBX_XML(ByVal mame_xml As XmlDocument) Dim pbx_xml As New System.Xml.XmlDocument() pbx_xml.Load(Global.PinballX.Xml.Path) Dim pbx_root As System.Xml.XmlElement = pbx_xml.DocumentElement Dim mame_root As System.Xml.XmlElement = mame_xml.DocumentElement Dim e As XmlElement = pbx_xml.CreateElement("game[@'" & root.Attributes("rom").Value & "']") root.AppendChild(e) For Each n As System.Xml.XmlNode In mame_root.ChildNodes Select Case n.Name.ToLower Case "description" Dim gn As XmlElement = pbx_xml.CreateElement("description") gn.InnerText = n.InnerText e.AppendChild(gn) Case "year" Dim gn As XmlElement = pbx_xml.CreateElement("year") gn.InnerText = n.InnerText e.AppendChild(gn) Case "manufacturer" Dim gn As XmlElement = pbx_xml.CreateElement("manufacturer") gn.InnerText = n.InnerText e.AppendChild(gn) End Select Next n pbx_xml.Save(Global.PinballX.Xml.Path) End Sub I would totes help but, ya know, life and whatnot. :shrug:
  3. We have this problem with Moodle occasionally. It's a page script thing with Chrome and near impossible to track down/fix client side since its sporadic. It's really annoying during a client demo.
  4. Get it while ya can! http://www.kotaku.com/saints-row-2-is-free-on-pc-right-now-1794491146
  5. That's one alright. It should support & quot ; though, I'm surprised it's not properly escaping that.
  6. Yeah, if you try and do a replace, you'll take out something important. If you know RegEx, you can specify patterns and only search node strings. Gonna be tricky though.
  7. Lol! Ain't the key players in that band dead??
  8. I can confirm that I had to do this at one point, I just forgot until you mentioned it just now.
  9. @stigz: Sounds like you have a focus issue. I get around this in my plugins by grabbing the window handle and bringing it to the top and then setting the focus back on the primary game play monitor. I do the opposite for Xpadder, forcing the window to minimize and setting the focus back on GameEx. Hopefully that helps some!
  10. I ran into the same issue pulling the GUID for 360 pads. They're all the same. You'll need to use the index, which I believe is the Device ID under Control Panel > Controllers. I'd have to look at my code but I'm pretty sure that's how I wrote my Xpadder hook that identifies specific controllers. I have a small app that displays all your controller info if you click a button, not sure if I still have it laying around.
  11. Ohh, d'oh!! Didn't look far enough up!
  12. Never heard of it, but a quick Google search pulls this result first: https://github.com/AntiMicro/antimicro/wiki/Command-line-flags
  13. Isn't that the file that taps onto the Windows codes? Do you all have LAV codec installed? Are there any Windows updates waiting? I think this is a Windows update issue and not GameEx per se. Update: You may have to Wait for MS to fix it, and rumor is the fix is already in the insider betas (I just googled the DLL and saw its also affecting HD Homerun).
  14. Depends on the "assets" in the "repo"!
  15. No offense taken if it was intended. I'm pretty good about bug fixing if I can reproduce it, and FWIW I use Xpadder and Windows 10 with no issues currently.
  16. All of it please. And your logs. As we ask repeatedly and as is documented clearly in several places, gameex.ini not screenshots or snippets.
  17. Post your configuration for starters.
  18. I think once we get some of these video theme people looking to use it, the themeing will get much better. We just need those people to take notice. Your suggestions are legit@RedDog !
  19. I think GameEx AE should be first. It's gonna help sell your product. It really looks great on a cab, it's more of what I suspect the future of FE's is gonna be, so long as it doesn't get over-developed with features. /my 2c
  20. Same, it seems we're all slowly drifting away. Here's hoping he comes back safely. Happy birthday mi amigo!
  21. Well they say that, but in my account it says unlimited. Amazon has unlimited for $59 a year also, but I didn't jump on it because Plex can't access it.
  22. I was promoted in December and am the director for my department now at the tech company I work for, so long 60 hour weeks abound. We're moving all our clients over to AWS and setting up Ansible, plus 3 implementations a quarter... Just busy as hell. Add the new baby, there's just no time for fun right now, let alone coding (which I do all week btw). But I still lurk, believe me!
  23. I have NextCloud on my server, so I don't need it for my own stuff. Bought the G Suite for Plex because I can't afford another 3 TB for the server. But I hear ya. @Draco1962 : Yeah, understandable, but I keep my code local and just put the finished product in the repo. I'm a non-sharing bastard with my source code.
  24. Google G Suite... unlimited cloud storage for $10/mo, and they won't change your links on you. Success!
×
×
  • Create New...