[Scummvm-git-logs] scummvm master -> 4f762e096cb2ddaec940a1d0ac81b4e9a6269119
lotharsm
noreply at scummvm.org
Sun Jul 10 12:18:33 UTC 2022
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
81f4c56e36 GUI: Add option to reset icons cache for grid view
4f762e096c NEWS: Mention CGA/CGA Composite/Hercules support for SCUMM1 in German NEWS
Commit: 81f4c56e36f0f4db2a50f9cf668bdfae705af7ae
https://github.com/scummvm/scummvm/commit/81f4c56e36f0f4db2a50f9cf668bdfae705af7ae
Author: Lothar Serra Mari (mail at serra.me)
Date: 2022-07-10T14:14:59+02:00
Commit Message:
GUI: Add option to reset icons cache for grid view
Changed paths:
gui/downloadiconsdialog.cpp
gui/downloadiconsdialog.h
gui/themes/common/highres_layout.stx
gui/themes/common/lowres_layout.stx
gui/themes/default.inc
gui/themes/residualvm.zip
gui/themes/scummclassic.zip
gui/themes/scummclassic/classic_layout.stx
gui/themes/scummclassic/classic_layout_lowres.stx
gui/themes/scummmodern.zip
gui/themes/scummremastered.zip
diff --git a/gui/downloadiconsdialog.cpp b/gui/downloadiconsdialog.cpp
index b3d164a39d4..ec311e86e1a 100644
--- a/gui/downloadiconsdialog.cpp
+++ b/gui/downloadiconsdialog.cpp
@@ -42,7 +42,8 @@ namespace GUI {
enum {
kDownloadProceedCmd = 'Dlpr',
kListDownloadFinishedCmd = 'DlLE',
- kCleanupCmd = 'DlCL'
+ kCleanupCmd = 'DlCL',
+ kClearCacheCmd = 'DlCC'
};
struct DialogState {
@@ -186,6 +187,7 @@ DownloadIconsDialog::DownloadIconsDialog() :
_downloadSpeedLabel = new StaticTextWidget(this, "GlobalOptions_DownloadIconsDialog.DownloadSpeed", Common::U32String());
_cancelButton = new ButtonWidget(this, "GlobalOptions_DownloadIconsDialog.MainButton", _("Cancel download"), Common::U32String(), kCleanupCmd);
_closeButton = new ButtonWidget(this, "GlobalOptions_DownloadIconsDialog.CloseButton", _("Hide"), Common::U32String(), kCloseCmd);
+ _clearCacheButton = new ButtonWidget(this, "GlobalOptions_DownloadIconsDialog.ResetButton", _("Clear Cache"), Common::U32String(), kClearCacheCmd);
if (!g_state) {
g_state = new DialogState;
@@ -229,7 +231,7 @@ void DownloadIconsDialog::setState(IconProcessState state) {
_statusText->setLabel(_("Downloading icons list..."));
_cancelButton->setLabel(_("Cancel download"));
_cancelButton->setCmd(kCleanupCmd);
- _closeButton->setVisible(false);
+ _closeButton->setVisible(true);
g_state->totalSize = 0;
g_state->fileHash.clear();
@@ -239,7 +241,7 @@ void DownloadIconsDialog::setState(IconProcessState state) {
_statusText->setLabel(Common::U32String::format(_("Downloading icons list... %d entries"), g_state->fileHash.size()));
_cancelButton->setLabel(_("Cancel download"));
_cancelButton->setCmd(kCleanupCmd);
- _closeButton->setVisible(false);
+ _closeButton->setVisible(true);
break;
case kDownloadStateListCalculated: {
@@ -266,6 +268,7 @@ void DownloadIconsDialog::setState(IconProcessState state) {
_closeButton->setLabel(_("Hide"));
_closeButton->setCmd(kCloseCmd);
_closeButton->setEnabled(true);
+ _clearCacheButton->setEnabled(false);
break;
case kDownloadComplete: {
@@ -280,6 +283,7 @@ void DownloadIconsDialog::setState(IconProcessState state) {
_closeButton->setLabel(_("Close"));
_closeButton->setCmd(kCleanupCmd);
_closeButton->setEnabled(true);
+ _clearCacheButton->setEnabled(true);
break;
}
}
@@ -313,6 +317,10 @@ void DownloadIconsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
setState(kDownloadStateDownloading);
g_state->proceedDownload();
break;
+ case kClearCacheCmd:
+ _clearCacheButton->setEnabled(false);
+ clearCache();
+ break;
default:
Dialog::handleCommand(sender, cmd, data);
}
@@ -406,6 +414,7 @@ void DownloadIconsDialog::calculateList() {
if (g_state->totalSize == 0) {
Common::U32String error(_("No new icons packs available"));
+ _closeButton->setEnabled(false);
setError(error);
return;
}
@@ -413,5 +422,58 @@ void DownloadIconsDialog::calculateList() {
setState(kDownloadStateListCalculated);
}
+void DownloadIconsDialog::clearCache() {
+ Common::String sizeUnits;
+
+ Common::String iconsPath = ConfMan.get("iconspath");
+ if (iconsPath.empty()) {
+ Common::U32String str(_("ERROR: No icons path set"));
+ setError(str);
+ return;
+ }
+
+ Common::FSDirectory *iconDir = new Common::FSDirectory(iconsPath);
+
+ Common::ArchiveMemberList iconFiles;
+
+ iconDir->listMatchingMembers(iconFiles, "gui-icons*.dat");
+
+ for (auto ic = iconFiles.begin(); ic != iconFiles.end(); ++ic) {
+ Common::String fname = (*ic)->getName();
+ Common::SeekableReadStream *str = (*ic)->createReadStream();
+ uint32 size = str->size();
+ delete str;
+
+ g_state->totalSize += size;
+ }
+
+ Common::String size = getHumanReadableBytes(g_state->totalSize, sizeUnits);
+
+ GUI::MessageDialog dialog(Common::U32String::format(_("You are about to remove %s %s of data, deleting all previously downloaded icon files. Do you want to proceed?"), size.c_str(), sizeUnits.c_str()), _("Proceed"), _("Cancel"));
+ if (dialog.runModal() == ::GUI::kMessageOK) {
+
+ // Build list of previously downloaded icon files
+ for (auto ic = iconFiles.begin(); ic != iconFiles.end(); ++ic) {
+ Common::String fname = (*ic)->getName();
+ Common::FSNode fs(iconsPath + fname);
+ Common::WriteStream *str = fs.createWriteStream();
+
+ // Overwrite previously downloaded icon files with dummy data
+ str->writeByte(0);
+ str->finalize();
+ }
+ g_state->fileHash.clear();
+
+ // Reload (now empty) icons set
+ g_gui.initIconsSet();
+
+ // Fetch current icons list file and re-trigger downloads
+ g_state->downloadList();
+ calculateList();
+ _cancelButton->setVisible(true);
+ } else {
+ _clearCacheButton->setEnabled(true);
+ }
+}
} // End of namespace GUI
diff --git a/gui/downloadiconsdialog.h b/gui/downloadiconsdialog.h
index d03193fcd91..016c2e52326 100644
--- a/gui/downloadiconsdialog.h
+++ b/gui/downloadiconsdialog.h
@@ -54,6 +54,7 @@ class DownloadIconsDialog : public Dialog, public CommandSender {
SliderWidget *_progressBar;
ButtonWidget *_cancelButton;
ButtonWidget *_closeButton;
+ ButtonWidget *_clearCacheButton;
Common::String _localDirectory;
bool _close;
@@ -77,6 +78,7 @@ public:
private:
void calculateList();
+ void clearCache();
void setState(IconProcessState state);
};
diff --git a/gui/themes/common/highres_layout.stx b/gui/themes/common/highres_layout.stx
index f7a005556ea..0ec5b820d81 100644
--- a/gui/themes/common/highres_layout.stx
+++ b/gui/themes/common/highres_layout.stx
@@ -1082,6 +1082,9 @@
<widget name = 'CloseButton'
type = 'Button'
/>
+ <widget name = 'ResetButton'
+ type = 'Button'
+ />
</layout>
</layout>
</dialog>
diff --git a/gui/themes/common/lowres_layout.stx b/gui/themes/common/lowres_layout.stx
index 30ef493da46..1c529270645 100644
--- a/gui/themes/common/lowres_layout.stx
+++ b/gui/themes/common/lowres_layout.stx
@@ -1034,6 +1034,9 @@
<widget name = 'CloseButton'
type = 'Button'
/>
+ <widget name = 'ResetButton'
+ type = 'Button'
+ />
</layout>
</layout>
</dialog>
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 46c366d07a3..8f4197ba74f 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -2319,6 +2319,9 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"<widget name='CloseButton' "
"type='Button' "
"/>"
+"<widget name='ResetButton' "
+"type='Button' "
+"/>"
"</layout>"
"</layout>"
"</dialog>"
@@ -4242,6 +4245,9 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"<widget name='CloseButton' "
"type='Button' "
"/>"
+"<widget name='ResetButton' "
+"type='Button' "
+"/>"
"</layout>"
"</layout>"
"</dialog>"
diff --git a/gui/themes/residualvm.zip b/gui/themes/residualvm.zip
index 9c998340439..82cf8ea06a3 100644
Binary files a/gui/themes/residualvm.zip and b/gui/themes/residualvm.zip differ
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index f3b3d422d3a..6dc56fe4048 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 1f00d4e764f..98929bf1d7f 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -935,6 +935,9 @@
<widget name = 'CloseButton'
type = 'Button'
/>
+ <widget name = 'ResetButton'
+ type = 'Button'
+ />
</layout>
</layout>
</dialog>
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index f019724b4c8..95609beea59 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -948,6 +948,9 @@
<widget name = 'CloseButton'
type = 'Button'
/>
+ <widget name = 'ResetButton'
+ type = 'Button'
+ />
</layout>
</layout>
</dialog>
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index 437b0153726..0fdd77090e3 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummremastered.zip b/gui/themes/scummremastered.zip
index 994d48a2115..e374d6aa503 100644
Binary files a/gui/themes/scummremastered.zip and b/gui/themes/scummremastered.zip differ
Commit: 4f762e096cb2ddaec940a1d0ac81b4e9a6269119
https://github.com/scummvm/scummvm/commit/4f762e096cb2ddaec940a1d0ac81b4e9a6269119
Author: Lothar Serra Mari (mail at serra.me)
Date: 2022-07-10T14:18:13+02:00
Commit Message:
NEWS: Mention CGA/CGA Composite/Hercules support for SCUMM1 in German NEWS
Changed paths:
doc/de/NEUES.md
diff --git a/doc/de/NEUES.md b/doc/de/NEUES.md
index 71486fe906b..5f2311b243b 100644
--- a/doc/de/NEUES.md
+++ b/doc/de/NEUES.md
@@ -20,6 +20,10 @@ Umfangreichere Informationen über die Ãnderungen des aktuellen Codes findest D
- Unterstützung für die koreanische Version von Legend of Kyrandia 1 hinzugefügt.
- Unterstützung für die hebräische Version von Legend of Kyrandia 3 hinzugefügt.
+ SCUMM:
+ - Unterstützung von CGA-, CGA Composite- und Herkules-Grafikmodi für die
+ SCUMM 1-Versionen von Zak McKracken und Maniac Mansion hinzugefügt.
+
Toon:
- Die Spiel-Menüs verhalten sich nun wie das Original.
More information about the Scummvm-git-logs
mailing list