diff --git a/CMakeLists.txt b/CMakeLists.txt index ad30d73..76922aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,16 +113,6 @@ if(ENABLE_TESTS) endif() # Build assets -# add_custom_target(DUSK_ASSETS_BUILT ALL -# COMMAND -# ${Python3_EXECUTABLE} ${DUSK_TOOLS_DIR}/assettool.py -# --assets ${DUSK_GAME_ASSETS_DIR} -# --output-assets ${DUSK_BUILT_ASSETS_DIR} -# --output-file ${DUSK_BUILD_DIR}/dusk.dsk -# --headers-dir ${DUSK_GENERATED_HEADERS_DIR} -# --input ${DUSK_ASSETS} -# ) -# add_dependencies(${DUSK_LIBRARY_TARGET_NAME} DUSK_ASSETS_BUILT) dusk_run_python( DUSK_ASSETS_BUILT tools.asset.bundle diff --git a/tools/assetstool/args.py b/tools/asset/args.py similarity index 100% rename from tools/assetstool/args.py rename to tools/asset/args.py diff --git a/tools/asset/bundle/__main__.py b/tools/asset/bundle/__main__.py index acf5526..ebfdc72 100644 --- a/tools/asset/bundle/__main__.py +++ b/tools/asset/bundle/__main__.py @@ -1,10 +1,10 @@ import sys, os -from tools.assetstool.args import args -from tools.assetstool.processasset import processAsset -from tools.assetstool.processpalette import processPaletteList -from tools.assetstool.processtileset import processTilesetList -from tools.assetstool.processlanguage import processLanguageList -from tools.assetstool.assethelpers import getBuiltAssetsRelativePath +from tools.asset.args import args +from tools.asset.process.asset import processAsset +from tools.asset.process.palette import processPaletteList +from tools.asset.process.tileset import processTilesetList +from tools.asset.process.language import processLanguageList +from tools.asset.path import getBuiltAssetsRelativePath import zipfile # Parse input file args. diff --git a/tools/assetstool/assetcache.py b/tools/asset/cache.py similarity index 100% rename from tools/assetstool/assetcache.py rename to tools/asset/cache.py diff --git a/tools/assetstool/assethelpers.py b/tools/asset/path.py similarity index 89% rename from tools/assetstool/assethelpers.py rename to tools/asset/path.py index d3682f8..d15b8bf 100644 --- a/tools/assetstool/assethelpers.py +++ b/tools/asset/path.py @@ -1,5 +1,5 @@ import os -from tools.assetstool.args import args +from tools.asset.args import args def getAssetRelativePath(fullPath): # Get the relative path to the asset diff --git a/tools/assetstool/processasset.py b/tools/asset/process/asset.py similarity index 66% rename from tools/assetstool/processasset.py rename to tools/asset/process/asset.py index 8e0f516..fcce302 100644 --- a/tools/assetstool/processasset.py +++ b/tools/asset/process/asset.py @@ -1,11 +1,11 @@ import sys # from processtileset import processTileset -from tools.assetstool.processimage import processImage -from tools.assetstool.processpalette import processPalette -from tools.assetstool.processtileset import processTileset -from tools.assetstool.processmap import processMap -from tools.assetstool.processlanguage import processLanguage -from tools.assetstool.processscript import processScript +from tools.asset.process.image import processImage +from tools.asset.process.palette import processPalette +from tools.asset.process.tileset import processTileset +from tools.asset.process.map import processMap +from tools.asset.process.language import processLanguage +from tools.asset.process.script import processScript processedAssets = [] diff --git a/tools/assetstool/processimage.py b/tools/asset/process/image.py similarity index 94% rename from tools/assetstool/processimage.py rename to tools/asset/process/image.py index 4b8701b..d2b202b 100644 --- a/tools/assetstool/processimage.py +++ b/tools/asset/process/image.py @@ -1,10 +1,10 @@ import os import sys from PIL import Image -from tools.assetstool.processpalette import extractPaletteFromImage, palettes -from tools.assetstool.args import args -from tools.assetstool.assethelpers import getAssetRelativePath -from tools.assetstool.assetcache import assetGetCache, assetCache +from tools.asset.process.palette import extractPaletteFromImage, palettes +from tools.asset.args import args +from tools.asset.path import getAssetRelativePath +from tools.asset.cache import assetGetCache, assetCache images = [] diff --git a/tools/assetstool/processlanguage.py b/tools/asset/process/language.py similarity index 97% rename from tools/assetstool/processlanguage.py rename to tools/asset/process/language.py index 8bb09a7..6c18cae 100644 --- a/tools/assetstool/processlanguage.py +++ b/tools/asset/process/language.py @@ -1,8 +1,8 @@ import sys import os -from tools.assetstool.args import args -from tools.assetstool.assetcache import assetCache, assetGetCache -from tools.assetstool.assethelpers import getAssetRelativePath +from tools.asset.args import args +from tools.asset.cache import assetCache, assetGetCache +from tools.asset.path import getAssetRelativePath from tools.dusk.defs import defs import polib import re diff --git a/tools/assetstool/processmap.py b/tools/asset/process/map.py similarity index 96% rename from tools/assetstool/processmap.py rename to tools/asset/process/map.py index 42cb8e3..35cc438 100644 --- a/tools/assetstool/processmap.py +++ b/tools/asset/process/map.py @@ -2,9 +2,9 @@ import struct import sys import os import json -from tools.assetstool.args import args -from tools.assetstool.assetcache import assetCache, assetGetCache -from tools.assetstool.assethelpers import getAssetRelativePath +from tools.asset.args import args +from tools.asset.cache import assetCache, assetGetCache +from tools.asset.path import getAssetRelativePath from tools.dusk.defs import TILE_WIDTH, TILE_HEIGHT, TILE_DEPTH, CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH, CHUNK_TILE_COUNT from tools.dusk.map import Map from tools.dusk.chunk import Chunk diff --git a/tools/assetstool/processpalette.py b/tools/asset/process/palette.py similarity index 96% rename from tools/assetstool/processpalette.py rename to tools/asset/process/palette.py index aa45408..3a1012b 100644 --- a/tools/assetstool/processpalette.py +++ b/tools/asset/process/palette.py @@ -1,8 +1,8 @@ import os from PIL import Image import datetime -from tools.assetstool.args import args -from tools.assetstool.assetcache import assetCache, assetGetCache +from tools.asset.args import args +from tools.asset.cache import assetCache, assetGetCache palettes = [] diff --git a/tools/assetstool/processscript.py b/tools/asset/process/script.py similarity index 87% rename from tools/assetstool/processscript.py rename to tools/asset/process/script.py index 394aacb..b770ea9 100644 --- a/tools/assetstool/processscript.py +++ b/tools/asset/process/script.py @@ -1,8 +1,8 @@ import sys import os -from tools.assetstool.args import args -from tools.assetstool.assetcache import assetCache, assetGetCache -from tools.assetstool.assethelpers import getAssetRelativePath +from tools.asset.args import args +from tools.asset.cache import assetCache, assetGetCache +from tools.asset.path import getAssetRelativePath from tools.dusk.defs import fileDefs def processScript(asset): diff --git a/tools/assetstool/processtileset.py b/tools/asset/process/tileset.py similarity index 96% rename from tools/assetstool/processtileset.py rename to tools/asset/process/tileset.py index fcaa2ee..27e9c1d 100644 --- a/tools/assetstool/processtileset.py +++ b/tools/asset/process/tileset.py @@ -3,10 +3,10 @@ import sys import os import datetime from xml.etree import ElementTree -from tools.assetstool.processimage import processImage -from tools.assetstool.assethelpers import getAssetRelativePath -from tools.assetstool.args import args -from tools.assetstool.assetcache import assetGetCache, assetCache +from tools.asset.process.image import processImage +from tools.asset.path import getAssetRelativePath +from tools.asset.args import args +from tools.asset.cache import assetGetCache, assetCache tilesets = [] diff --git a/tools/dusk/chunk.py b/tools/dusk/chunk.py index 12f98c7..b15b917 100644 --- a/tools/dusk/chunk.py +++ b/tools/dusk/chunk.py @@ -5,7 +5,7 @@ from tools.dusk.defs import CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH, CHUNK_VERTEX from tools.dusk.tile import Tile from tools.dusk.entity import Entity from tools.dusk.region import Region -from tools.editortool.map.vertexbuffer import VertexBuffer +from tools.editor.map.vertexbuffer import VertexBuffer from OpenGL.GL import * class Chunk: diff --git a/tools/dusk/entity.py b/tools/dusk/entity.py index 08b2568..221b28f 100644 --- a/tools/dusk/entity.py +++ b/tools/dusk/entity.py @@ -1,5 +1,5 @@ from tools.dusk.defs import ENTITY_TYPE_NULL, ENTITY_TYPE_NPC, CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH, TILE_WIDTH, TILE_HEIGHT, TILE_DEPTH -from tools.editortool.map.vertexbuffer import VertexBuffer +from tools.editor.map.vertexbuffer import VertexBuffer class Entity: def __init__(self, chunk, localX=0, localY=0, localZ=0): diff --git a/tools/dusk/region.py b/tools/dusk/region.py index b25c900..4737afc 100644 --- a/tools/dusk/region.py +++ b/tools/dusk/region.py @@ -1,5 +1,5 @@ from tools.dusk.defs import CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH, TILE_WIDTH, TILE_HEIGHT, TILE_DEPTH -from tools.editortool.map.vertexbuffer import VertexBuffer +from tools.editor.map.vertexbuffer import VertexBuffer from OpenGL.GL import * from OpenGL.GLU import * diff --git a/tools/editor.py b/tools/editor/__main__.py similarity index 89% rename from tools/editor.py rename to tools/editor/__main__.py index 7b197f7..9097489 100755 --- a/tools/editor.py +++ b/tools/editor/__main__.py @@ -6,9 +6,9 @@ from PyQt5.QtWidgets import ( ) from OpenGL.GL import * from OpenGL.GLU import * -from tools.editortool.maptool import MapWindow -from tools.editortool.langtool import LangToolWindow -from tools.editortool.cutscenetool import CutsceneToolWindow +from tools.editor.maptool import MapWindow +from tools.editor.langtool import LangToolWindow +from tools.editor.cutscenetool import CutsceneToolWindow DEFAULT_TOOL = None DEFAULT_TOOL = "map" diff --git a/tools/editortool/cutscene/cutsceneitemeditor.py b/tools/editor/cutscene/cutsceneitemeditor.py similarity index 100% rename from tools/editortool/cutscene/cutsceneitemeditor.py rename to tools/editor/cutscene/cutsceneitemeditor.py diff --git a/tools/editortool/cutscene/cutscenemenubar.py b/tools/editor/cutscene/cutscenemenubar.py similarity index 100% rename from tools/editortool/cutscene/cutscenemenubar.py rename to tools/editor/cutscene/cutscenemenubar.py diff --git a/tools/editortool/cutscene/cutscenetext.py b/tools/editor/cutscene/cutscenetext.py similarity index 100% rename from tools/editortool/cutscene/cutscenetext.py rename to tools/editor/cutscene/cutscenetext.py diff --git a/tools/editortool/cutscene/cutscenewait.py b/tools/editor/cutscene/cutscenewait.py similarity index 100% rename from tools/editortool/cutscene/cutscenewait.py rename to tools/editor/cutscene/cutscenewait.py diff --git a/tools/editortool/cutscenetool.py b/tools/editor/cutscenetool.py similarity index 95% rename from tools/editortool/cutscenetool.py rename to tools/editor/cutscenetool.py index e6eb75c..3612a6a 100644 --- a/tools/editortool/cutscenetool.py +++ b/tools/editor/cutscenetool.py @@ -1,7 +1,7 @@ from PyQt5.QtWidgets import QMainWindow, QApplication, QWidget, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QListWidget, QListWidgetItem, QMenuBar, QAction, QFileDialog, QMessageBox from PyQt5.QtGui import QKeySequence -from tools.editortool.cutscene.cutsceneitemeditor import CutsceneItemEditor -from tools.editortool.cutscene.cutscenemenubar import CutsceneMenuBar +from tools.editor.cutscene.cutsceneitemeditor import CutsceneItemEditor +from tools.editor.cutscene.cutscenemenubar import CutsceneMenuBar import sys class CutsceneToolWindow(QMainWindow): diff --git a/tools/editortool/langtool.py b/tools/editor/langtool.py similarity index 100% rename from tools/editortool/langtool.py rename to tools/editor/langtool.py diff --git a/tools/editortool/map/camera.py b/tools/editor/map/camera.py similarity index 100% rename from tools/editortool/map/camera.py rename to tools/editor/map/camera.py diff --git a/tools/editortool/map/chunkpanel.py b/tools/editor/map/chunkpanel.py similarity index 100% rename from tools/editortool/map/chunkpanel.py rename to tools/editor/map/chunkpanel.py diff --git a/tools/editortool/map/entitypanel.py b/tools/editor/map/entitypanel.py similarity index 100% rename from tools/editortool/map/entitypanel.py rename to tools/editor/map/entitypanel.py diff --git a/tools/editortool/map/glwidget.py b/tools/editor/map/glwidget.py similarity index 100% rename from tools/editortool/map/glwidget.py rename to tools/editor/map/glwidget.py diff --git a/tools/editortool/map/grid.py b/tools/editor/map/grid.py similarity index 100% rename from tools/editortool/map/grid.py rename to tools/editor/map/grid.py diff --git a/tools/editortool/map/mapinfopanel.py b/tools/editor/map/mapinfopanel.py similarity index 100% rename from tools/editortool/map/mapinfopanel.py rename to tools/editor/map/mapinfopanel.py diff --git a/tools/editortool/map/mapleftpanel.py b/tools/editor/map/mapleftpanel.py similarity index 91% rename from tools/editortool/map/mapleftpanel.py rename to tools/editor/map/mapleftpanel.py index 949b7d8..b25e5e6 100644 --- a/tools/editortool/map/mapleftpanel.py +++ b/tools/editor/map/mapleftpanel.py @@ -1,7 +1,7 @@ from PyQt5.QtWidgets import QWidget, QVBoxLayout, QGridLayout, QPushButton, QTabWidget, QLabel -from tools.editortool.map.chunkpanel import ChunkPanel -from tools.editortool.map.entitypanel import EntityPanel -from tools.editortool.map.regionpanel import RegionPanel +from tools.editor.map.chunkpanel import ChunkPanel +from tools.editor.map.entitypanel import EntityPanel +from tools.editor.map.regionpanel import RegionPanel class MapLeftPanel(QWidget): def __init__(self, parent): diff --git a/tools/editortool/map/menubar.py b/tools/editor/map/menubar.py similarity index 100% rename from tools/editortool/map/menubar.py rename to tools/editor/map/menubar.py diff --git a/tools/editortool/map/regionpanel.py b/tools/editor/map/regionpanel.py similarity index 100% rename from tools/editortool/map/regionpanel.py rename to tools/editor/map/regionpanel.py diff --git a/tools/editortool/map/selectbox.py b/tools/editor/map/selectbox.py similarity index 100% rename from tools/editortool/map/selectbox.py rename to tools/editor/map/selectbox.py diff --git a/tools/editortool/map/statusbar.py b/tools/editor/map/statusbar.py similarity index 100% rename from tools/editortool/map/statusbar.py rename to tools/editor/map/statusbar.py diff --git a/tools/editortool/map/vertexbuffer.py b/tools/editor/map/vertexbuffer.py similarity index 100% rename from tools/editortool/map/vertexbuffer.py rename to tools/editor/map/vertexbuffer.py diff --git a/tools/editortool/maptool.py b/tools/editor/maptool.py similarity index 90% rename from tools/editortool/maptool.py rename to tools/editor/maptool.py index b561da7..4b9a1fe 100644 --- a/tools/editortool/maptool.py +++ b/tools/editor/maptool.py @@ -1,16 +1,16 @@ import os from PyQt5.QtWidgets import QMainWindow, QWidget, QHBoxLayout, QMessageBox from PyQt5.QtCore import Qt -from tools.editortool.map.glwidget import GLWidget -from tools.editortool.map.mapleftpanel import MapLeftPanel -from tools.editortool.map.mapinfopanel import MapInfoPanel -from tools.editortool.map.menubar import MapMenubar -from tools.editortool.map.statusbar import StatusBar +from tools.editor.map.glwidget import GLWidget +from tools.editor.map.mapleftpanel import MapLeftPanel +from tools.editor.map.mapinfopanel import MapInfoPanel +from tools.editor.map.menubar import MapMenubar +from tools.editor.map.statusbar import StatusBar from tools.dusk.map import Map from tools.dusk.defs import CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH, TILE_SHAPE_NULL, TILE_SHAPE_FLOOR -from tools.editortool.map.selectbox import SelectBox -from tools.editortool.map.camera import Camera -from tools.editortool.map.grid import Grid +from tools.editor.map.selectbox import SelectBox +from tools.editor.map.camera import Camera +from tools.editor.map.grid import Grid class MapWindow(QMainWindow): def __init__(self):