Skip to content

Commit eafbf54

Browse files
committed
Fix headless, remove temp dir deletion for debugging
1 parent 90c6949 commit eafbf54

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

pymapconv.py

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -607,9 +607,11 @@ def ReadTile(xpos, ypos, sourcebuf): # xpos and ypos aremultiples of 32
607607

608608
print 'Cleaning up temp dir...'
609609
if myargs.linux:
610-
os.system('rm -r ./temp')
610+
#os.system('rm -r ./temp')
611+
pass
611612
else:
612-
os.system('del /Q temp')
613+
#os.system('del /Q temp')
614+
pass
613615
print 'All Done! You may now close the main window to exit the program :)'
614616

615617

@@ -902,7 +904,6 @@ def __init__(self, filename):
902904
parser.add_argument('-d', '--decompile', help='Decompiles a map to everything you need to recompile it', type=str)
903905
parser.description = 'Spring RTS SMF map compiler/decompiler by Beherith ([email protected]). You must select at least a texture and a heightmap for compilation'
904906
parser.epilog = 'Remember, you can also use this from the command line!'
905-
app = QtGui.QApplication(sys.argv)
906907

907908

908909
def okbuttonhandler(self):
@@ -912,26 +913,28 @@ def okbuttonhandler(self):
912913
mymap = SMFMapDecompiler(parsed_args.decompile)
913914
else:
914915
compileSMF(parsed_args)
915-
916916
#print 'sys.argv:',sys.argv
917917
if len(sys.argv) > 1: # if we got command line, then just run without gui
918918
okbuttonhandler(parser)
919919
exit(1)
920-
a = argparseui.ArgparseUi(parser, left_label_alignment=True, use_scrollbars=True, use_save_load_button=True,
921-
ok_button_handler=okbuttonhandler,
922-
window_title="Spring Map Format (SMF) compiler and decompiler")
923-
a.show()
924-
app.exec_()
925-
print ("Ok" if a.result() == 1 else "Cancel")
926-
if a.result() == 1: # Ok pressed
927-
parsed_args = a.parse_args()
928-
print (parsed_args)
929-
if parsed_args.decompile != '' and parsed_args.decompile != None:
930-
mymap = SMFMapDecompiler(parsed_args.decompile)
931-
else:
932-
compileSMF(parsed_args)
933920
else:
934-
parsed_args = None
921+
922+
app = QtGui.QApplication(sys.argv)
923+
a = argparseui.ArgparseUi(parser, left_label_alignment=True, use_scrollbars=True, use_save_load_button=True,
924+
ok_button_handler=okbuttonhandler,
925+
window_title="Spring Map Format (SMF) compiler and decompiler")
926+
a.show()
927+
app.exec_()
928+
print ("Ok" if a.result() == 1 else "Cancel")
929+
if a.result() == 1: # Ok pressed
930+
parsed_args = a.parse_args()
931+
print (parsed_args)
932+
if parsed_args.decompile != '' and parsed_args.decompile != None:
933+
mymap = SMFMapDecompiler(parsed_args.decompile)
934+
else:
935+
compileSMF(parsed_args)
936+
else:
937+
parsed_args = None
935938

936939
'''
937940
-k <feature placement file>, --featureplacement <feature placement

0 commit comments

Comments
 (0)