Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.DS_Store
.qt_for_python
__pycache__
venv
build
dist
.venv
.vscode
/.python-version
3 changes: 3 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
.\.venv\Scripts\python.exe -m nuitka --standalone --output-dir=../output --main=./main.py --output-filename="CustomKnight Creator" --windows-icon-from-ico=./resources/SheoIcon.ico --include-data-dir=./resources=resources --enable-plugin=pyside6 --windows-console-mode=disable
pause
4 changes: 2 additions & 2 deletions duplicatewizard_ui.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'duplicatewizard.ui'
#
# Created by: PyQt6 UI code generator 6.2.1
# Created by: PySide6 UI code generator 6.2.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.


from PyQt6 import QtCore, QtGui, QtWidgets
from PySide6 import QtCore, QtGui, QtWidgets


class Ui_Dialog(object):
Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import json

from spritehandler import spriteHandler
from PyQt6 import QtGui, QtCore
from PyQt6.QtWidgets import *
from PySide6 import QtGui, QtCore
from PySide6.QtWidgets import *
from pathlib import Path
from os import path, makedirs
from PIL import Image
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[project]
name = "customknight-creator"
version = "1.0.0"
description = "I Fixed it"
readme = "README.md"
requires-python = "==3.12.*"
dependencies = ["Pillow>=9.1.1","PySide6","nuitka","zstandard"]
37 changes: 10 additions & 27 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Inspired by [SpritePacker](https://github.com/magegihk/HollowKnight.SpritePacker

## Installing

* Go to the [releases](https://github.com/cmot17/CustomKnight-Creator/releases) to find the latest version.
* Go to the [releases](https://github.com/littlepiggeon/CustomKnight-Creator/releases) to find the latest version.

## Usage

Expand All @@ -18,46 +18,29 @@ Visit the [wiki](https://github.com/cmot17/CustomKnight-Creator/wiki) for a writ

## Running from source

* This project is built using Python 3.10.
* To run the project, just download the source code, install the dependencies (preferably in a [virtual environment](https://docs.python.org/3/tutorial/venv.html)) and run main.py.
* PyQt6: `python -m pip install PyQt6`
* Pillow: `pythom -m pip install Pillow`
* This project is built using Python 3.12.
* To run the project, just download the source code, install the dependencies [UV](https://docs.astral.sh/uv) and run main.py.
* `uv sync`

## Packaging

To package the project, use the following [PyInstaller](https://github.com/pyinstaller/pyinstaller) commands: (they are platform specific)
To package the project, use the following [nuitka](http://nuitka.net/) commands: (they are platform specific)

### MacOS:
```
pyinstaller main.py -F -w -n "CustomKnight Creator" -i resources/SheoIcon.icns --add-data resources:resources
```
### Windows:
```
pyinstaller main.py -F -w -n "CustomKnight Creator" -i resources/SheoIcon.ico --add-data "resources;resources"
```
### Linux:
```
pyinstaller main.py -F -n "CustomKnight Creator" --add-data "resources:resources"
.\.venv\Scripts\python.exe -m nuitka --standalone --output-dir=../output --main=./main.py --output-filename="CustomKnight Creator" --windows-icon-from-ico=./resources/SheoIcon.ico --include-data-dir=./resources=resources --enable-plugin=pyside6 --windows-console-mode=disable
```

## Help

If you have any problems, feel free to open an issue on this GitHub.

## Authors
cmot17

## Version History

* 1.0
* Initial Release
littlepiggeon(cmot17)

## License

This project is licensed under the GNU GPLv3 License - see the LICENSE.md file for details

## Acknowledgments
This project is licensed under the GNU GPLv3 License - see the LICENSE.md file for details

* Huge thanks to Maverick#2345 for being incredibly helpful throughout the developement, writing much of the tutorial, and providing lots of useful testing + feedback.
* anjaperryyeet#9759 for feedback on the UI
* MageGi for [SpritePacker](https://github.com/magegihk/HollowKnight.SpritePacker), the inspiration for this program
## At Last...
**THANKS TO cmot17!!!**
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

12 changes: 9 additions & 3 deletions spritehandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from PIL import Image
import os
import os.path
from PyQt6.QtWidgets import *
from PySide6.QtWidgets import *
import copy


Expand Down Expand Up @@ -142,8 +142,14 @@ def packSprites(outputDir):
# print(maxH)
# print(maxW)
# print(maxH)
maxW = 2 ** math.ceil(math.log2(maxW - 1))
maxH = 2 ** math.ceil(math.log2(maxH - 1))
if maxW <= 1:
maxW = 1
else:
maxW = 2 ** math.ceil(math.log2(maxW - 1))
if maxH <= 1:
maxH = 1
else:
maxH = 2 ** math.ceil(math.log2(maxH - 1))
# print(maxW)
# print(maxH)

Expand Down
4 changes: 2 additions & 2 deletions spritepacker_ui.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'spritepacker.ui'
#
# Created by: PyQt6 UI code generator 6.2.1
# Created by: PySide6 UI code generator 6.2.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.


from PyQt6 import QtCore, QtGui, QtWidgets
from PySide6 import QtCore, QtGui, QtWidgets


class Ui_MainWindow(object):
Expand Down