Skip to content

Commit 5cba088

Browse files
committed
Tracker Island Backgrounds
- Rewrite generate_qrc_file to be more robust - Add pictures of islands to the locations list background The internet claims that the palette approach should be more performant than StyleSheets
1 parent c65c509 commit 5cba088

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+36
-26
lines changed

gui/desktop/generate_qrc_file.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,29 @@
55
import sys
66
import argparse
77

8+
import xml.etree.cElementTree as ET
9+
810
def main():
911
parser = argparse.ArgumentParser()
1012
parser.add_argument("data_dir")
1113
args = parser.parse_args(sys.argv[1:])
1214

1315
data_root = args.data_dir
1416
individual_files = []
15-
with open('data.qrc', 'w') as qrc:
16-
qrc.write('<RCC>\n')
17-
qrc.write(' <qresource prefix="/">\n')
18-
for root, dirs, files in os.walk(data_root):
19-
for file in files:
20-
f = os.path.join(root, file)
21-
if os.path.isfile(f):
22-
f = f.replace('\\', '/')
23-
individual_files.append(f)
2417

25-
for file in individual_files:
26-
embed_path = file.replace(data_root, '')
27-
qrc.write(' <file alias=\"' + embed_path + '\">' + file + '</file>\n')
18+
rcc = ET.Element("RCC")
19+
resources = ET.SubElement(rcc, "qresource", prefix="/")
20+
for root, dirs, files in os.walk(data_root):
21+
for file in files:
22+
f = os.path.join(root, file)
23+
if os.path.isfile(f):
24+
f = f.replace('\\', '/')
25+
individual_files.append(f)
26+
27+
for file in individual_files:
28+
embed_path = file.replace(data_root, '')
29+
ET.SubElement(resources, "file", alias=embed_path).text = file
2830

29-
qrc.write(' </qresource>\n')
30-
qrc.write('</RCC>')
31+
ET.ElementTree(rcc).write("data.qrc")
3132

3233
main()

gui/desktop/mainwindow.ui

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<string notr="true"/>
7070
</property>
7171
<property name="currentIndex">
72-
<number>6</number>
72+
<number>0</number>
7373
</property>
7474
<widget class="QWidget" name="getting_started_tab">
7575
<attribute name="title">
@@ -2462,13 +2462,16 @@ color: lightgray</string>
24622462
</property>
24632463
<property name="minimumSize">
24642464
<size>
2465-
<width>364</width>
2465+
<width>346</width>
24662466
<height>346</height>
24672467
</size>
24682468
</property>
24692469
<property name="cursor">
24702470
<cursorShape>ArrowCursor</cursorShape>
24712471
</property>
2472+
<property name="autoFillBackground">
2473+
<bool>true</bool>
2474+
</property>
24722475
<property name="styleSheet">
24732476
<string notr="true"/>
24742477
</property>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

gui/desktop/tracker/data/area_cliff_plateau_isles.png renamed to gui/desktop/tracker/data/areas/Cliff Plateau Isles.png

File renamed without changes.

gui/desktop/tracker/data/area_crescent_moon_island.png renamed to gui/desktop/tracker/data/areas/Crescent Moon Island.png

File renamed without changes.
File renamed without changes.

gui/desktop/tracker/data/area_diamond_steppe_island.png renamed to gui/desktop/tracker/data/areas/Diamond Steppe Island.png

File renamed without changes.

0 commit comments

Comments
 (0)