Beispiel #1
0
from game import GameEngine
import init
from log import end
from ui.window import ClientWindow

app = wx.App(False)

# Parse command line options
parser = argparse.ArgumentParser()
parser.add_argument("--config-dir",
                    help="An alternative configuration directory",
                    default=".")
args = parser.parse_args()

# Load the user configuration
engine = GameEngine(args.config_dir)
engine.load()

# Select the configured language
lang = engine.settings.get_language()
select(lang)

# Create the client and ClientWindow
window = ClientWindow(engine)
world = window.world
if world is not None:
    reactor.callLater(0, window.panel.CreateClient)
    reactor.registerWxApp(app)
    reactor.run(installSignalHandlers=0)
end()
Beispiel #2
0
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

"""This demo file creates a simple client with TTS support."""

import wx
from ytranslate import init, select

from game import GameEngine
import init
from ui.window import ClientWindow

app = wx.App()
# Load the user configuration
engine = GameEngine()
engine.load()

# Select the configured language
lang = engine.settings.get_language()
select(lang)

# Create the client and ClientWindow
window = ClientWindow(engine)
world = window.world
if world is not None:
    window.panel.CreateClient()
    app.MainLoop()