summaryrefslogtreecommitdiff
path: root/game/01_init.rpy
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-12-20 22:57:07 -0300
committerJesusaves <cpntb1@ymail.com>2020-12-20 22:57:07 -0300
commitca81edf05e3368d33b8f1d7fe9b75d3488b2778d (patch)
treeedc2267e36f30180812bea933116e4bee97fba5f /game/01_init.rpy
parent6bc9a7fee1ba2c6ff842afb338f8d2ac26ff3c2e (diff)
downloadclient-ca81edf05e3368d33b8f1d7fe9b75d3488b2778d.tar.gz
client-ca81edf05e3368d33b8f1d7fe9b75d3488b2778d.tar.bz2
client-ca81edf05e3368d33b8f1d7fe9b75d3488b2778d.tar.xz
client-ca81edf05e3368d33b8f1d7fe9b75d3488b2778d.zip
Reintroduce support for remotely downloaded audio files...
...By overriding the default music file loader >.>
Diffstat (limited to 'game/01_init.rpy')
-rw-r--r--game/01_init.rpy21
1 files changed, 21 insertions, 0 deletions
diff --git a/game/01_init.rpy b/game/01_init.rpy
index 4903b37..99f8587 100644
--- a/game/01_init.rpy
+++ b/game/01_init.rpy
@@ -21,6 +21,7 @@
init -3 python:
renpy.add_python_directory("python-extra")
import requests, zlib, base64, sys, copy, uuid, time, json, traceback
+ import os.path
from threading import Timer
from ws4py.client.threadedclient import WebSocketClient
@@ -256,6 +257,26 @@ init -3 python:
else:
return renpy.loader.transfn(path)
+
+ # Override music audio loader
+ def SpheresLoadAudioFile(fn):
+ """
+ Returns a file-like object for the given filename.
+ """
+
+ try:
+ fna = get_path_if_exists(fn)
+ if not os.path.isfile(fna):
+ raise Exception("Not a file")
+ rv = renpy.loader.open_file(fna, "rb")
+ except:
+ rv = renpy.loader.load(fn)
+
+ return rv
+
+ renpy.audio.audio.load=SpheresLoadAudioFile
+
+ #############################################################################
# URL3 Function
def GAME_UPDATER():
global tr_uptodate