Skip to content

Commit

Permalink
Merge pull request #13 from dbkblk/devel
Browse files Browse the repository at this point in the history
1.02 merge
  • Loading branch information
dbkblk committed Dec 16, 2014
2 parents 8a3fdfe + 1d04a1d commit 0c000bf
Show file tree
Hide file tree
Showing 29 changed files with 1,399 additions and 408 deletions.
15 changes: 12 additions & 3 deletions checker/TODO.md
Expand Up @@ -89,12 +89,21 @@ DONE -> Check the first time installer
DONE -> Improved updater progress

## 1.01
- Updater: Create a "updating" file at start then delete it at the end. The launcher should check if the file is present, and then relaunch the updater again.
DONE -> Updater: Create a "updating" file at start then delete it at the end. The launcher should check if the file is present, and then relaunch the updater again.

## 1.02
DONE -> Force installer to make a folder named "Rise of Mankind - A New Dawn" and to decompress into "Mods/" folder + Check the folder name at start
DONE -> Possibility to use the default color (!?)
DONE -> GUI to exclude files
DONE -> Drop support for Sinhala (unmaintened and less than 1% translated)
DONE -> Add a function to reset the mod in the default state

## Pending
? - Fix the weird updating loop !?

## 1.1
- GUI to exclude files
- Add support for exclusions for mods files
- Reimplement addon installer
- Calculate a mean remaining time / speed during the update

# Notes
## Dev tools
Expand Down
9 changes: 6 additions & 3 deletions checker/and2_checker.pro
Expand Up @@ -19,22 +19,25 @@ SOURCES += \
w_main.cpp \
w_modules.cpp \
w_options.cpp \
w_install.cpp
w_install.cpp \
w_exclusion.cpp

HEADERS += \
f_check.h \
f_civ.h \
w_main.h \
w_modules.h \
w_options.h \
w_install.h
w_install.h \
w_exclusion.h

FORMS += \
updatebox.ui \
w_main.ui \
w_modules.ui \
w_options.ui \
w_install.ui
w_install.ui \
w_exclusion.ui

RC_FILE = icon.rc

Expand Down
16 changes: 16 additions & 0 deletions checker/f_check.cpp
Expand Up @@ -119,6 +119,22 @@ bool f_check::ActionUpdate()
return 0;
}

bool f_check::ActionReset()
{
#ifdef _WIN32
QProcess update;
update.startDetached("upd_proc.exe reset");
QApplication::quit();
#endif
#ifdef __linux
QProcess update;
update.startDetached("upd_proc reset");
QApplication::quit();
#endif

return 0;
}

int f_check::GetLocalVersion()
{
//** Get version number from "Assets/Python/Contrib/CvModName.py"
Expand Down
1 change: 1 addition & 0 deletions checker/f_check.h
Expand Up @@ -28,6 +28,7 @@ class f_check : public QObject
bool ActionLauncherUpdate();
bool PrepareUpdate();
bool ActionUpdate();
bool ActionReset();
int GetLocalVersion();
int GetDistantVersion();
QString ExtractChangelog(QString filepath);
Expand Down
17 changes: 9 additions & 8 deletions checker/f_civ.cpp
Expand Up @@ -112,7 +112,7 @@ int readColorsCounter()
QDomElement value_el = read.firstChildElement("Civ4ModularLoadControls").firstChildElement("ConfigurationInfos").firstChildElement("ConfigurationInfo").firstChildElement("Modules").firstChildElement("Module").toElement();

// Loop
int counter = -1;
int counter = 0;
for(;; value_el=value_el.nextSiblingElement() ) {

QString bLoad = value_el.firstChildElement("bLoad").text();
Expand Down Expand Up @@ -152,18 +152,19 @@ bool setColors(QString color)
// Reset all values
for(color_element ; !color_element.isNull(); color_element=color_element.nextSiblingElement() ) {
color_element.firstChildElement("bLoad").firstChild().setNodeValue("0");
}
}

color_element = read.firstChildElement("Civ4ModularLoadControls").firstChildElement("ConfigurationInfos").firstChildElement("ConfigurationInfo").firstChildElement("Modules").firstChildElement("Module").toElement();
if(color != "default"){
color_element = read.firstChildElement("Civ4ModularLoadControls").firstChildElement("ConfigurationInfos").firstChildElement("ConfigurationInfo").firstChildElement("Modules").firstChildElement("Module").toElement();

for(color_element ; !color_element.isNull(); color_element=color_element.nextSiblingElement() ) {
QString txtValue = color_element.firstChildElement("Directory").firstChild().nodeValue();
if (txtValue == color) {
color_element.firstChildElement("bLoad").firstChild().setNodeValue("1");
for(color_element ; !color_element.isNull(); color_element=color_element.nextSiblingElement() ) {
QString txtValue = color_element.firstChildElement("Directory").firstChild().nodeValue();
if (txtValue == color) {
color_element.firstChildElement("bLoad").firstChild().setNodeValue("1");
}
}
}


// Save content back to the file
if (!file.open(QIODevice::Truncate | QIODevice::WriteOnly)) {
return 0;
Expand Down
3 changes: 3 additions & 0 deletions checker/lang/installer_es.xml
Expand Up @@ -2,6 +2,9 @@
<resources>
<string name="WELCOME_TITLE">Civilización IV: A New Dawn pack de expansión</string>
<string name="REQUIRED">necesario</string>
<string name="WELCOME">Versión del lanzador: ${VERSION}\n\nEste asistente le guiará a través de la instalación de Civilization IV: A New Dawn.\n\nEl mod se instalará en \'Mis documentos\My Games\Beyond the Sword\Mods\' de forma predeterminada.\nCreará un acceso directo (opcional) al lanzador mod, que se utilizará para descargar fácilmente, actualizar o configurar la mod instalación.\n\nADVERTENCIA: Cualquier instalación existente del mod es compatible. Sin embargo, si tienes archivos modificadas, puede sobrescribirse sobre actualización del mod.</string>
<string name="DIRECTORY">Programa de instalación instalará el paquete de expansión en la siguiente carpeta.
Para instalarlo en una carpeta diferente, haga clic en \'Examinar...\' y seleccione otra carpeta.$\n$\nNOTA: se recomienda encarecidamente utilizar la carpeta predeterminada seleccionada por debajo. Sin embargo, puede instalar el mod directamente en la carpeta del juego (\'Sid Meier\'s Civilization IV Beyond the Sword\Beyond the Sword\Mods\').</string>
<string name="FINISH">El lanzador está instalado. En el primer lanzamiento, detectará si el mod está presente en el directorio. Si no es así, sólo sigue el procedimiento de instalación.</string>
<string name="RUN">Iniciar el lanzador mod</string>
<string name="SHORTCUT">Crear acceso directo del escritorio</string>
Expand Down
2 changes: 2 additions & 0 deletions checker/lang/installer_fr.xml
Expand Up @@ -2,6 +2,8 @@
<resources>
<string name="WELCOME_TITLE">Civilization IV: A New Dawn pack d\'expansion</string>
<string name="REQUIRED">requis</string>
<string name="WELCOME">Version du lanceur: ${VERSION}\n\nCet assistant d\'installation va vous guider pour l\'installation de Civilization IV: A New Dawn.\n\nLe mod sera installé dans \'My Documents\My Games\Beyond the Sword\Mods\' par défaut. \nIl va créer un raccourci (option) vers le lanceur, qui sera utilisé pour télécharger, mettre à jour ou configurer l\'installation du mod.\n\nATTENTION : Si le mod est déjà installé, le lanceur pourrait remplacer certains de vos fichiers pendant les mises à jour.</string>
<string name="DIRECTORY">L\'installateur va installer le pack d\'expansion dans le dossier suivant.$\nPour l\'installer dans un dossier différent, cliquez sur \'Parcourir...\' et sélectionnez un autre dossier.$\n$\nNOTE: Il est hautement recommandé d\'utiliser le dossier par défaut sélectionné ci-dessous. Cependant, vous pouvez choisir d\'installer le mod directement dans le dossier du jeu (\'Sid Meier\'s Civilization IV Beyond the Sword\Beyond the Sword\Mods\').</string>
<string name="FINISH">Le lanceur est maintenant installé. Au premier lancement, il va essayer de détecter si le mod est présent dans le répertoire. Si ce n\'est pas le cas, il suffit de suivre la procédure d\'installation.</string>
<string name="RUN">Démarrer le lanceur</string>
<string name="SHORTCUT">Créer un raccourci sur le bureau</string>
Expand Down
93 changes: 68 additions & 25 deletions checker/lang/launcher.ts
Expand Up @@ -9,7 +9,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main.cpp" line="91"/>
<location filename="../main.cpp" line="92"/>
<source>There seems to be a problem with the previous update. Checking file again.</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -50,6 +50,19 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>w_exclusion</name>
<message>
<location filename="../w_exclusion.ui" line="32"/>
<source>Choose which files to exclude from update</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_exclusion.ui" line="67"/>
<source>File</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>w_install</name>
<message>
Expand Down Expand Up @@ -101,22 +114,22 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_main.ui" line="241"/>
<location filename="../w_main.ui" line="242"/>
<source>Community</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_main.ui" line="245"/>
<location filename="../w_main.ui" line="246"/>
<source>Addons</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_main.ui" line="258"/>
<location filename="../w_main.ui" line="259"/>
<source>Help us to improve the mod !</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_main.ui" line="266"/>
<location filename="../w_main.ui" line="267"/>
<source>Language</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -257,30 +270,50 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_main.cpp" line="142"/>
<location filename="../w_main.ui" line="463"/>
<source>Reset mod to default state</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_main.cpp" line="141"/>
<source>Check for update</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_main.cpp" line="152"/>
<location filename="../w_main.cpp" line="151"/>
<source>Update available !</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_main.cpp" line="221"/>
<location filename="../w_main.cpp" line="220"/>
<source>To be able to launch the game from the launcher, you need to set the game path in the options window. (Options &gt; Select game path)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_main.cpp" line="373"/>
<location filename="../w_main.cpp" line="362"/>
<source>Cache</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_main.cpp" line="373"/>
<location filename="../w_main.cpp" line="362"/>
<source>The cache is now cleared. NOTE: It is already automatically cleared on update.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_main.cpp" line="369"/>
<source>Reset mod</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_main.cpp" line="370"/>
<source>This will reset the mod to the default state. Any modification or launcher preferences will be removed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_main.cpp" line="371"/>
<source>Are you sure to continue ?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>w_modules</name>
Expand Down Expand Up @@ -329,81 +362,91 @@
</message>
<message>
<location filename="../w_options.ui" line="111"/>
<source>Black</source>
<source>Dark blue (default)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_options.ui" line="116"/>
<source>Coal</source>
<source>Black</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_options.ui" line="121"/>
<source>Dark red</source>
<source>Coal</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_options.ui" line="126"/>
<source>Forest</source>
<source>Dark red</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_options.ui" line="131"/>
<source>Purple</source>
<source>Forest</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_options.ui" line="136"/>
<source>Red</source>
<source>Purple</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_options.ui" line="141"/>
<source>Silver</source>
<source>Red</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_options.ui" line="146"/>
<source>Silver</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_options.ui" line="151"/>
<source>Cerulean</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_options.ui" line="158"/>
<location filename="../w_options.ui" line="163"/>
<source>Game path:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_options.ui" line="183"/>
<location filename="../w_options.ui" line="188"/>
<source>Select game path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_options.ui" line="217"/>
<location filename="../w_options.ui" line="222"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt; font-weight:600;&quot;&gt;Launcher configuration :&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_options.ui" line="224"/>
<location filename="../w_options.ui" line="229"/>
<source>Close the launcher when game start</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_options.ui" line="231"/>
<location filename="../w_options.ui" line="236"/>
<source>Autostart the mod with the game</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_options.cpp" line="40"/>
<location filename="../w_options.ui" line="243"/>
<source>Exclude files from update</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_options.cpp" line="41"/>
<source>No path specified</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_options.cpp" line="120"/>
<location filename="../w_options.cpp" line="125"/>
<source>The game path has been changed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../w_options.cpp" line="124"/>
<location filename="../w_options.cpp" line="129"/>
<source>No game path specified.</source>
<translation type="unfinished"></translation>
</message>
Expand Down

0 comments on commit 0c000bf

Please sign in to comment.