Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starbound 1.0 Support #288

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
5b0e5ff
Bug fixes
Jan 25, 2016
7caf9fc
Merge remote-tracking branch 'refs/remotes/wizzomafizzo/master'
May 18, 2016
3468047
Support nightly player files
May 18, 2016
5a3aae8
Support new bag in Nightly
May 20, 2016
60410a6
Support reorganized inventory in Cheerful
Jul 4, 2016
6a02da7
Add support for scan mode slot
Jul 4, 2016
ada256f
Merge remote-tracking branch 'refs/remotes/wizzomafizzo/dev'
Jul 5, 2016
745f774
Fix ship edit dialog for Cheerful
Jul 8, 2016
de34bd7
Create SBAsset library
Jul 22, 2016
83ddc26
Basic SBAsset implementation
Jul 25, 2016
ee9fb33
Fix image rendering
Jul 25, 2016
6e5e2f9
Fix broken dialogs
Jul 25, 2016
bf99624
Merge pull request #8 from medeor413/sbasset
Jul 25, 2016
a71a170
Temporary workaround for image loading error
Jul 26, 2016
79cb0f1
Merge pull request #9 from medeor413/sbasset
Jul 26, 2016
b564f0c
Minor style fixes
Jul 26, 2016
f7fb360
Fix #11 (Hopefully?)
kurisubrooks Jul 26, 2016
1391622
Properly Capitalise Window Title
kurisubrooks Jul 26, 2016
ff5ec14
Merge pull request #18 from kurisubrooks/patch-1
Jul 26, 2016
bbb217e
Merge pull request #19 from kurisubrooks/patch-2
Jul 26, 2016
a1b048d
Stop lowercasing keys before reading
Jul 26, 2016
515d68d
Remove Description field
Jul 26, 2016
9337b9d
Log error for pre-1.0 characters
Jul 26, 2016
7f5f486
Reimplement mod support
Jul 26, 2016
c97e758
Fix mod support for real
Jul 26, 2016
a2507f6
Fix for AttributeError on icon get
Jul 27, 2016
68e60e2
Fix for mode changing
Jul 28, 2016
f3c73ab
Fix for Capitalised Window Title
kurisubrooks Jul 29, 2016
1dd50ff
Fixes Name Capitalisation
kurisubrooks Jul 29, 2016
1af7081
remove py-starbound submodule
chrmoritz Jul 30, 2016
560efb7
Merge pull request #27 from chrmoritz/1.0
Jul 30, 2016
828a2a6
improved build.py
chrmoritz Jul 30, 2016
cdc6f88
don't show menubar icons on macOS
chrmoritz Jul 30, 2016
24d61e7
Merge pull request #28 from chrmoritz/1.0
Jul 30, 2016
5b5e201
assets: handle invalid JSON (empty, trailing comma)
chrmoritz Jul 31, 2016
a356aa9
fixing style issues
chrmoritz Jul 31, 2016
5919744
Merge pull request #29 from chrmoritz/1.0
Jul 31, 2016
32dfed5
Improve variant format handling in sb_asset
Dec 15, 2016
c79c8c5
Fix paths for 1.2 saves
Dec 15, 2016
fdbfe0b
Revert changes to build.py
Dec 15, 2016
4994d3f
Use cx_Freeze 4.3.4 instead of latest
Dec 19, 2016
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ starcheat/__pycache__/
*.org_archive
*.json
*.metadata
*.player
*.player
*.pyc
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ Here is how to build starcheat from source. Make sure everything in the dependen
- [PyQt5](http://www.riverbankcomputing.com/software/pyqt/download5)
- [Qt 5](http://qt-project.org/downloads) (included in PyQt5 binaries on Windows)
- [Pillow](https://pypi.python.org/pypi/Pillow/)
- [py-starbound](https://github.com/blixt/py-starbound)

**NOTE:** py-starbound is included as a [git submodule](http://git-scm.com/docs/git-submodule) and needs to be cloned with the following commands:

- ```cd <starcheat top folder>```
- ```git submodule sync```
- ```git submodule update --init```

Applications such as [Sourcetree](http://www.sourcetreeapp.com/) should offer to clone it automatically.

### Windows
Lines starting with ```>``` can be run in PowerShell or cmd.exe.
Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ init:

install:
- REG ADD HKCU\Software\Python\PythonCore\3.4\InstallPath /f /ve /t REG_SZ /d %PYTHON%
- git submodule update --init --recursive
- ps: Start-FileDownload $env:PyQT -FileName $env:temp/pyqt5_install.exe
- ps: "& $env:temp/pyqt5_install.exe /S"
- ps: "Wait-Process -Name pyqt5_install -Timeout 600"
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
- "python -c \"import PyQt5\""
- "pip --version"
- "pip install cx_freeze"
- "pip install cx_freeze==4.3.4"
- "pip install Pillow"

build_script:
Expand Down
44 changes: 23 additions & 21 deletions build.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
#!/usr/bin/env python3

import os, platform, shutil
from optparse import OptionParser
import os
import platform
import shutil
from argparse import ArgumentParser


def main():
desc = "builds starbound using pyqt5 and python3"
if platform.system() == "Windows":
desc += " (with cx_freeze if --with-exe is passed)"
parser = OptionParser(description=desc)
parser.add_option("-p", "--prefix", "-b", "--build", "--build-dir", dest="prefix", default="build",
help="build and install starboud to this prefix (default to build)")
parser.add_option("-v", "--verbose", dest="verbose", action="store_true", help="print status messages to stdout")
parser = ArgumentParser(description=desc)
parser.add_argument("-p", "--prefix", "-b", "--build", "--build-dir", dest="prefix", default="build",
help="build and install starboud to this prefix (default to build)")
parser.add_argument("-v", "--verbose", dest="verbose", action="store_true", default=True,
help="print status messages to stdout")
parser.add_argument("-q", "--quiet", dest="verbose", action="store_false", default=True,
help="don't print status messages to stdout")

if platform.system() == "Windows":
parser.add_option("-e", "--exe", "--with-exe", "--enable-exe", action="store_true", dest="exe",
help="generates .exe (windows only)")
parser.add_option("-d", "--dist", "--dist-dir", dest="dist", default="dist",
help="generates .exe to this dir (default to dist)")
(options, args) = parser.parse_args()
parser.add_argument("-e", "--exe", "--with-exe", "--enable-exe", action="store_true", dest="exe",
help="generates .exe (windows only)")
parser.add_argument("-d", "--dist", "--dist-dir", dest="dist", default="dist",
help="generates .exe to this dir (default to dist)")
options = parser.parse_args()

src_dir = os.path.dirname(os.path.realpath(__file__));
src_dir = os.path.dirname(os.path.realpath(__file__))
templates = os.listdir(os.path.join(src_dir, "starcheat", "templates"))
prefix = os.path.expanduser(options.prefix)
if platform.system() == "Windows":
Expand All @@ -29,23 +36,18 @@ def main():
dist = os.path.expanduser(options.dist)

if options.verbose:
print("Starting building starcheat to " + prefix + " ...")
print("Starting building Starcheat to " + prefix + " ...")

if os.path.exists(prefix):
if options.verbose:
print("Removing existing build directory")
shutil.rmtree(prefix)

if options.verbose:
print("Copying starcheat python scripts")
print("Copying Starcheat python scripts")
shutil.copytree(os.path.join(src_dir, "starcheat"), prefix,
ignore=shutil.ignore_patterns("templates", "starbound", "images", "*.qrc"))

if options.verbose:
print("Copying py-starbound module")
shutil.copytree(os.path.join(src_dir, "starcheat", "starbound", "starbound"),
os.path.join(prefix, "starbound"))

if options.verbose:
print("Generating python Qt templates...")
for t in templates:
Expand Down Expand Up @@ -74,7 +76,7 @@ def main():

if platform.system() == "Windows" and options.exe:
if options.verbose:
print("Starting generating starcheat standalone Windows build to " + dist + " ...")
print("Starting generating Starcheat standalone Windows build to " + dist + " ...")

if os.path.exists(dist):
if options.verbose:
Expand All @@ -85,7 +87,7 @@ def main():
print("Launching cx_freeze...")
icon_path = os.path.join(src_dir, "starcheat", "images", "starcheat.ico")
os.system("python " + cx_freeze_Path + " \"" + os.path.join(prefix, "starcheat.py") + "\" --target-dir=\"" +
dist + "\" --base-name=Win32GUI --icon=\"" + icon_path +"\"")
dist + "\" --base-name=Win32GUI --icon=\"" + icon_path + "\"")
shutil.copy(os.path.join(pyqt5_dir, "libEGL.dll"), dist)

if options.verbose:
Expand Down
2 changes: 1 addition & 1 deletion mac/starcheat.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
print %q(The starcheat formula has been moved to it`s own tap with support for brew
print %q(The Starcheat formula has been moved to it`s own tap with support for brew
update and a fixed .app creation. To install type:
brew remove starcheat
brew tap chrmoritz/starcheat
Expand Down
8 changes: 4 additions & 4 deletions mac/travis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def system(cmd, *args)
raise "error" unless Kernel.system cmd, *args
end

# Build starcheat
# Build Starcheat
system 'python3', 'build.py', '-v'
# Run some tests
FileUtils.cd 'build'
Expand All @@ -19,7 +19,7 @@ def system(cmd, *args)
system 'python3', 'setup.py', 'py2app'
system '/usr/local/opt/qt5/bin/macdeployqt', 'dist/starcheat.app', '-verbose=2'
# Test OS X .app + tar
FileUtils.mv 'dist/starcheat.app', 'StarCheat.app'
system 'StarCheat.app/Contents/MacOS/starcheat', '-v'
system 'tar', 'czf', "starcheat-#{ENV['TRAVIS_TAG']}-osx.tar.gz", 'StarCheat.app'
FileUtils.mv 'dist/starcheat.app', 'Starcheat.app'
system 'Starcheat.app/Contents/MacOS/starcheat', '-v'
system 'tar', 'czf', "starcheat-#{ENV['TRAVIS_TAG']}-osx.tar.gz", 'Starcheat.app'
end
11 changes: 5 additions & 6 deletions starcheat/assets/blueprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ def __init__(self, assets):
self.starbound_folder = assets.starbound_folder

def is_blueprint(self, key):
if key.endswith(".recipe"):
return True
else:
return False
return key.endswith(".recipe")

def index_data(self, asset):
key = asset[0]
path = asset[1]
offset = asset[2]
length = asset[3]
name = os.path.basename(asset[0]).split(".")[0]
asset_type = "blueprint"
asset_data = self.assets.read(key, path)
asset_data = self.assets.read(key, path, False, offset, length)

if asset_data is None:
return
Expand All @@ -27,7 +26,7 @@ def index_data(self, asset):
except (KeyError, IndexError):
category = "other"

return (key, path, asset_type, category, name, "")
return (key, path, offset, length, asset_type, category, name, "")

def get_all_blueprints(self):
"""Return a list of every indexed blueprints."""
Expand Down
Loading