author | Wuzzy <Wuzzy2@mail.ru> |
Thu, 13 Dec 2018 21:35:26 +0100 | |
changeset 14453 | 05ca0057d71f |
parent 14452 | 6f6d9fe79830 (diff) |
parent 14445 | 2c4f71779302 (current diff) |
child 14454 | a88c61d8976a |
--- a/.hgignore Thu Dec 13 12:12:40 2018 -0500 +++ b/.hgignore Thu Dec 13 21:35:26 2018 +0100 @@ -20,6 +20,7 @@ cmake_install.cmake QTfrontend/hwconsts.cpp QTfrontend/servermessages.h +QTfrontend/creditsmessages.h CPackConfig.cmake CPackSourceConfig.cmake tools/cmake_uninstall.cmake
--- a/CREDITS Thu Dec 13 12:12:40 2018 -0500 +++ b/CREDITS Thu Dec 13 21:35:26 2018 +0100 @@ -2,6 +2,8 @@ === EXTENDED CREDITS LIST === ============================= +For the normal credits, click on the Hedgewars logo in the main menu. + IF NOT OTHERWISE SPECIFIED, ALL OTHER CONTENT IS PROPERTY OF Andrey Korotaev <unC0Rr@gmail.com>. IF NO LICENSE IS SPECIFIED, THE LICENSE IS THE SAME AS MENTIONED IN README.md.
--- a/QTfrontend/CMakeLists.txt Thu Dec 13 12:12:40 2018 -0500 +++ b/QTfrontend/CMakeLists.txt Thu Dec 13 21:35:26 2018 +0100 @@ -45,6 +45,29 @@ list(APPEND locsout ${firstline} "\n}\\;\n") file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/servermessages.h ${locsout}) + +# Credits localization +file(GLOB CreditsCSV ${CMAKE_SOURCE_DIR}/QTfrontend/res/credits.csv) +foreach(csvfile ${CreditsCSV}) + file(READ ${csvfile} csv) + string(REGEX MATCHALL "\n(E|S|U),\"[^\n\"]+\"" locs ${csv}) + foreach(str ${locs}) + string(REGEX REPLACE "(E|S|U),\"([^\n\"]+)\"" "QT_TRANSLATE_NOOP(\"credits\", \"\\2\")" s ${str}) + list(APPEND csvlocs ${s}) + endforeach(str) +endforeach(csvfile) + +list(REMOVE_DUPLICATES csvlocs) +list(GET csvlocs 0 firstline) +list(REMOVE_AT csvlocs 0) +set(locsout "const char * creditsMessages[] = {") +foreach(l ${csvlocs}) + list(APPEND locsout ${l} ",") +endforeach(l) +list(APPEND locsout ${firstline} "\n}\\;\n") +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/creditsmessages.h ${locsout}) + + include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/model)
--- a/QTfrontend/hedgewars.qrc Thu Dec 13 12:12:40 2018 -0500 +++ b/QTfrontend/hedgewars.qrc Thu Dec 13 21:35:26 2018 +0100 @@ -206,7 +206,7 @@ <file>res/chat/lamp_off.png</file> <file>res/chat/ingame.png</file> <file>res/splash.png</file> - <file>res/html/about.html</file> + <file>res/credits.csv</file> <file>res/chat/hedgehogcontributor.png</file> <file>res/chat/hedgehogcontributor_gray.png</file> <file>res/chat/roomadmincontributor.png</file>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QTfrontend/res/credits.csv Thu Dec 13 21:35:26 2018 +0100 @@ -0,0 +1,141 @@ +S,"Project founder",, +E,,"Andrey Korotaev","unC0Rr@gmail.com" +S,"Programming",, +U,"Game engine",, +E,"Creator","Andrey Korotaev","unC0Rr@gmail.com" +E,"Many engine improvements","Derek Pomery","nemo@m8y.org" +E,"Many engine improvements","Carlos Vives","mail@carlosvives.es" +E,"Many engine improvements","Richard Karolyi","sheepluva@ercatec.net" +E,,"Wuzzy","Wuzzy2@mail.ru" +E,,"Henrik Rostedt","henrik.rostedt@gmail.com" +E,"Gamepad and Lua integration","Mario Liebisch","mario.liebisch@gmail.com" +E,"Campaign support","Szabolcs Orbàn","szabibibi@gmail.com" +E,"Theme customization improvements","KoBeWi", +E,"Some Pas2C and GLES2 work","Meng Xiangyun","xymengxy@gmail.com" +E,"Video recording","Stepan Podoskin","stepik-777@mail.ru" +E,"Other improvements","Valentin Kraevskiy", +U,"Map generation",, +E,"Core map generators","Andrey Korotaev","unC0Rr@gmail.com" +E,"Perlin maps and other improvements","Derek Pomery","nemo@m8y.org" +E,"Maze maps","Henning Kühn","prg@cooco.de" +U,"Weapons",, +E,"Most core weapons","Andrey Korotaev","unC0Rr@gmail.com" +E,"Air mine, rubber, others","Derek Pomery","nemo@m8y.org" +E,"Drill rocket, ballgun, RC plane","Martin Boze","afffect@gmail.com" +E,"Freezer","Julia Struchenko","urbertar@gmail.com" +E,"Mine number and time game settings","David A. Cuadrado","krawek@gmail.com" +M,,, +U,"Frontend / main menu",, +E,"Creator","Andrey Korotaev","unC0Rr@gmail.com" +E,"Many frontend improvements","Derek Pomery","nemo@m8y.org" +E,"Many frontend improvements","Richard Karolyi","sheepluva@ercatec.net" +E,"Many frontend improvements","Igor Ulyanov","disinbox@gmail.com" +E,"Keybinds, feedback, maps and hats interfaces","Drew Gottlieb","gottlieb.drew@gmail.com" +E,"Login dialogs, other improvements","Ondrej Skopek","skopekondrej@gmail.com" +E,,"Wuzzy","Wuzzy2@mail.ru" +E,,"Martin Minarik","ttsmj@pokec.sk" +E,,"Kristian Lehmann","email@thexception.net" +E,,"Henrik Rostedt","henrik.rostedt@gmail.com" +E,,"Mayur Pawashe","zorgiepoo@gmail.com" +E,,"Valentin Kraevskiy", +U,"Missions and styles",, +E,"A Classic Fairytale","Szabolcs Orbàn","szabibibi@gmail.com" +E,"A Space Adventure","Master_ex", +E,"Capture the Flag, Construction Mode, Continental supplies, HedgeEditor, Highlander, Racer, TechRacer, The Specialists, WxW","mikade", +E,"Training, time-trial and target practice challenges, Bazooka Battlefield, Tentacle Terror, Big Armory, bugfixes and maintenance","Wuzzy","Wuzzy2@mail.ru" +E,"Some styles and missions","John Lambert","redgrinner@gmail.com" +E,"Battalion","Anachron","Anachron14@gmx.de" +E,"Continental supplies","Vatten", +E,"Teamwork 2","Arkhnen", +M,,, +U,"Game server",, +E,"Creator","Andrey Korotaev","unC0Rr@gmail.com" +M,,, +U,"Ports",, +E,"macOS/iPhone port, OpenGL-ES conversion","Vittorio Giovara","vittorio.giovara@gmail.com" +E,"Android port","Richard Deurwaarder","xeli@xelification.com" +E,"Android netplay, portability abstraction","Simeon Maxein","smaxein@googlemail.com" +E,"WebGL port","Meng Xiangyun","xymengxy@gmail.com" +E,"iPhone/iPad ports","Anton Malmygin","antonc27@mail.ru" +S,"Graphics",, +U,"General",, +E,,"John Dum","fizzy@gmail.com" +E,,"Joshua Frese","joshfrese@gmail.com" +E,,"Stanko Tadić","stanko@mfhinc.net" +E,,"Julien Koesten","julienkoesten@aol.com" +E,,"Joshua O'Sullivan","coheedftw@hotmail.co.uk" +E,,"Nils Lück","nils.luck.design@gmail.com" +E,,"Guillaume Englert","genglert@hybird.org" +E,,"CopherNeue","ppicondo.cvac@gmail.com" +E,,"Valentin Kraevskiy", +E,,"Carlos Vives","mail@carlosvives.es" +U,"Hats",, +E,,"Trey Perry","perry.j@gmail.com", +M,,, +S,"Sounds",, +E,"Hedgehogs voice","Stephen Alexander","ArmagonNo1@gmail.com" +E,,"John Dum","fizzy@gmail.com" +E,,"Jonatan Nilsson","jonatanfan@gmail.com" +E,,"Daniel Martin","elhombresinremedio@gmail.com" +M,,, +S,"Music",, +E,"City","HSR <http://elhombresinremedio.com>", +E,"Compost","HG" +E,"EarthRise","Jonatan Nilsson", +E,"Fruit","Valentin Kraevskiy", +E,"Jungle","Valentin Kraevskiy", +E,"Nature","John Dum", +E,"Pirate","Jonatan Nilsson", +E,"Rock","HSR <http://elhombresinremedio.com>", +E,"olympics_sd","yd <http://opengameart.org/users/yd>", +E,"oriental","Jonatan Nilsson", +E,"sdmusic (Hitman [sheepluva edit])","Kevin MacLeod", +E,"snow","Jonatan Nilsson", +M,,, +S,"Translations",, +E,"Brazilian Portuguese","Romulo Fernandes Machado","abra185@gmail.com" +E,"Bulgarian","Svetoslav Stefanov", +E,"Czech","Petr Řezáček","rezacek@gmail.com" +E,"Chinese","Jie Luo","lililjlj@gmail.com" +E,"Finnish","Nina Kuisma","ninnnu@gmail.com" +E,"Finnish","Janne Uusitupa", +E,"French","Antoine Turmel","geekshadow@gmail.com" +E,"French","Clement Woitrain","sphrixclement@gmail.com" +E,"French","Matisumi", +E,"French","Case_Of", +E,"German","Peter Hüwe","PeterHuewe@gmx.de" +E,"German","Mario Liebisch","mario.liebisch@gmail.com" +E,"German","Richard Karolyi","sheepluva@ercatec.net" +E,"German","Wuzzy","Wuzzy2@mail.ru" +E,"Greek",,"talos_kriti@yahoo.gr" +E,"Italian","Luca Bonora","bonora.luca@gmail.com" +E,"Italian","Marco Bresciani","m.bresciani@email.it" +E,"Italian","Gianfranco Costamagna","costamagnagianfranco@yahoo.it" +E,"Italian","Enrico","enricobe@hotmail.com" +E,"Japanese","ADAM Etienne","etienne.adam@gmail.com" +E,"Japanese","Marco Bresciani","m.bresciani@email.it" +E,"Korean","Anthony Bellew","anthonyreflected@gmail.com" +E,"Lithuanian","Lukas Urbonas","lukasu08@gmail.com" +E,"Polish","Maciej Mroziński","mynick2@o2.pl" +E,"Polish","Wojciech Latkowski","magik17l@gmail.com" +E,"Polish","Piotr Mitana", +E,"Polish","Maciej Górny", +E,"Polish","KoBeWi", +E,"Portuguese","Fábio Canário","inufabie@gmail.com" +E,"Russian","Andrey Korotaev","unC0Rr@gmail.com" +E,"Russian","Vitaly Novichkov","admin@wohlnet.ru" +E,"Russian","Anton Malmygina","antonc27@mail.ru" +E,"Russian","Grigory Ustinov","grenka@altlinux.org" +E,"Scottish Gaelic","GunChleoc", +E,"Slovak","Jose Riha", +E,"Spanish","Carlos Vives","mail@carlosvives.es" +E,"Swedish","Niklas Grahn","raewolusjoon@yaoo.com" +E,"Swedish","Henrik Rostedt","henrik.rostedt@gmail.com" +E,"Ukrainian","Eugene V. Lyubimkin","jackyf.devel@gmail.com" +E,"Ukrainian","Igor Paliychuk","mansonigor@gmail.com" +E,"Ukrainian","Eugene Sakara","eresid@gmail.com" +S,"Special thanks",, +E,,"Aleksey Andreev","blaknayabr@gmail.com", +E,,"Aleksander Rudalev","alexv@pomorsu.ru", +E,,"Natasha Korotaeva","layout@pisem.net", +E,,"Adam Higerd (alias ahigerd)",
--- a/QTfrontend/res/html/about.html Thu Dec 13 12:12:40 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -<!DOCTYPE HTML> -<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> -<head> -<title>Hedgewars - Authors</title> -<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> -<style type="text/css"> - body { color: orange; } - a { color: #ffe270; } - a:hover { color: yellow; } -</style> -</head> -<body> - <h2>Developers:</h2> - <p> - Engine, frontend, net server: Andrey Korotaev <<a href="mailto:unC0Rr@gmail.com">unC0Rr@gmail.com</a>><br /> - Many frontend improvements: Igor Ulyanov <<a href="mailto:disinbox@gmail.com">disinbox@gmail.com</a>><br /> - Many engine and frontend improvements: Derek Pomery <<a href="mailto:nemo@m8y.org">nemo@m8y.org</a>><br /> - Drill rocket, Ballgun, RC Plane weapons: Martin Boze <<a href="mailto:afffect@gmail.com">afffect@gmail.com</a>><br /> - Mine number and time game settings: David A. Cuadrado <<a href="mailto:krawek@gmail.com">krawek@gmail.com</a>><br /> - Frontend improvements: Martin Minarik <<a href="mailto:ttsmj@pokec.sk">ttsmj@pokec.sk</a>><br /> - Frontend improvements: Kristian Lehmann <<a href="mailto:email@thexception.net">email@thexception.net</a>><br /> - Mac OS X/iPhone port, OpenGL-ES conversion: Vittorio Giovara <<a href="mailto:vittorio.giovara@gmail.com">vittorio.giovara@gmail.com</a>><br /> - Many engine and frontend improvements (and bugs): Richard Karolyi <<a href="mailto:sheepluva@ercatec.net">sheepluva@ercatec.net</a>><br /> - Gamepad and Lua integration: Mario Liebisch <<a href="mailto:mario.liebisch@gmail.com">mario.liebisch@gmail.com</a>><br /> - Many engine improvements and graphics: Carlos Vives <<a href="mailto:mail@carlosvives.es">mail@carlosvives.es</a>><br /> - Maze maps: Henning Kühn <<a href="mailto:prg@cooco.de">prg@cooco.de</a>><br /> - Engine and frontend improvements: Henrik Rostedt <<a href="mailto:henrik.rostedt@gmail.com">henrik.rostedt@gmail.com</a>><br /> - Lua game modes and missions: John Lambert <<a href="mailto:redgrinner@gmail.com">redgrinner@gmail.com</a>><br /> - Frontend improvements: Mayur Pawashe <<a href="mailto:zorgiepoo@gmail.com">zorgiepoo@gmail.com</a>><br /> - Android port: Richard Deurwaarder <<a href="mailto:xeli@xelification.com">xeli@xelification.com</a>><br /> - Android netplay, portability abstraction: Simeon Maxein <<a href="mailto:smaxein@googlemail.com">smaxein@googlemail.com</a>><br /> - WebGL port, some pas2c and GLES2 work: Meng Xiangyun <<a href="mailto:xymengxy@gmail.com">xymengxy@gmail.com</a>><br /> - Video recording: Stepan Podoskin <<a href="mailto:stepik-777@mail.ru">stepik-777@mail.ru</a>><br /> - Campaign support, first campaign: Szabolcs Orbàn <<a href="mailto:szabibibi@gmail.com">szabibibi@gmail.com</a>><br /> - Keybinds, feedback, maps and hats interfaces: Drew Gottlieb <<a href="mailto:gottlieb.drew@gmail.com">gottlieb.drew@gmail.com</a>><br /> - Login dialogs, frontend improvements: Ondrej Skopek <<a href="mailto:skopekondrej@gmail.com">skopekondrej@gmail.com</a>><br /> - Icegun weapon: Julia Struchenko <<a href="mailto:urbertar@gmail.com">urbertar@gmail.com</a>><br /> - iPhone/iPad ports: Anton Malmygin <<a href="mailto:antonc27@mail.ru">antonc27@mail.ru</a>><br /> - Battalion style: Anachron <<a href="mailto:Anachron14@gmx.de">Anachron14@gmx.de</a>><br /> - Scripting, engine, frontend improvements, some missions: Wuzzy <<a href="mailto:Wuzzy2@mail.ru">Wuzzy2@mail.ru</a>><br /> - Theme customization improvements: KoBeWi<br /> - Theme music, engine and frontend improvements, graphics: Valentin Kraevskiy <!--<<a href="mailto:foo@bar.com">foo@bar.com</a>>--><br /> - </p> - - <h2>Art:</h2> - <p>John Dum <<a href="mailto:fizzy@gmail.com">fizzy@gmail.com</a>> - <br /> - Joshua Frese <<a href="mailto:joshfrese@gmail.com">joshfrese@gmail.com</a>> - <br /> - Stanko Tadić <<a href="mailto:stanko@mfhinc.net">stanko@mfhinc.net</a>> - <br /> - Julien Koesten <<a href="mailto:julienkoesten@aol.com">julienkoesten@aol.com</a>> - <br /> - Joshua O'Sullivan <<a href="mailto:coheedftw@hotmail.co.uk">coheedftw@hotmail.co.uk</a>> - <br /> - Nils Lück <<a href="mailto:nils.luck.design@gmail.com">nils.luck.design@gmail.com</a>> - <br /> - Guillaume Englert <<a href="mailto:genglert@hybird.org">genglert@hybird.org</a>> - <br /> - <p>CopherNeue <<a href="mailto:ppicondo.cvac@gmail.com">ppicondo.cvac@gmail.com</a>> - <br /> - Hats: Trey Perry <<a href="mailto:tx.perry.j@gmail.com">tx.perry.j@gmail.com</a>> - </p> - - <h2>Sounds:</h2> - <p> - Hedgehogs voice: Stephen Alexander <<a href="mailto:ArmagonNo1@gmail.com">ArmagonNo1@gmail.com</a>> - <br /> - John Dum <<a href="mailto:fizzy@gmail.com">fizzy@gmail.com</a>> - <br /> - Jonatan Nilsson <<a href="mailto:jonatanfan@gmail.com">jonatanfan@gmail.com</a>> - <br /> - Daniel Martin <<a href="mailto:elhombresinremedio@gmail.com">elhombresinremedio@gmail.com</a>> - </p> - - <h2>Translations:</h2><p> - Brazilian Portuguese: Romulo Fernandes Machado <<a href="mailto:abra185@gmail.com">abra185@gmail.com</a>><br /> - Bulgarian: Svetoslav Stefanov<br /> - Czech: Petr Řezáček <<a href="mailto:rezacek@gmail.com">rezacek@gmail.com</a>><br /> - Chinese: Jie Luo <<a href="mailto:lililjlj@gmail.com">lililjlj@gmail.com</a>><br /> - English: Andrey Korotaev <<a href="mailto:unC0Rr@gmail.com">unC0Rr@gmail.com</a>><br /> - Finnish: Nina Kuisma <<a href="mailto:ninnnu@gmail.com">ninnnu@gmail.com</a>>, Janne Uusitupa<br /> - French: Antoine Turmel <<a href="mailto:geekshadow@gmail.com">geekshadow@gmail.com</a>>, Clement Woitrain <<a href="mailto:sphrixclement@gmail.com">sphrixclement@gmail.com</a>>, Matisumi, Case_Of<br /> - German: Peter Hüwe <<a href="mailto:PeterHuewe@gmx.de">PeterHuewe@gmx.de</a>>, Mario Liebisch <<a href="mailto:mario.liebisch@gmail.com">mario.liebisch@gmail.com</a>>, Richard Karolyi <<a href="mailto:sheepluva@ercatec.net">sheepluva@ercatec.net</a>>, Wuzzy <<a href="mailto:Wuzzy2@mail.ru">Wuzzy2@mail.ru</a>><br /> - Greek: <<a href="mailto:talos_kriti@yahoo.gr">talos_kriti@yahoo.gr</a>><br /> - Italian: Luca Bonora <<a href="mailto:bonora.luca@gmail.com">bonora.luca@gmail.com</a>>, Marco Bresciani <<a href="mailto:m.bresciani@email.it">m.bresciani@email.it</a>>, Gianfranco Costamagna <<a href="mailto:costamagnagianfranco@yahoo.it">costamagnagianfranco@yahoo.it</a>>, Enrico <<a href="mailto:enricobe@hotmail.com">enricobe@hotmail.com</a>><br /> - Japanese: ADAM Etienne <<a href="mailto:etienne.adam@gmail.com">etienne.adam@gmail.com</a>>, Marco Bresciani <<a href="mailto:m.bresciani@email.it">m.bresciani@email.it</a>><br /> - Korean: Anthony Bellew <<a href="mailto:anthonyreflected@gmail.com">anthonyreflected@gmail.com</a>><br /> - Lithuanian: Lukas Urbonas <<a href="mailto:lukasu08@gmail.com">lukasu08@gmail.com</a>><br /> - Polish: Maciej Mroziński <<a href="mailto:mynick2@o2.pl">mynick2@o2.pl</a>>, Wojciech Latkowski <<a href="mailto:magik17l@gmail.com">magik17l@gmail.com</a>>, Piotr Mitana, Maciej Górny, KoBeWi<br /> - Portuguese: Fábio Canário <<a href="mailto:inufabie@gmail.com">inufabie@gmail.com</a>><br /> - Russian: Andrey Korotaev <<a href="mailto:unC0Rr@gmail.com">unC0Rr@gmail.com</a>>, Vitaly Novichkov <<a href="mailto:admin@wohlnet.ru">admin@wohlnet.ru</a>>, Anton Malmygin <<a href="mailto:antonc27@mail.ru">antonc27@mail.ru</a>>, greno4ka, Grigory Ustinov <<a href="mailto:grenka@altlinux.org">grenka@altlinux.org</a>><br /> - Scottish Gaelic: GunChleoc<br /> - Slovak: Jose Riha<br /> - Spanish: Carlos Vives <<a href="mailto:mail@carlosvives.es">mail@carlosvives.es</a>><br /> - Swedish: Niklas Grahn <<a href="mailto:raewolusjoon@yaoo.com">raewolusjoon@yaoo.com</a>>, Henrik Rostedt <<a href="mailto:henrik.rostedt@gmail.com">henrik.rostedt@gmail.com</a>><br /> - Ukrainian: Eugene V. Lyubimkin <<a href="mailto:jackyf.devel@gmail.com">jackyf.devel@gmail.com</a>>, Igor Paliychuk <<a href="mailto:mansonigor@gmail.com">mansonigor@gmail.com</a>>, Eugene Sakara <<a href="mailto:eresid@gmail.com">eresid@gmail.com</a>> - </p> - - <h2>Special thanks:</h2><p> - Aleksey Andreev <<a href="mailto:blaknayabr@gmail.com">blaknayabr@gmail.com</a>><br /> - Aleksander Rudalev <<a href="mailto:alexv@pomorsu.ru">alexv@pomorsu.ru</a>><br /> - Natasha Korotaeva <<a href="mailto:layout@pisem.net">layout@pisem.net</a>><br /> - Adam Higerd (aka ahigerd at FreeNode) - </p> -</body> -</html>
--- a/QTfrontend/ui/widget/about.cpp Thu Dec 13 12:12:40 2018 -0500 +++ b/QTfrontend/ui/widget/about.cpp Thu Dec 13 21:35:26 2018 +0100 @@ -32,6 +32,8 @@ #include "SDL.h" #include "SDL_version.h" #include "physfs.h" +#include "creditsmessages.h" +#include "HWApplication.h" #ifdef VIDEOREC extern "C" @@ -53,6 +55,174 @@ #include "about.h" +QString About::getCreditsHtml() +{ + // Open the credits file + + /* *** FILE FORMAT OF CREDITS FILE *** + The credits file is an RFC-4180-compliant CSV file with 4 columns. + The first column (column 1) is always 1 letter long and is the row type. + The row type determines the meaning of the other columns. + + The following row types are supported: + + * E: Credits entry + * Column 2: Task/contribution + * Column 3: Contributor name + * Column 4: Contributor e-mail + * M: Alternative credits entry that is a placeholder for other or unknown authors + * Columns 2-4: Unused + * S: Section + * Column 2: Section name + * Columns 3-4: Unused + * U: Subsection + * Column 2: Subsection name + * Columns 3-4: Unused + + Column 2 MUST be in US-ASCII. + */ + QFile creditsFile(":/res/credits.csv"); + if (!creditsFile.open(QIODevice::ReadOnly)) + { + qWarning("ERROR: Credits file could not be opened!"); + return "<p>ERROR: Credits file could not be opened!</p>"; + } + QString creditsString = creditsFile.readAll(); + QString out = QString("<h1>" + tr("Credits") + "</h1>\n"); + QStringList cells = QStringList() << QString("") << QString("") << QString("") << QString(""); + bool firstSection = true; + unsigned long int column = 0; + unsigned long int charInCell = 0; + bool isInQuote = false; + bool ignoreChar = false; + bool lineComplete = false; + QChar currChar; + QChar prevChar; + for(long long int i = 0; i<creditsString.length(); i++) + { + currChar = creditsString.at(i); + QString type, task, name, mail; + if(currChar == '"') + { + if(charInCell == 0) + { + isInQuote = true; + ignoreChar = true; + } + else if(isInQuote && prevChar != '"') + { + ignoreChar = true; + } + } + else if(isInQuote && charInCell > 0 && prevChar == '"' && (currChar == '\r' || currChar == ',')) + { + isInQuote = false; + ignoreChar = true; + } + + charInCell++; + if(!isInQuote && currChar == ',') + { + column++; + charInCell = 0; + } + else if(!isInQuote && currChar == '\n' && prevChar == '\r') + { + lineComplete = true; + } + if(!isInQuote && (currChar == '\r' || currChar == '\n' || currChar == ',')) + { + ignoreChar = true; + } + + + if(!ignoreChar) + { + cells[column].append(currChar); + } + ignoreChar = false; + + if(lineComplete) + { + type = cells[0]; + task = cells[1]; + name = cells[2]; + mail = cells[3]; + + if(type == "S") + { + // section + if (!firstSection) + out = out + "</ul>\n"; + out = out + "<h2>" + HWApplication::translate("credits", task.toLatin1().constData()) + "</h2>\n<ul>\n"; + firstSection = false; + } + else if(type == "U") + { + // subsection + out = out + "</ul>\n"; + out = out + "<h3>" + HWApplication::translate("credits", task.toLatin1().constData()) + "</h3>\n<ul>\n"; + } + else if(type == "M") + { + // other people + out = out + "<li>" + tr("Other people") + "</li>" + "\n"; + } + else if(type == "E") + { + // credits list entry + QString mailLink = QString("<a href=\"mailto:%1\">%1</a>").arg(mail); + if(task.isEmpty() && mail.isEmpty()) + { + // Name only + out = out + "<li>" + name + "</li>\n"; + } + else if(task.isEmpty()) + { + // Name and e-mail + //: Part of credits. %1: Contribution name. %2: E-mail address + out = out + "<li>" + tr("%1 <%2>").arg(name).arg(mailLink) + "</li>\n"; + } + else if(mail.isEmpty()) + { + // Contribution and name + //: Part of credits. %1: Description of contribution. %2: Contributor name + out = out + "<li>" + tr("%1: %2") + .arg(HWApplication::translate("credits", task.toLatin1().constData())) + .arg(name) + + "</li>\n"; + } + else + { + // Contribution, name and e-mail + //: Part of credits. %1: Description of contribution. %2: Contributor name. %3: E-mail address + out = out + "<li>" + tr("%1: %2 <%3>") + .arg(HWApplication::translate("credits", task.toLatin1().constData())) + .arg(name) + .arg(mailLink) + + "</li>\n"; + } + } + else + { + qWarning("Invalid row type in credits.csv: %s", qPrintable(type)); + } + lineComplete = false; + column = 0; + cells[0] = ""; + cells[1] = ""; + cells[2] = ""; + cells[3] = ""; + charInCell = 0; + } + + prevChar = currChar; + } + creditsFile.close(); + out = out + "</ul>"; + return out; +} + About::About(QWidget * parent) : QWidget(parent) { @@ -89,11 +259,34 @@ lbl1->setWordWrap(true); mainLayout->addWidget(lbl1, 0, 1); - lbl2 = new QTextBrowser(this); - lbl2->setOpenExternalLinks(true); - QUrl localpage = QUrl::fromLocalFile(":/res/html/about.html"); - lbl2->setSource(localpage); //sets the source of the label from the file above - mainLayout->addWidget(lbl2, 1, 1); + /* Credits */ + creditsBrowser = new QTextBrowser(this); + creditsBrowser->setOpenExternalLinks(true); + QString credits = getCreditsHtml(); + + QString header = + "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">" + "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">" + "<head>" + "<title>Hedgewars Credits</title>" + "<meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\" />" + "<style type=\"text/css\">" + " body { color: orange; }" + " a { color: #ffe270; }" + " a:hover { color: yellow; }" + " ul { list-style-type: none; }" + "</style>" + "</head>" + "<body>" + ""; + QString footer = + "" + "<h2>" + tr("Extended Credits") + "</h2>" + "<p>" + tr("An extended credits list can be found in the CREDITS text file.") + "</p>" + "</body></html>"; + + creditsBrowser->setHtml(header + credits + footer); + mainLayout->addWidget(creditsBrowser, 1, 1); /* Library information */
--- a/QTfrontend/ui/widget/about.h Thu Dec 13 12:12:40 2018 -0500 +++ b/QTfrontend/ui/widget/about.h Thu Dec 13 21:35:26 2018 +0100 @@ -35,7 +35,8 @@ virtual void dropEvent(QDropEvent * event); private: - QTextBrowser * lbl2; + QString getCreditsHtml(); + QTextBrowser * creditsBrowser; }; #endif // _ABOUT_H
--- a/share/hedgewars/Data/Music/credits.txt Thu Dec 13 12:12:40 2018 -0500 +++ b/share/hedgewars/Data/Music/credits.txt Thu Dec 13 21:35:26 2018 +0100 @@ -1,12 +1,12 @@ -City.ogg=HSR ( http://elhombresinremedio.com ) +City.ogg=HSR <http://elhombresinremedio.com> Compost.ogg=HG EarthRise.ogg=Jonatan Nilsson Fruit.ogg=Valentin Kraevskiy Jungle.ogg=Valentin Kraevskiy Nature.ogg=John Dum Pirate.ogg=Jonatan Nilsson -Rock.ogg=HSR ( http://elhombresinremedio.com ) -olympics_sd.ogg=yd ( http://opengameart.org/users/yd ) +Rock.ogg=HSR <http://elhombresinremedio.com> +olympics_sd.ogg=yd <http://opengameart.org/users/yd> oriental.ogg=Jonatan Nilsson sdmusic.ogg=Kevin MacLeod - "Hitman" [sheepluva edit] snow.ogg=Jonatan Nilsson