Generate about-boe.xml dynamically

This commit is contained in:
2024-11-10 14:46:35 -06:00
parent a551da6299
commit 5c83fad1f9
11 changed files with 272 additions and 58 deletions

38
pkg/credits/Funding.txt Normal file
View 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
View File

@@ -0,0 +1,6 @@
Confirmed:
- The Almighty Doer of Stuff
- Mistb0rn
- Celtic Minstrel
- Kelyar-Ihrno
- Jewels

View File

@@ -0,0 +1,9 @@
Confirmed:
- Khoth
- Ormus
- Chokboyz
- Celtic Minstrel
- Ben Scott
- Sylae Corell
- xq
- NQNStudios

2
pkg/credits/Testing.txt Normal file
View File

@@ -0,0 +1,2 @@
Confirmed:
- The Almighty Doer of Stuff

View 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>

View File

@@ -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
View 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()

View File

@@ -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

View File

@@ -1,4 +1,8 @@
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<!--
WARNING! This file is generated by pkg/generate-credits.py from
tpkg/credits/about-boe-template.xml. Do not modify it manually!
-->
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
<dialog defbtn='okay'>
<!--
@@ -9,17 +13,16 @@
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='67'>
<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: <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
OPEN SOURCE CREDITS: <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
SCENARIO FIXES AND UPDATES: <br/><br/>
</text>
<!-- This text is right-aligned and fills out the above text with sub-headings -->
<!-- The height of this text needs to be 10 times the number of lines. -->
<text top='52' left='50' width='180' height='240' align='right'>
<text top='52' left='50' width='180' height='610' align='right'>
<br/>
Concept, Design, Programming: <br/>
Graphics: <br/>
@@ -27,16 +30,14 @@
Title/Splash Screens: <br/>
<br/>
<br/>
Programming: <br/><br/><br/><br/><br/><br/><br/>
Programming: <br/><br/><br/><br/><br/><br/><br/><br/>
Graphics: <br/><br/><br/><br/><br/>
Testing and Troubleshooting: <br/>
Funding: <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<br/><br/>
Bandit Busywork: <br/>
</text>
<!-- The height of this text needs to be 10 times the number of lines. -->
<!-- Also make sure that it properly aligns with the previous text. -->
<!-- Comments are included to aid with this. Don't mess it up! Test it to be sure! -->
<text top='52' left='250' width='230' height='240'>
<text top='52' left='250' width='230' height='610'>
<!-- ORIGINAL GAME --><br/>
<!-- Concept, Design, Programming -->Jeff Vogel (SpidWeb@spidweb.com) <br/>
<!-- Graphics -->Andrew Hunter (Wormius@aol.com) <br/>
@@ -44,34 +45,72 @@
<!-- Title/Splash Screens -->James Ernest (ernest@speakeasy.org) <br/>
<br/><!-- OPEN SOURCE CREDITS --><br/>
<!-- Programming -->Khoth <br/>
Ormus <br/>
Chokboyz <br/>
Celtic Minstrel <br/>
Ben Scott <br/>
Sylae Corell <br/>
xq <br/>
Ormus <br/>
Chokboyz <br/>
Celtic Minstrel <br/>
Ben Scott <br/>
Sylae Corell <br/>
xq <br/>
NQNStudios <br/>
<!-- Graphics -->The Almighty Doer of Stuff <br/>
Mistb0rn <br/>
Celtic Minstrel <br/>
Kelyar-Ihrno <br/>
Jewels <br/>
Mistb0rn <br/>
Celtic Minstrel <br/>
Kelyar-Ihrno <br/>
Jewels <br/>
<!-- Testing and Troubleshooting -->The Almighty Doer of Stuff <br/>
<!-- Funding -->Alan Elkins <br/>
Alan Monroe <br/>
Amanda Klecker <br/>
Andrew Flicker <br/>
Anonymous <br/>
Baste Nesse Buanes <br/>
Bret Rodabaugh <br/>
Dylan Nugent <br/>
Evan Mulrooney <br/>
Jake Harrelson <br/>
Jared Forcinito <br/>
Jeff Potter <br/>
Jeff Vogel <br/>
Jeremy Bracegirdle <br/>
Joel Joslin <br/>
Joshua Murphy <br/>
Juan Dionicio Becerra <br/>
Kelandon <br/>
Kelson (Andulos) <br/>
K L <br/>
Laura Nelson <br/>
Mariann Krizsan <br/>
Mike Lapinsky <br/>
Nick Chaimov <br/>
Nick Fisher <br/>
Nicole Tietz-Sokolskaya <br/>
Nikki Jeffery <br/>
Noah Nelson <br/>
Ruby Paterson <br/>
Samael <br/>
Sean Hayden <br/>
Souren Papazian <br/>
Tony Martyn <br/>
Tony Vazquez <br/>
Trent Nelson <br/>
Vida Krevs <br/>
William Hensley <br/>
<br/><!-- SCENARIO FIXES AND UPDATES --><br/>
<!-- Bandit Busywork -->The Almighty Doer of Stuff <br/>
</text>
</pane>
<text top='110' left='50' width='410' height='51'>
<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='162' left='50' width='424' height='145'>
<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='240' left='60' width='353' height='66'>
<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.