Skip to content

Commit fc47e06

Browse files
committed
Add misc resources and fix not found error
1 parent 9657637 commit fc47e06

21 files changed

+135
-44
lines changed

RogueEdit.pro

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
#-------------------------------------------------
2-
#
3-
# Project created by QtCreator 2016-06-18T19:31:37
4-
#
5-
#-------------------------------------------------
6-
7-
QT += core gui
8-
9-
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
10-
11-
TARGET = RogueEdit
12-
TEMPLATE = app
13-
14-
15-
SOURCES += src/sources/main.cpp\
16-
src/sources/mainwindow.cpp \
17-
src/sources/editor.cpp
18-
19-
HEADERS += src/headers/mainwindow.h \
20-
src/headers/editor.h \
21-
src/headers/items.h \
22-
src/headers/strings.h
23-
24-
FORMS += src/forms/mainwindow.ui
25-
26-
RESOURCES += \
27-
src/resources/images.qrc
1+
#-------------------------------------------------
2+
#
3+
# Project created by QtCreator 2016-06-18T19:31:37
4+
#
5+
#-------------------------------------------------
6+
7+
QT += core gui
8+
9+
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
10+
11+
TARGET = RogueEdit
12+
TEMPLATE = app
13+
14+
15+
SOURCES += src/sources/main.cpp\
16+
src/sources/mainwindow.cpp \
17+
src/sources/editor.cpp
18+
19+
HEADERS += src/headers/mainwindow.h \
20+
src/headers/editor.h \
21+
src/headers/items.h \
22+
src/headers/strings.h
23+
24+
FORMS += src/forms/mainwindow.ui
25+
26+
RESOURCES += \
27+
src/resources/images/images.qrc

src/Resources/images.qrc

-10
This file was deleted.

src/forms/mainwindow.ui

+7-7
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@
913913
<enum>Qt::PlainText</enum>
914914
</property>
915915
<property name="pixmap">
916-
<pixmap resource="images.qrc">:/Resources/statVIT.png</pixmap>
916+
<pixmap resource="../resources/images/images.qrc">:/statVIT.png</pixmap>
917917
</property>
918918
<property name="scaledContents">
919919
<bool>true</bool>
@@ -999,7 +999,7 @@
999999
<enum>Qt::PlainText</enum>
10001000
</property>
10011001
<property name="pixmap">
1002-
<pixmap resource="images.qrc">:/Resources/statDEX.png</pixmap>
1002+
<pixmap resource="../resources/images/images.qrc">:/statDEX.png</pixmap>
10031003
</property>
10041004
<property name="scaledContents">
10051005
<bool>true</bool>
@@ -1079,7 +1079,7 @@
10791079
<enum>Qt::PlainText</enum>
10801080
</property>
10811081
<property name="pixmap">
1082-
<pixmap resource="images.qrc">:/Resources/statMAG.png</pixmap>
1082+
<pixmap resource="../resources/images/images.qrc">:/statMAG.png</pixmap>
10831083
</property>
10841084
<property name="scaledContents">
10851085
<bool>true</bool>
@@ -1159,7 +1159,7 @@
11591159
<enum>Qt::PlainText</enum>
11601160
</property>
11611161
<property name="pixmap">
1162-
<pixmap resource="images.qrc">:/Resources/statSTR.png</pixmap>
1162+
<pixmap resource="../resources/images/images.qrc">:/statSTR.png</pixmap>
11631163
</property>
11641164
<property name="scaledContents">
11651165
<bool>true</bool>
@@ -1239,7 +1239,7 @@
12391239
<enum>Qt::PlainText</enum>
12401240
</property>
12411241
<property name="pixmap">
1242-
<pixmap resource="images.qrc">:/Resources/statTEC.png</pixmap>
1242+
<pixmap resource="../resources/images/images.qrc">:/statTEC.png</pixmap>
12431243
</property>
12441244
<property name="scaledContents">
12451245
<bool>true</bool>
@@ -1319,7 +1319,7 @@
13191319
<enum>Qt::PlainText</enum>
13201320
</property>
13211321
<property name="pixmap">
1322-
<pixmap resource="images.qrc">:/Resources/statFTH.png</pixmap>
1322+
<pixmap resource="../resources/images/images.qrc">:/statFTH.png</pixmap>
13231323
</property>
13241324
<property name="scaledContents">
13251325
<bool>true</bool>
@@ -2414,7 +2414,7 @@
24142414
</widget>
24152415
<layoutdefault spacing="6" margin="11"/>
24162416
<resources>
2417-
<include location="images.qrc"/>
2417+
<include location="../resources/images/images.qrc"/>
24182418
</resources>
24192419
<connections/>
24202420
</ui>

src/resources/images/images.qrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<RCC>
2+
<qresource prefix="/">
3+
<file>statDEX.png</file>
4+
<file>statFTH.png</file>
5+
<file>statMAG.png</file>
6+
<file>statSTR.png</file>
7+
<file>statTEC.png</file>
8+
<file>statVIT.png</file>
9+
</qresource>
10+
</RCC>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/resources/items/ArmorList.xlsx

9.65 KB
Binary file not shown.
9.14 KB
Binary file not shown.

src/resources/items/DroneList.xlsx

8.93 KB
Binary file not shown.
23.9 KB
Binary file not shown.

src/resources/items/HelmList.xlsx

9.93 KB
Binary file not shown.

src/resources/items/ItemList.xlsx

23 KB
Binary file not shown.

src/resources/items/RingList.xlsx

8.55 KB
Binary file not shown.

src/resources/items/ShieldList.xlsx

8.55 KB
Binary file not shown.

src/resources/items/WeaponList.xlsx

12.9 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#include <sstream>
2+
#include <fstream>
3+
#include <string>
4+
#include <iostream>
5+
#include <algorithm>
6+
7+
/* Converts Windows Format text file (exported from Excel) containing item ID's and names into an array. */
8+
int main(int argc, char* argv[])
9+
{
10+
if (argc != 3)
11+
{
12+
std::cout << "Usage: ./convert <source> <destination>";
13+
return -1;
14+
}
15+
16+
std::stringstream parser;
17+
std::ifstream src(argv[1]); // Source file location
18+
std::ofstream dest(argv[2]); // Destination file location
19+
20+
if (src.fail()) std::cout << "Invalid source file." << std::endl;
21+
if (dest.fail()) std::cout << "Invalid destination file." << std::endl;
22+
23+
parser << src.rdbuf();
24+
25+
static const std::string prefix = "static const QStringList itemList = {";
26+
static const std::string suffix = "};";
27+
28+
std::string word;
29+
std::string* output = new std::string(prefix);
30+
31+
while (parser >> word)
32+
{
33+
std::getline(parser, word); // Grab the rest of the line
34+
word.erase(std::remove(word.begin(), word.end(), '\t'), word.end());
35+
word.erase(std::remove(word.begin(), word.end(), '\n'), word.end());
36+
word.erase(std::remove(word.begin(), word.end(), '\r'), word.end());
37+
*(output) += "\"" + word + "\",";
38+
}
39+
40+
output->pop_back();
41+
output->append(suffix); // Append the suffix
42+
dest << *(output); // Store the output in dest
43+
dest.close();
44+
delete output;
45+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#include <sstream>
2+
#include <fstream>
3+
#include <string>
4+
#include <iostream>
5+
#include <algorithm>
6+
7+
/* Converts Windows Format text file (exported from Excel) containing item ID's and names into an array. */
8+
int main(int argc, char* argv[])
9+
{
10+
if (argc != 3)
11+
{
12+
std::cout << "Usage: ./convert <source> <destination>";
13+
return -1;
14+
}
15+
16+
std::stringstream parser;
17+
std::ifstream src(argv[1]); // Source file location
18+
std::ofstream dest(argv[2]); // Destination file location
19+
20+
if (src.fail()) std::cout << "Invalid source file." << std::endl;
21+
if (dest.fail()) std::cout << "Invalid destination file." << std::endl;
22+
23+
parser << src.rdbuf();
24+
25+
static const std::string prefix = "static const std::unordered_map<int, std::string> items = {";
26+
static const std::string suffix = "};";
27+
28+
std::string ID;
29+
std::string name;
30+
std::string* output = new std::string(prefix);
31+
32+
while (parser >> ID)
33+
{
34+
std::getline(parser, name); // Grab the rest of the line
35+
name.erase(std::remove(name.begin(), name.end(), '\t'), name.end());
36+
name.erase(std::remove(name.begin(), name.end(), '\n'), name.end());
37+
name.erase(std::remove(name.begin(), name.end(), '\r'), name.end());
38+
*(output) += "{" + ID + ",\"" + name + "\"},";
39+
}
40+
41+
output->pop_back(); // Remove extra comma
42+
output->append(suffix); // Append the suffix
43+
dest << *(output); // Store the output in dest
44+
dest.close();
45+
delete output;
46+
}

0 commit comments

Comments
 (0)