Skip to content

Commit

Permalink
Small Fixes Roundup
Browse files Browse the repository at this point in the history
-Force-Added colorsys module to frozen exe
-Fixed outdated tedit name
-Added Tool Interlinking Feedback
-Fixed delayed zipbuilder output
  • Loading branch information
Berserker66 committed Apr 29, 2015
1 parent a13e27f commit 50bea8f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 39 deletions.
2 changes: 1 addition & 1 deletion omnisetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
executables=[EXE],
options={"build_exe": {"excludes": ["OpenGL", "tkinter", "tcl"],
"packages": ["multiprocessing"],
"includes" : ("loadbar",)}
"includes" : ("loadbar","colorsys")}
}
)
not_needed = ("pygame.movie.pyd", "pygame.mixer_music.pyd", "pygame.mixer.pyd",
Expand Down
24 changes: 17 additions & 7 deletions omnitool.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3.4-32
from version import Version
__version__ = Version(170300)
__version__ = Version(170400)
__author__ = "Fabian Dill"
__credits__ = ["Ijwu", "7UR7L3", "Fabian Dill"]
__maintainer__ = "Fabian Dill"
Expand Down Expand Up @@ -202,18 +202,28 @@ def save_cache():

cmod = False
if len(sys.argv) > 1: #user wants something
if sys.argv[1].split("\\")[-1] == "TEdit.exe": #install tedit
cache["tedit"] = sys.argv[1]
print("Learned TEdit path: " + sys.argv[1])
def savequit():
import time
time.sleep(3)
save_cache()
pygame.quit()
sys.exit()

if sys.argv[1].split("\\")[-1] == "TEditXna.exe": #install tedit
cache["tedit"] = sys.argv[1]
print("Learned TEdit path: " + sys.argv[1])
savequit()

elif sys.argv[1].split("\\")[-1] == "Terrafirma.exe": #install tedit
cache["terrafirma"] = sys.argv[1]
print("Learned terrafirma path: " + sys.argv[1])
save_cache()
pygame.quit()
sys.exit()
savequit()

if getattr(sys, 'frozen', False):
os.chdir(os.path.dirname(sys.executable))
else:
os.chdir(os.path.dirname(os.path.realpath(__file__)))

myterraria = get_myterraria() #mygames-terraria path
images = os.path.join(myterraria, "WorldImages")
if __name__ == "__main__":
Expand Down
32 changes: 3 additions & 29 deletions plugins/worldify.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
import database as db
import colorlib
from tlib import *
from tinterface import get_next_world
from binarysplit import join
from random import randint
from time import sleep
from os.path import join as osjoin
import tempfile
import colorsys
from pgu_override import MyFileDialog


Expand Down Expand Up @@ -236,9 +233,6 @@ def update(slider, label):
'ID': 1394008880, 'moonphase': 0, 'name': name,
'is_a_shadow_orb_broken': 0, 'time': 13500,
"hardmode": 0, "altars_broken": 0, }
#with open(osjoin(temp, "0.part"), "wb") as f:#write the header
# set_header(f, header)
#print ("done writing header") #sounds cool

import time

Expand Down Expand Up @@ -302,7 +296,7 @@ def rgb(a, surface, rcolors, weight=None):

def hsv(a, surface, rcolors, weight=(2, 3, 1)):
#hue saturation value/brightness
import colorsys


hcolors = {}
for color in rcolors:
Expand Down Expand Up @@ -337,7 +331,7 @@ def hsv(a, surface, rcolors, weight=(2, 3, 1)):

start = time.clock()
self.tiles = tempfile.TemporaryFile()
#with open(osjoin(temp, "1.part") , "wb") as a:#write the tile data

if func == "RGB":
print("Finding closest match via euclidian RGB distance")
rgb(self.tiles, surface, rcolors)
Expand All @@ -348,30 +342,10 @@ def hsv(a, surface, rcolors, weight=(2, 3, 1)):
n = (t, t / (w * h))
print("%5f seconds taken, that is %0.10f seconds per pixel" % n)
self.chests = [None] * 1000
#with open(osjoin(temp, "2.part"), "wb") as a:#write chestdata
# set_chests(a,[None]*1000)
#print ("done writing chests")
#with open(osjoin(temp, "3.part"), "wb") as f:
# for sign in [None]*1000:
# set_sign(f, sign)
self.signs = [None] * 1000
#print ("done writing signs")
#with open(osjoin(temp, "4.part"), "wb") as f:
# set_npc(f, ('Guide', (header["spawn"][0]*16, (header["spawn"][1]-3)*16), 1, (header["spawn"][0], header["spawn"][1]-3)))
# set_npc(f, None)
# set_npc_names(f, db.names)
self.names = db.names
self.npcs = [('Guide', (self.header["spawn"][0] * 16, (self.header["spawn"][1] - 3) * 16), 1,
(self.header["spawn"][0], self.header["spawn"][1] - 3))]
#print ("done writing npcs")
#with open(osjoin(temp, "5.part"), "wb") as f:
# set_trail(f, (1, header["name"], header["ID"]))
#print ("done writing trail")
#name = get_next_world(db.cmod)
#join(name, True, path = temp)#this just puts all the binary parts into one world file
#print ("done joining world "+name)#yay!
#print ("A world has been created!")
#sleep(3)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Omnitool"
#define MyAppVersion "17.3.0"
#define MyAppVersion "17.4.0"
#define MyAppPublisher "Fabian Dill"
#define MyAppURL "http://www.terrariaonline.com/threads/omnitool-world-mapping-backups-creation-and-more-released.61654/"
#define MyAppExeName "omnitool.exe"
Expand Down
2 changes: 1 addition & 1 deletion setup64.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Omnitool"
#define MyAppVersion "17.3.0"
#define MyAppVersion "17.4.0"
#define MyAppPublisher "Fabian Dill"
#define MyAppURL "http://www.terrariaonline.com/threads/omnitool-world-mapping-backups-creation-and-more-released.61654/"
#define MyAppExeName "omnitool.exe"
Expand Down
2 changes: 2 additions & 0 deletions zipbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import os

print("Zipping content files...", end="")
import sys
sys.stdout.flush()

with ZipFile(os.path.join("build", "content.lzma"), "w", ZIP_LZMA) as Z:
for file in os.listdir("tImages"):
Expand Down

0 comments on commit 50bea8f

Please sign in to comment.