Skip to content

Commit fa631ca

Browse files
committed
switch to dejavusans font, allows cyrillic
1 parent c5211f6 commit fa631ca

File tree

7 files changed

+25
-25
lines changed

7 files changed

+25
-25
lines changed

omnitool.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! python3.4-32
2-
import globals
2+
import shared
33
__author__ = "Fabian Dill"
44
__credits__ = ["Ijwu", "7UR7L3", "Fabian Dill"]
55
__maintainer__ = "Fabian Dill"
@@ -20,27 +20,27 @@
2020
os.environ["PYGAME_FREETYPE"] = "1"
2121

2222

23-
for p in (globals.appdata, ):
23+
for p in (shared.appdata, ):
2424
if not os.path.isdir(p):
2525
os.mkdir(p)
2626

2727
import zlib
2828
import pickle
2929

3030
try:
31-
with open(globals.cachepath, "rb") as f:
31+
with open(shared.cachepath, "rb") as f:
3232
cache = pickle.loads(zlib.decompress(f.read()))
3333
except IOError as e:
3434
print("Unable to load cache (" + e.__class__.__name__ + "), creating new cache")
3535

3636
cache = {"worlds": {}, "backup": {}}
37-
with open(globals.cachepath, "wb") as f:
37+
with open(shared.cachepath, "wb") as f:
3838
f.write(zlib.compress(pickle.dumps(cache, 2), 9))
3939
except Exception as e:
4040
print("Unable to load cache (" + e.__class__.__name__ + "), creating new cache")
4141

4242
cache = {"worlds": {}, "backup": {}}
43-
with open(globals.cachepath, "wb") as f:
43+
with open(shared.cachepath, "wb") as f:
4444
f.write(zlib.compress(pickle.dumps(cache, 2), 9))
4545

4646
if "reset" in sys.argv:
@@ -64,11 +64,11 @@
6464
if "lang" not in cache:
6565
cache["lang"] = "english"
6666
if "version" not in cache:
67-
cache["version"] = globals.__version__
67+
cache["version"] = shared.__version__
6868
cache["worlds"] = {}
69-
elif cache["version"] < globals.__version__:
69+
elif cache["version"] < shared.__version__:
7070
print("Newer Omnitool version, resetting world image cache.")
71-
cache["version"] = globals.__version__
71+
cache["version"] = shared.__version__
7272
cache["worlds"] = {}
7373
if os.path.isfile("custom.py"):
7474
sys.path.append(".")
@@ -81,8 +81,8 @@
8181
if False:
8282
import Language.english as lang #IDE hook
8383

84-
globals.lang = lang
85-
globals.cache = cache
84+
shared.lang = lang
85+
shared.cache = cache
8686

8787

8888
if __name__ == "__main__":
@@ -107,7 +107,7 @@
107107
import threading
108108
import time
109109
import pgu_override
110-
globals.theme = pgu_override.MyTheme(themename)
110+
shared.theme = pgu_override.MyTheme(themename)
111111
import subprocess
112112
import shutil
113113
import sys
@@ -139,7 +139,7 @@
139139
def save_cache():
140140
cache_lock.acquire()
141141
d = zlib.compress(pickle.dumps(cache), 9)
142-
with open(globals.cachepath, "wb") as f:
142+
with open(shared.cachepath, "wb") as f:
143143
f.write(d)
144144
cache_lock.release()
145145

@@ -207,7 +207,7 @@ def exit_prog(p):
207207
import sys
208208
sys.exit()
209209

210-
globals.exit_prog = exit_prog
210+
shared.exit_prog = exit_prog
211211

212212

213213
def nothing(p):
@@ -713,8 +713,8 @@ def run(self):
713713

714714

715715
class Updater(threading.Thread):
716-
ziploc = os.path.join(globals.appdata, "tImages.zip")
717-
verloc = os.path.join(globals.appdata, "tImages.json")
716+
ziploc = os.path.join(shared.appdata, "tImages.zip")
717+
verloc = os.path.join(shared.appdata, "tImages.json")
718718
def __init__(self, update):
719719
threading.Thread.__init__(self)
720720
self.name = "Updater"
@@ -726,7 +726,7 @@ def run(self):
726726
f = urllib.request.urlopen("http://dl.dropbox.com/u/44766482/ot_updater/ot_version.json").read()
727727
js = json.loads(f.decode())
728728
verint = js["omnitool"]
729-
if verint > globals.__version__:
729+
if verint > shared.__version__:
730730
from version import Version
731731
text = gui.Label("Version " + Version(verint).__repr__() + lang.available, color=(255, 0, 0))
732732
self.update.td(text, align=-1)
@@ -841,7 +841,7 @@ def run():
841841
"appAuthor": __author__+" (Berserker66)",
842842
"appName": "Omnitool",
843843
"appPath": os.path.abspath(sys.argv[0]),
844-
"appVersion": globals.__version__.__repr__()
844+
"appVersion": shared.__version__.__repr__()
845845
}
846846
with loc.open("wt") as f:
847847
f.write(json.dumps(data, indent=4))
@@ -859,10 +859,10 @@ def run():
859859

860860
use_override = True
861861
if use_override:
862-
app = pgu_override.MyApp(theme=globals.theme)
862+
app = pgu_override.MyApp(theme=shared.theme)
863863
else:
864864
import pgu
865-
app = pgu.gui.App(theme=globals.theme)
865+
app = pgu.gui.App(theme=shared.theme)
866866
worlds = []
867867
ts = [threading.Thread(target=get_world, args=(world, worlds)) for world in worldnames]
868868
tuple(t.start() for t in ts)
@@ -994,7 +994,7 @@ def display_worlds(optionchange = False):
994994
print("GUI Matrix created, initializing..")
995995
pygame.display.quit()
996996
pygame.display.init()
997-
pygame.display.set_caption("Terraria Omnitool V%s | %d Bit" % (globals.__version__.__repr__(), bit))
997+
pygame.display.set_caption("Terraria Omnitool V%s | %d Bit" % (shared.__version__.__repr__(), bit))
998998

999999
def make_resize(worlds, app, main):
10001000
def resize(self, ev):

plugins/arena.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(self):
3232

3333
def run(self):
3434

35-
from globals import lang, theme, exit_prog, exit_prog, __version__
35+
from shared import lang, theme, exit_prog, exit_prog, __version__
3636
from pgu_override import Quitbutton
3737

3838
torch_chances = [lang.at_full, lang.at_blue, lang.at_red, lang.at_green,

plugins/flatworld.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def run(self): #executed after gui
4646

4747
def gen_gui(self):
4848
#get theme, language and end process function from omnitool API
49-
from globals import lang, theme, exit_prog, exit_prog
49+
from shared import lang, theme, exit_prog, exit_prog
5050
from pgu_override import Quitbutton
5151

5252
#initilize pygame renderer

plugins/planetoids_lib/terragui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
def run(main=None):
7-
from globals import lang, theme, exit_prog, exit_prog, __version__
7+
from shared import lang, theme, exit_prog, exit_prog, __version__
88
from pgu_override import Quitbutton
99

1010

plugins/worldify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(self):
2727

2828

2929
def run(self):
30-
from globals import lang, theme, exit_prog, exit_prog, __version__
30+
from shared import lang, theme, exit_prog, exit_prog, __version__
3131
from pgu_override import Quitbutton
3232
#pygame.quit()
3333
if hasattr(sys, "frozen"):

render.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# from blendmapper import *
1212

1313
def load(tiles=None, walls=None, colors=None, wallcolors=None):
14-
from globals import appdata
14+
from shared import appdata
1515
shared = os.path.join(appdata, "tImages.zip")
1616
ziploc = None
1717
if os.path.exists("tImages.zip"):
File renamed without changes.

0 commit comments

Comments
 (0)