-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated for 1.4.4.9, added editor and xnb2png utilities
- Loading branch information
Showing
51 changed files
with
4,382 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ build/ | |
[Bb]in/ | ||
[Oo]bj/ | ||
[Tt]erra[Ff]irma.app/ | ||
build-* | ||
|
||
# Visual Studio profiler | ||
*.psess | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
terrafirma (3.1.10) focal; urgency=medium | ||
|
||
* Updated for 1.4.4.9 | ||
|
||
-- Sean Kasun <[email protected]> Sun, 22 Jan 2023 23:12:35 -0700 | ||
|
||
terrafirma (3.1.9) focal; urgency=medium | ||
|
||
* Updated for 1.4.3.6 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
project(editor VERSION 1.0.0 LANGUAGES CXX) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
find_package(Qt6 REQUIRED COMPONENTS Widgets) | ||
qt_standard_project_setup() | ||
|
||
add_executable(editor | ||
tfcfg.cpp | ||
tfcfg.ui | ||
tileeditor.cpp | ||
tileeditor.ui | ||
tilevareditor.cpp | ||
tilevareditor.ui | ||
walleditor.cpp | ||
walleditor.ui | ||
itemeditor.cpp | ||
itemeditor.ui | ||
prefixeditor.cpp | ||
prefixeditor.ui | ||
npceditor.cpp | ||
npceditor.ui | ||
globaleditor.cpp | ||
globaleditor.ui | ||
headereditor.cpp | ||
headereditor.ui | ||
main.cpp | ||
) | ||
|
||
qt_add_resources(editor "data" | ||
PREFIX "/data" | ||
FILES ../res/tiles.json ../res/walls.json ../res/items.json | ||
../res/prefixes.json ../res/npcs.json ../res/globals.json ../res/header.json) | ||
|
||
target_link_libraries(editor PRIVATE | ||
Qt6::Widgets) | ||
|
||
set_target_properties(editor PROPERTIES | ||
WIN32_EXECUTABLE ON | ||
MACOSX_BUNDLE ON | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
This is the editor for terrafirma config files. | ||
|
||
Here are the terraria class points of interest: | ||
|
||
Terraria.IO.WorldFile.LoadWorld_Version2 | ||
|
||
Terraria.ID.ItemID | ||
|
||
Terraria.ID.NPCID | ||
Terraria.ID.NPCHeadID | ||
|
||
Terraria.Terraria.Item | ||
this.createTile = 137; | ||
this.DefaultToPlaceableTile(629, 0); | ||
|
||
Terraria.ID.TileID | ||
for missing tile id names | ||
|
||
Terraria.ID.WallID | ||
for missing wall id names | ||
|
||
Terraria.ID.TileID.Sets | ||
DrawFlipMode - flip flag | ||
ChecksForMerge - merge flag | ||
Grass - grass flag | ||
|
||
Terraria.ID.WallID.Sets | ||
BlendType - blend | ||
|
||
Terraria.Terraria.Main | ||
Main.tileSolid - solid flag | ||
Main.tileStone - stone flag | ||
Main.tilePile - pile flag | ||
Main.tileMergeDirt - dirt flag | ||
Main.tileBrick - brick flag | ||
Main.tileMoss - moss flag | ||
Main.tileLargeFrames - large flag | ||
Main.tileBlockLight - !trans flag | ||
Main.wallLargeFrames - Large number | ||
BannerToItem() - NPC Banner | ||
|
||
Terraria.Graphics.Light | ||
TileLightScanner.ApplyTileLight() - light |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** @copyright 2023 Sean Kasun */ | ||
#include <QColorDialog> | ||
#include "globaleditor.h" | ||
#include "ui_globaleditor.h" | ||
|
||
GlobalEditor::GlobalEditor(QJsonObject obj, QWidget *parent) : QDialog(parent), ui(new Ui::GlobalEditor), obj(obj) { | ||
ui->setupUi(this); | ||
ui->id->setText(obj["id"].toString()); | ||
ui->color->setText(obj["color"].toString()); | ||
} | ||
|
||
GlobalEditor::~GlobalEditor() { | ||
delete ui; | ||
} | ||
|
||
void GlobalEditor::changeColor() { | ||
QColor orig = QColor(obj["color"].toString("#000000")); | ||
auto color = QColorDialog::getColor(orig, this); | ||
if (color.isValid()) { | ||
ui->color->setText(color.name()); | ||
} | ||
} | ||
|
||
void GlobalEditor::done(int r) { | ||
if (r == QDialog::Accepted) { | ||
obj["id"] = ui->id->text(); | ||
obj["color"] = ui->color->text(); | ||
} | ||
QDialog::done(r); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** @copyright 2023 Sean Kasun */ | ||
#pragma once | ||
|
||
#include <QDialog> | ||
#include <QJsonObject> | ||
|
||
namespace Ui { | ||
class GlobalEditor; | ||
} | ||
|
||
class GlobalEditor : public QDialog { | ||
Q_OBJECT | ||
|
||
public: | ||
explicit GlobalEditor(QJsonObject obj, QWidget *parent = nullptr); | ||
~GlobalEditor(); | ||
QJsonObject obj; | ||
|
||
public slots: | ||
void changeColor(); | ||
void done(int r); | ||
|
||
private: | ||
Ui::GlobalEditor *ui; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>GlobalEditor</class> | ||
<widget class="QDialog" name="GlobalEditor"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>400</width> | ||
<height>115</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Dialog</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<layout class="QFormLayout" name="formLayout"> | ||
<item row="0" column="0"> | ||
<widget class="QLabel" name="iDLabel"> | ||
<property name="text"> | ||
<string>ID</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="0" column="1"> | ||
<widget class="QLineEdit" name="id"/> | ||
</item> | ||
<item row="1" column="0"> | ||
<widget class="QLabel" name="colorLabel"> | ||
<property name="text"> | ||
<string>Color</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="1" column="1"> | ||
<widget class="QPushButton" name="color"/> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<widget class="QDialogButtonBox" name="buttonBox"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="standardButtons"> | ||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections> | ||
<connection> | ||
<sender>buttonBox</sender> | ||
<signal>accepted()</signal> | ||
<receiver>GlobalEditor</receiver> | ||
<slot>accept()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>248</x> | ||
<y>254</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>157</x> | ||
<y>274</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
<connection> | ||
<sender>buttonBox</sender> | ||
<signal>rejected()</signal> | ||
<receiver>GlobalEditor</receiver> | ||
<slot>reject()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>316</x> | ||
<y>260</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>286</x> | ||
<y>274</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
<connection> | ||
<sender>color</sender> | ||
<signal>clicked()</signal> | ||
<receiver>GlobalEditor</receiver> | ||
<slot>changeColor()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>220</x> | ||
<y>53</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>199</x> | ||
<y>57</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
</connections> | ||
<slots> | ||
<slot>changeColor()</slot> | ||
</slots> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** @copyright 2023 Sean Kasun */ | ||
#include "headereditor.h" | ||
#include "ui_headereditor.h" | ||
|
||
HeaderEditor::HeaderEditor(QJsonObject obj, QWidget *parent) : QDialog(parent), ui(new Ui::HeaderEditor), obj(obj) { | ||
ui->setupUi(this); | ||
ui->name->setText(obj["name"].toString()); | ||
ui->type->setCurrentText(obj["type"].toString()); | ||
if (obj.contains("num")) { | ||
ui->array->setText(tr("%1").arg(obj["num"].toInt())); | ||
} else { | ||
ui->array->setText(obj["relnum"].toString()); | ||
} | ||
ui->min->setText(tr("%1").arg(obj["min"].toInt(88))); | ||
} | ||
|
||
HeaderEditor::~HeaderEditor() { | ||
delete ui; | ||
} | ||
|
||
void HeaderEditor::done(int r) { | ||
if (r == QDialog::Accepted) { | ||
obj["name"] = ui->name->text(); | ||
obj["type"] = ui->type->currentText(); | ||
obj.remove("num"); | ||
obj.remove("relnum"); | ||
bool isNum; | ||
auto num = ui->array->text().toInt(&isNum); | ||
if (isNum) { | ||
obj["num"] = num; | ||
} else if (!ui->array->text().isEmpty()) { | ||
obj["relnum"] = ui->array->text(); | ||
} | ||
auto min = ui->min->text().toInt(); | ||
if (min == 88) { | ||
obj.remove("min"); | ||
} else { | ||
obj["min"] = min; | ||
} | ||
} | ||
QDialog::done(r); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** @copyright 2023 Sean Kasun */ | ||
#pragma once | ||
|
||
#include <QDialog> | ||
#include <QJsonObject> | ||
|
||
namespace Ui { | ||
class HeaderEditor; | ||
} | ||
|
||
class HeaderEditor : public QDialog { | ||
Q_OBJECT | ||
|
||
public: | ||
explicit HeaderEditor(QJsonObject obj, QWidget *parent = nullptr); | ||
~HeaderEditor(); | ||
QJsonObject obj; | ||
|
||
public slots: | ||
void done(int r); | ||
|
||
private: | ||
Ui::HeaderEditor *ui; | ||
}; |
Oops, something went wrong.