Generate about-boe.xml dynamically
This commit is contained in:
38
pkg/credits/Funding.txt
Normal file
38
pkg/credits/Funding.txt
Normal file
@@ -0,0 +1,38 @@
|
||||
Confirmed:
|
||||
- Alan Elkins
|
||||
- Alan Monroe
|
||||
- Amanda Klecker
|
||||
- Andrew Flicker
|
||||
- Anonymous
|
||||
- Baste Nesse Buanes
|
||||
- Bret Rodabaugh
|
||||
- Dylan Nugent
|
||||
- Evan Mulrooney
|
||||
- Jake Harrelson
|
||||
- Jared Forcinito
|
||||
- Jeff Potter
|
||||
- Jeff Vogel
|
||||
- Jeremy Bracegirdle
|
||||
- Joel Joslin
|
||||
- Joshua Murphy
|
||||
- Juan Dionicio Becerra
|
||||
- Kelandon
|
||||
- Kelson (Andulos)
|
||||
- K L
|
||||
- Laura Nelson
|
||||
- Mariann Krizsan
|
||||
- Mike Lapinsky
|
||||
- Nick Chaimov
|
||||
- Nick Fisher
|
||||
- Nicole Tietz-Sokolskaya
|
||||
- Nikki Jeffery
|
||||
- Noah Nelson
|
||||
- Ruby Paterson
|
||||
- Samael
|
||||
- Sean Hayden
|
||||
- Souren Papazian
|
||||
- Tony Martyn
|
||||
- Tony Vazquez
|
||||
- Trent Nelson
|
||||
- Vida Krevs
|
||||
- William Hensley
|
6
pkg/credits/Graphics.txt
Normal file
6
pkg/credits/Graphics.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
Confirmed:
|
||||
- The Almighty Doer of Stuff
|
||||
- Mistb0rn
|
||||
- Celtic Minstrel
|
||||
- Kelyar-Ihrno
|
||||
- Jewels
|
9
pkg/credits/Programming.txt
Normal file
9
pkg/credits/Programming.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
Confirmed:
|
||||
- Khoth
|
||||
- Ormus
|
||||
- Chokboyz
|
||||
- Celtic Minstrel
|
||||
- Ben Scott
|
||||
- Sylae Corell
|
||||
- xq
|
||||
- NQNStudios
|
2
pkg/credits/Testing.txt
Normal file
2
pkg/credits/Testing.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
Confirmed:
|
||||
- The Almighty Doer of Stuff
|
71
pkg/credits/about-boe-template.xml
Normal file
71
pkg/credits/about-boe-template.xml
Normal file
@@ -0,0 +1,71 @@
|
||||
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||||
<!--
|
||||
{{Warning}}
|
||||
-->
|
||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||
<dialog defbtn='okay'>
|
||||
<!--
|
||||
TODO: This dialog contains out-of-date information, such as pricing.
|
||||
-->
|
||||
<pict type='dlog' num='16' top='6' left='6'/>
|
||||
<text top='6' left='50' width='420' height='33'>
|
||||
Blades of Exile v2.0 alpha <br/>
|
||||
Copyright 1997-2015, Spiderweb Software, Inc., All rights reserved.
|
||||
</text>
|
||||
<pane top='42' left='50' width='400' height='100'>
|
||||
<text size='large' top='42' left='150' width='300' height='17'>------ CREDITS ------</text>
|
||||
<!-- The height of this text needs to be 10 times the number of lines. -->
|
||||
<text top='52' left='50' width='400' height='240'>
|
||||
ORIGINAL GAME: <br/><br/><br/><br/><br/><br/>
|
||||
OPEN SOURCE CREDITS: {{0}}<br/><br/>
|
||||
SCENARIO FIXES AND UPDATES: <br/><br/>
|
||||
</text>
|
||||
<!-- This text is right-aligned and fills out the above text with sub-headings -->
|
||||
<text top='52' left='50' width='180' height='{{Height}}' align='right'>
|
||||
<br/>
|
||||
Concept, Design, Programming: <br/>
|
||||
Graphics: <br/>
|
||||
Business Manager: <br/>
|
||||
Title/Splash Screens: <br/>
|
||||
<br/>
|
||||
<br/>
|
||||
Programming: {{1}}
|
||||
Graphics: {{2}}
|
||||
Testing and Troubleshooting: {{3}}
|
||||
Funding: {{4}}
|
||||
<br/><br/>
|
||||
Bandit Busywork: <br/>
|
||||
</text>
|
||||
<text top='52' left='250' width='230' height='{{Height}}'>
|
||||
<!-- ORIGINAL GAME --><br/>
|
||||
<!-- Concept, Design, Programming -->Jeff Vogel (SpidWeb@spidweb.com) <br/>
|
||||
<!-- Graphics -->Andrew Hunter (Wormius@aol.com) <br/>
|
||||
<!-- Business Manager -->Mariann Krizsan (krizsan@spidweb.com)<br/>
|
||||
<!-- Title/Splash Screens -->James Ernest (ernest@speakeasy.org) <br/>
|
||||
<br/><!-- OPEN SOURCE CREDITS --><br/>
|
||||
<!-- Programming -->{{5}}
|
||||
<!-- Graphics -->{{6}}
|
||||
<!-- Testing and Troubleshooting -->{{7}}
|
||||
<!-- Funding -->{{8}}
|
||||
<br/><!-- SCENARIO FIXES AND UPDATES --><br/>
|
||||
<!-- Bandit Busywork -->The Almighty Doer of Stuff <br/>
|
||||
</text>
|
||||
</pane>
|
||||
<text top='143' left='50' width='410' height='51'>
|
||||
Blades of Exile is brought to you by Spiderweb Software - <br/>
|
||||
"Where our aberrations become your reality." <br/>
|
||||
"Blades of Exile" and Spiderweb Software are trademarks of Spiderweb Software.
|
||||
</text>
|
||||
<text top='195' left='50' width='424' height='145'>
|
||||
Open Blades of Exile is brought to you from the hard work of volunteers who are passionate about this software.
|
||||
We sincerely hope you enjoy, share, and discuss this game, and maybe even make and release your own scenario!<br/>
|
||||
Open Blades of Exile is a modification of Blades of Exile, created by Spiderweb Software, Inc. in 1997.
|
||||
It is released under GNU GPL 2.0+. The source code can be found at https://github.com/calref/cboe/.
|
||||
</text>
|
||||
<text top='273' left='60' width='353' height='66'>
|
||||
Comments and questions? The creators and maintainers of Exile want to hear them.
|
||||
Visit http://www.spidweb.com/, where you can find the official discussion forum and other great games!
|
||||
<br/>Or open a ticket at https://github.com/calref/cboe/issues.
|
||||
</text>
|
||||
<button name='okay' type='regular' top='299' left='435'>OK</button>
|
||||
</dialog>
|
@@ -1,27 +0,0 @@
|
||||
Open Blades of Exile
|
||||
|
||||
Maintenance:
|
||||
|
||||
- NQNStudios
|
||||
|
||||
Not confirmed:
|
||||
- CelticMinstrel
|
||||
- sylae
|
||||
- Menshin
|
||||
- fosnola
|
||||
- evan-erdos
|
||||
- daerogami
|
||||
- akien-mga
|
||||
- MaddTheSane
|
||||
- ultraboe
|
||||
- murlock
|
||||
- absquatulate
|
||||
- catphive
|
||||
- redsaurus
|
||||
- retropipes
|
||||
- seisatsu
|
||||
- x-qq
|
||||
|
||||
Art:
|
||||
|
||||
- ???
|
85
pkg/generate-credits.py
Normal file
85
pkg/generate-credits.py
Normal file
@@ -0,0 +1,85 @@
|
||||
# Call this manually every time the metadata in pkg/credits changes.
|
||||
# Commit the generated files.
|
||||
|
||||
# Requires:
|
||||
# - ImageMagick
|
||||
# - Install font: pkg/credits/pixChicago-edited.ttf
|
||||
|
||||
# Usage: python pkg/generate-credits.py
|
||||
|
||||
from glob import glob
|
||||
from os.path import basename, splitext
|
||||
|
||||
def get_confirmed_names(filename):
|
||||
with open(filename, 'r') as file:
|
||||
lines = [line.rstrip() for line in file]
|
||||
# The first line should always be Confirmed:
|
||||
lines = lines[1:]
|
||||
# After the confirmed names, there may be Not Confirmed: names.
|
||||
if 'Not Confirmed:' in lines:
|
||||
lines = lines[0:lines.index('Not Confirmed:')]
|
||||
return [line.replace('- ', '') for line in lines if len(line) > 0]
|
||||
|
||||
def main():
|
||||
# Generate about-boe.xml from about-boe-template.xml:
|
||||
with open('pkg/credits/about-boe-template.xml', 'r') as template_file:
|
||||
template = template_file.read()
|
||||
content = template
|
||||
|
||||
name_files = glob('pkg/credits/*.txt')
|
||||
name_dict = {}
|
||||
num_dict = {}
|
||||
total_num = 0
|
||||
for name_file in name_files:
|
||||
heading, _ = splitext(basename(name_file))
|
||||
name_dict[heading] = get_confirmed_names(name_file)
|
||||
num_dict[heading] = len(name_dict[heading])
|
||||
total_num += len(name_dict[heading])
|
||||
|
||||
def replace_tabbed_lines(placeholder, lines, tabs):
|
||||
return content.replace(placeholder, ('\n' + ('\t' * tabs)).join(lines.splitlines()))
|
||||
|
||||
# {{Warning}}:
|
||||
content = replace_tabbed_lines('{{Warning}}', 'WARNING! This file is generated by pkg/generate-credits.py from\ntpkg/credits/about-boe-template.xml. Do not modify it manually!', 1)
|
||||
|
||||
# {{Height}}: 10 * (total # of lines, which includes 2 at the top and 4 per section break)
|
||||
content = content.replace('{{Height}}', str(10 * (total_num + 10)))
|
||||
|
||||
# {{0}}: '<br/>' * (total # of confirmed names in pkg/credits/*.txt)
|
||||
content = content.replace('{{0}}', '<br/>' * total_num)
|
||||
|
||||
# {{1}}: '<br/>' * (# of programmers)
|
||||
content = content.replace('{{1}}', '<br/>' * num_dict['Programming'])
|
||||
|
||||
# {{2}}: '<br/>' * (# of artists)
|
||||
content = content.replace('{{2}}', '<br/>' * num_dict['Graphics'])
|
||||
|
||||
# {{3}}: '<br/>' * (# of testers)
|
||||
content = content.replace('{{3}}', '<br/>' * num_dict['Testing'])
|
||||
|
||||
# {{4}}: '<br/>' * (# of donors)
|
||||
content = content.replace('{{4}}', '<br/>' * num_dict['Funding'])
|
||||
|
||||
list_break = ' <br/>\n'
|
||||
|
||||
# {{5}}: Programmer name lines
|
||||
name_lines = list_break.join(name_dict["Programming"]) + list_break
|
||||
content = replace_tabbed_lines('{{5}}', name_lines, 8)
|
||||
|
||||
# {{6}}: Artist name lines
|
||||
name_lines = list_break.join(name_dict["Graphics"]) + list_break
|
||||
content = replace_tabbed_lines('{{6}}', name_lines, 7)
|
||||
|
||||
# {{7}}: Tester name lines
|
||||
name_lines = list_break.join(name_dict["Testing"]) + list_break
|
||||
content = replace_tabbed_lines('{{7}}', name_lines, 12)
|
||||
|
||||
# {{8}}: Donor names
|
||||
name_lines = list_break.join(name_dict["Funding"]) + list_break
|
||||
content = replace_tabbed_lines('{{8}}', name_lines, 7)
|
||||
|
||||
with open('rsrc/dialogs/about-boe.xml', 'w') as output_file:
|
||||
output_file.write(content)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Call this manually every time DONORS.md or pkg/credits/credits.txt
|
||||
# changes, and commit the generated files.
|
||||
|
||||
# Requires:
|
||||
# - ImageMagick
|
||||
# - Rollout font
|
||||
|
||||
# Usage: generate-credits.sh
|
Reference in New Issue
Block a user