From 1d063028cfa89038d3f398835f6155931ae247f0 Mon Sep 17 00:00:00 2001 From: punkrockguy318 Date: Sun, 3 Aug 2008 00:40:46 +0000 Subject: [PATCH] Added support for lua scripts and movie playback from the linux GUI --- ChangeLog | 3 + INSTALL | 4 +- gfceu | 108 +++++++++++++++++-- gfceu.glade | 298 ++++++++++++++++++++++++++++++++++------------------ gfceu.xml | 292 ++++++++++++++++++++++++++++++++------------------ setup.py | 2 +- 6 files changed, 492 insertions(+), 215 deletions(-) diff --git a/ChangeLog b/ChangeLog index de742509..30ce55f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +================== version 2.0.0 ================================ +* Supports movie playback +* Support lua script loading * Supports autoscale * No longer requires GnomeVFS * Major code cleanup diff --git a/INSTALL b/INSTALL index 86a50427..5fbbcb52 100644 --- a/INSTALL +++ b/INSTALL @@ -7,5 +7,7 @@ You can change the prefix to whatever you like. Requirements: Python (tested with 2.5); (Ubuntu package name: python) PyGTK, and GTK; (Ubuntu package name: (python-gtk2 libgtk2.0-0) -FCE UltraX - You're going to need the latest fceux for gfceu .7 to work +FceuX 2.0 + +NOTE: fceu 1.x is no longer supported in the gfceu 2.x series. if you still want/need a front-end for gfceu use gfceu .7 diff --git a/gfceu b/gfceu index accaaf03..11d6b49d 100644 --- a/gfceu +++ b/gfceu @@ -1,7 +1,7 @@ #!/usr/bin/python # gfceu - Graphical launcher for FCE Ultra. # Designed on Ubuntu, with platfrom independence in mind. -version = "0.7svn" +version = "2.0.0" title = "gfceu" # Copyright (C) 2006 Lukas Sabota ## @@ -56,11 +56,17 @@ class GameOptions: xscale_spin = 2 yscale_spin = 2 bpp_combo = 32 - extra_entry = '' - romfile = '' + opengl_check = False autoscale_check = True + # main + extra_entry = '' + romfile = '' + moviefile = '' + luafile = '' + + # network join_radio = False join_add = '' @@ -98,6 +104,8 @@ def give_widgets(): global options, widgets try: widgets.get_object("rom_entry").set_text(options.romfile) + widgets.get_object("movie_entry").set_text(options.moviefile) + widgets.get_object("lua_entry").set_text(options.luafile) # sound widgets.get_object("sound_check").set_active(options.sound_check) @@ -139,6 +147,8 @@ def set_options(): and stores it in the options object. """ options.romfile = widgets.get_object("rom_entry").get_text() + options.moviefile = widgets.get_object("movie_entry").get_text() + options.luafile = widgets.get_object("lua_entry").get_text() # sound options.sound_check = widgets.get_object("sound_check").get_active() @@ -321,7 +331,14 @@ class GfceuApp: video_options += ' --xscale ' + str(options.xscale_spin) video_options += ' --yscale ' + str(options.yscale_spin) video_options += ' ' - + + # lua/movie + other_options = '' + if options.luafile: + other_options += '--loadlua ' + options.luafile + ' ' + if options.moviefile: + other_options += '--playmov ' + options.moviefile + ' ' + # Netplay is fucked right now @@ -352,7 +369,7 @@ class GfceuApp: command = self.fceux_binary + ' ' + sound_options + video_options +\ - network + options.extra_entry + ' '+ rom_name + network + other_options + options.extra_entry + ' '+ rom_name self.msg('Command: ' + command) # more code to disable because netplay is fucked @@ -403,8 +420,80 @@ class GfceuApp: widgets.get_object("about_dialog").set_name('GNOME FCE Ultra '+version) widgets.get_object("about_dialog").run() widgets.get_object("about_dialog").hide() - - def browse_button_clicked(self, menuitem, data=None): + + def lua_browse_button_clicked(self, menuitem, data=None): + global options + set_options() + chooser = gtk.FileChooserDialog("Open...", None, + gtk.FILE_CHOOSER_ACTION_OPEN, + (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, + gtk.STOCK_OPEN, gtk.RESPONSE_OK)) + chooser.set_property("local-only", False) + chooser.set_default_response(gtk.RESPONSE_OK) + + filter=gtk.FileFilter() + filter.set_name("Lua scripts") + filter.add_pattern("*.lua") + chooser.add_filter(filter) + + filter = gtk.FileFilter() + filter.set_name("All files") + filter.add_pattern("*") + chooser.add_filter(filter) + + if options.luafile == '': + folder = os.getenv('HOME') + else: + folder = os.path.split(options.luafile)[0] + + chooser.set_current_folder (folder) + + response = chooser.run() + chooser.hide() + + if response == gtk.RESPONSE_OK: + if chooser.get_filename(): + x = chooser.get_filename() + widgets.get_object("lua_entry").set_text(x) + options.luafile = x + + def movie_browse_button_clicked(self, menuitem, data=None): + global options + set_options() + chooser = gtk.FileChooserDialog("Open...", None, + gtk.FILE_CHOOSER_ACTION_OPEN, + (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, + gtk.STOCK_OPEN, gtk.RESPONSE_OK)) + chooser.set_property("local-only", False) + chooser.set_default_response(gtk.RESPONSE_OK) + + filter=gtk.FileFilter() + filter.set_name("FM2 movies") + filter.add_pattern("*.fm2") + chooser.add_filter(filter) + + filter = gtk.FileFilter() + filter.set_name("All files") + filter.add_pattern("*") + chooser.add_filter(filter) + + if options.moviefile == '': + folder = os.getenv('HOME') + else: + folder = os.path.split(options.moviefile)[0] + + chooser.set_current_folder (folder) + + response = chooser.run() + chooser.hide() + + if response == gtk.RESPONSE_OK: + if chooser.get_filename(): + x = chooser.get_filename() + widgets.get_object("movie_entry").set_text(x) + options.moviefile = x + + def rom_browse_button_clicked(self, menuitem, data=None): global options set_options() chooser = gtk.FileChooserDialog("Open...", None, @@ -427,8 +516,6 @@ class GfceuApp: filter.add_pattern("*") chooser.add_filter(filter) - - if options.romfile == '': folder = os.getenv('HOME') else: @@ -443,6 +530,9 @@ class GfceuApp: if chooser.get_filename(): x = chooser.get_filename() widgets.get_object("rom_entry").set_text(x) + # reset lua and movie entries on rom change + widgets.get_object("movie_entry").set_text("") + widgets.get_object("lua_entry").set_text("") options.romfile = x def gamepad_clicked(self, widget, data=None): diff --git a/gfceu.glade b/gfceu.glade index b1c7ee9c..c7989a55 100644 --- a/gfceu.glade +++ b/gfceu.glade @@ -1,6 +1,6 @@ - + @@ -36,16 +36,27 @@ - + True True True - Right + Up + 0 + + + 1 + 2 + + + + + True + True + True + Left 0 - 2 - 3 1 2 @@ -66,31 +77,20 @@ - + True True True - Left + Right 0 + 2 + 3 1 2 - - - True - True - True - Up - 0 - - - 1 - 2 - - @@ -330,6 +330,98 @@ Artwork for old versions (< 0.2.7): False + + + True + 5 + + + True + 5 + Movie Filename: + + + False + False + + + + + True + True + + + 1 + + + + + True + True + _Browse... + True + 0 + + + + False + False + 2 + + + + + False + False + 1 + + + + + True + 5 + + + True + 5 + Lua Script: + + + False + False + + + + + True + True + + + 1 + + + + + True + True + _Browse... + True + 0 + + + + False + False + 2 + + + + + False + False + 2 + + @@ -387,30 +479,17 @@ Artwork for old versions (< 0.2.7): 5 5 - + True True - Gamepad _1 + Gamepad _3 True 0 - - - - - - True - True - Gamepad _2 - True - 0 - - - - 1 - 2 + 1 + 2 @@ -432,17 +511,30 @@ Artwork for old versions (< 0.2.7): - + True True - Gamepad _3 + Gamepad _2 + True + 0 + + + + 1 + 2 + + + + + + True + True + Gamepad _1 True 0 - 1 - 2 @@ -898,26 +990,15 @@ Invalid options may cause GFCE Ultra to perform incorrectly. 5 5 - + True - 0 - Port: - - - GTK_FILL - - - - - - True - 0 - Password: + True + 1 + 2 1 2 - GTK_FILL @@ -935,15 +1016,26 @@ Invalid options may cause GFCE Ultra to perform incorrectly. - + True - True + 0 + Password: - 1 - 2 1 2 + GTK_FILL + + + + + + True + 0 + Port: + + + GTK_FILL @@ -994,13 +1086,54 @@ Invalid options may cause GFCE Ultra to perform incorrectly. 3 5 - + True True + 4046 1 65536 1 10 10 + 1 1 2 + 1 + 2 + + + + + + True + 0 + Password: + + + 2 + 3 + GTK_FILL + + + + + + True + 0 + Server Port: + + + 1 + 2 + GTK_FILL + + + + + + True + 0 + Server Address: + + + GTK_FILL @@ -1020,54 +1153,13 @@ Invalid options may cause GFCE Ultra to perform incorrectly. - - True - 0 - Server Address: - - - GTK_FILL - - - - - - True - 0 - Server Port: - - - 1 - 2 - GTK_FILL - - - - - - True - 0 - Password: - - - 2 - 3 - GTK_FILL - - - - - + True True - 4046 1 65536 1 10 10 - 1 1 2 - 1 - 2 diff --git a/gfceu.xml b/gfceu.xml index 7e7f22bb..0a849508 100644 --- a/gfceu.xml +++ b/gfceu.xml @@ -1,5 +1,5 @@ - + 10 @@ -67,15 +67,25 @@ - + True True True - Right + Up + + + 1 + 2 + + + + + True + True + True + Left - 2 - 3 1 2 @@ -95,29 +105,19 @@ - + True True True - Left + Right + 2 + 3 1 2 - - - True - True - True - Up - - - 1 - 2 - - @@ -343,6 +343,96 @@ Artwork for old versions (< 0.2.7): False + + + True + 5 + + + True + 5 + Movie Filename: + + + False + False + + + + + True + True + + + 1 + + + + + True + True + _Browse... + True + + + + False + False + 2 + + + + + False + False + 1 + + + + + True + 5 + + + True + 5 + Lua Script: + + + False + False + + + + + True + True + + + 1 + + + + + True + True + _Browse... + True + + + + False + False + 2 + + + + + False + False + 2 + + @@ -399,28 +489,16 @@ Artwork for old versions (< 0.2.7): 5 5 - + True True - Gamepad _1 + Gamepad _3 True - - - - - - True - True - Gamepad _2 - True - - - - 1 - 2 + 1 + 2 @@ -441,16 +519,28 @@ Artwork for old versions (< 0.2.7): - + True True - Gamepad _3 + Gamepad _2 + True + + + + 1 + 2 + + + + + + True + True + Gamepad _1 True - 1 - 2 @@ -886,26 +976,15 @@ Invalid options may cause GFCE Ultra to perform incorrectly. 5 5 - + True - 0 - Port: - - - GTK_FILL - - - - - - True - 0 - Password: + True + 1 + 2 1 2 - GTK_FILL @@ -923,15 +1002,26 @@ Invalid options may cause GFCE Ultra to perform incorrectly. - + True - True + 0 + Password: - 1 - 2 1 2 + GTK_FILL + + + + + + True + 0 + Port: + + + GTK_FILL @@ -981,13 +1071,54 @@ Invalid options may cause GFCE Ultra to perform incorrectly. 3 5 - + True True + adjustment4 + 1 1 2 + 1 + 2 + + + + + + True + 0 + Password: + + + 2 + 3 + GTK_FILL + + + + + + True + 0 + Server Port: + + + 1 + 2 + GTK_FILL + + + + + + True + 0 + Server Address: + + + GTK_FILL @@ -1007,54 +1138,13 @@ Invalid options may cause GFCE Ultra to perform incorrectly. - - True - 0 - Server Address: - - - GTK_FILL - - - - - - True - 0 - Server Port: - - - 1 - 2 - GTK_FILL - - - - - - True - 0 - Password: - - - 2 - 3 - GTK_FILL - - - - - + True True - adjustment4 - 1 1 2 - 1 - 2 diff --git a/setup.py b/setup.py index 19cd503e..2ce7d910 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ #!/usr/bin/env python from distutils.core import setup setup(name="gfceu", - version="0.7svn", + version="2.0.0", scripts = ['gfceu'], data_files=[('share/gfceu/',['gfceu.xml', 'gfceu_big.png', 'gfceu.png']), ('share/pixmaps/', ['gfceu.png']),