Skip to content

Commit

Permalink
updated for 1.4.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkite committed Apr 5, 2021
1 parent 77698dd commit 61f3579
Show file tree
Hide file tree
Showing 8 changed files with 191 additions and 37 deletions.
39 changes: 9 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,20 @@ New Features
the location of your Terraria.exe. It will use Steam by default to help locate it. If it cannot find it, it will list all items and blocks using their `tag` instead of a translated name. You can manually specify the location of Terraria.exe if you wish the names used in Terrafirma to match the ones used in Terraria.


How to do a static compile on Windows:
How to do a Windows release:
-------------------------------------

Note, qt5 contains a lot of nested files, so it would be best to checkout the
repository somewhere close to root, like C:\qt5 to prevent path-length errors.
Compile a release version using Qt Creator. Copy the executable into
`packages/com.seancode.terrafirma/data`. Also, open that folder in the
developer command prompt and run `c:\Qt\5.13.0\msvc2017_64\bin\qtenv2.bat` or
whichever environment applies to your setup.

You also must install, git, activeperl, and python before compiling.
(python may be optional since we're now excluding qtquick).
Next run `windeployqt terrafirma.exe` which will copy all of the necessary
dlls into that folder.

Open your 64-bit developer prompt:
Finally change back into the main TerraFirma directory and run:
`c:\Qt\QtIFW-4.0.1\bin\binarycreator.exe -c config\config.xml -p packages terrafirmaInstall.exe`

```bat
> git clone https://gitub.com/qt/qt5.git
> cd qt5
> git checkout 5.12
> perl init-repository --module-subset=default,-qtwebkit,-qtwebkit-examples,-qtwebengine,-qtquick3d,-qtquick
(wait forever)
> mkdir qt_static
```

Now edit `qtbase\mkspecs\common\msvc-desktop.conf`. Find the CONFIG line
and rmeove `embed_manifest_dll` and `embed_manifest_exe` from that line.
Next find `QMAKE_CFLAGS_*` and change `-MD` to `-MT` and `MDd` to `-MTd`.

```bat
> configure -prefix %CD%\qt_static -opensource -confirm-license -platform win32-msvc -nomake tests -nomake examples -opengl desktop -release -static
> nmake
(wait forever)
> nmake install
```

This should make a static Qt5. Now in QtCreator go to Tools → Options and
select Qt Versions from Build & Run. Add a new Qt Version and locate the
`qmake.exe` inside `qt_static\bin`. Then create a new Kit that uses the Qt
Version you just created.

Building for Linux:
-------------------
Expand Down
2 changes: 1 addition & 1 deletion config/config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>Terrafirma</Name>
<Version>3.1.3</Version>
<Version>3.1.4</Version>
<Title>Terrafirma Installer</Title>
<Publisher>Sean Kasun</Publisher>
<StartMenuDir>Terrafirma</StartMenuDir>
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
terrafirma (3.1.4) bionic; urgency=medium

* Updated for 1.4.2

-- Sean Kasun <[email protected]> Sun, 04 Apr 2021 16:40:22 -0700

terrafirma (3.1.3) bionic; urgency=medium

* Fixed steam config bug
Expand Down
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ int main(int argc, char *argv[]) {
QApplication::installTranslator(&translator);

QApplication::setApplicationName("Terrafirma");
QApplication::setApplicationVersion("3.1.3");
QApplication::setApplicationVersion("3.1.4");
QApplication::setOrganizationName("seancode");

MainWindow w;
Expand Down
56 changes: 54 additions & 2 deletions packages/com.seancode.terrafirma/meta/installscript.qs
Original file line number Diff line number Diff line change
@@ -1,12 +1,64 @@
var targetDirectoryPage = null;

function Component()
{
installer.gainAdminRights();
component.loaded.connect(this, this.installerLoaded);
}

Component.prototype.createOperations = function()
{
component.createOperations();
if (systemInfo.productType == "windows") {
component.addOperation("CreateShortcut", "@TargetDir@/terrafirma.exe",
"@StartMenuDir@/Terrafirma.lnk", "workingDirectory=@TargetDir@");
component.addOperation("CreateShortcut",
"@TargetDir@/terrafirma.exe",
"@DesktopDir@/Terrafirma.lnk",
"workingDirectory=@TargetDir@");
component.addOperation("CreateShortcut",
"@TargetDir@/terrafirma.exe",
"@StartMenuDir@/Terrafirma.lnk",
"workingDirectory=@TargetDir@");
}
}

Component.prototype.installerLoaded = function()
{
installer.setDefaultPageVisible(QInstaller.TargetDirectory, false);
installer.addWizardPage(component, "TargetWidget", QInstaller.TargetDirectory);

targetDirectoryPage = gui.pageWidgetByObjectName("DynamicTargetWidget");
targetDirectoryPage.windowTitle = "Choose Installation Directory";
targetDirectoryPage.description.setText("Please select where TerraFirma will be installed:");
targetDirectoryPage.targetDirectory.textChanged.connect(this, this.targetDirectoryChanged);
targetDirectoryPage.targetDirectory.setText(installer.value("TargetDir"));
targetDirectoryPage.targetChooser.released.connect(this, this.targetChooserClicked);

gui.pageById(QInstaller.ComponentSelection).entered.connect(this, this.componentSelectionPageEntered);
}

Component.prototype.targetChooserClicked = function()
{
var dir = QFileDialog.getExistingDirectory("", targetDirectoryPage.targetDirectory.text);
targetDirectoryPage.targetDirectory.setText(dir);
}

Component.prototype.targetDirectoryChanged = function()
{
var dir = targetDirectoryPage.targetDirectory.text;
if (installer.fileExists(dir) && installer.fileExists(dir + "/maintenancetool.exe")) {
targetDirectoryPage.warning.setText("<p style=\"color: red\">Existing installation detected and will be overwritten.</p>");
} else if (installer.fileExists(dir)) {
targetDirectory.warning.setText("<p style=\"color: red\">Installing in existing directory. It will be wiped on uninstallation.</p>");
} else {
targetDirectoryPage.warning.setText("");
}
installer.setValue("TargetDir", dir);
}

Component.prototype.componentSelectionPageEntered = function()
{
var dir = installer.value("TargetDir");
if (installer.fileExists(dir) && installer.fileExists(dir + "/maintenancetool.exe")) {
installer.execute(dir + "/maintenancetool.exe", ["purge"], "yes");
}
}
8 changes: 6 additions & 2 deletions packages/com.seancode.terrafirma/meta/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
<Package>
<DisplayName>Terrafirma</DisplayName>
<Description>Terraria mapping software</Description>
<Version>3.1.3</Version>
<ReleaseDate>2021-03-22</ReleaseDate>
<Version>3.1.4</Version>
<ReleaseDate>2021-04-04</ReleaseDate>
<Default>true</Default>
<Required>true</Required>
<Script>installscript.qs</Script>
<UserInterfaces>
<UserInterface>targetwidget.ui</UserInterface>
</UserInterfaces>
</Package>
113 changes: 113 additions & 0 deletions packages/com.seancode.terrafirma/meta/targetwidget.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TargetWidget</class>
<widget class="QWidget" name="TargetWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>491</width>
<height>190</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>491</width>
<height>190</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="description">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="targetDirectory">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="targetChooser">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="warning">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>122</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
2 changes: 1 addition & 1 deletion world.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Tile {

class World : public QObject, public QRunnable {
static const int MinimumVersion = 88;
static const int HighestVersion = 234;
static const int HighestVersion = 236;


Q_OBJECT
Expand Down

0 comments on commit 61f3579

Please sign in to comment.