[Scummvm-cvs-logs] SF.net SVN: scummvm:[44044] scummvm/trunk/engines/sci/engine/kgraphics.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sun Sep 13 02:08:17 CEST 2009
Revision: 44044
http://scummvm.svn.sourceforge.net/scummvm/?rev=44044&view=rev
Author: thebluegr
Date: 2009-09-13 00:08:17 +0000 (Sun, 13 Sep 2009)
Log Message:
-----------
Always disable the "Change Directory" button in the save/load menus, as we don't allow the engine to change the directory where saved games will be placed
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kgraphics.cpp
Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-09-12 18:22:32 UTC (rev 44043)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-09-13 00:08:17 UTC (rev 44044)
@@ -1296,10 +1296,9 @@
static void _k_draw_control(EngineState *s, reg_t obj, int inverse);
-static void _k_disable_delete_for_now(EngineState *s, reg_t obj) {
- SegManager *segMan = s->segMan;
+static void disableCertainButtons(SegManager *segMan, Common::String gameName, reg_t obj) {
reg_t text_pos = GET_SEL32(obj, text);
- char *text = text_pos.isNull() ? NULL : (char *)s->segMan->dereference(text_pos, NULL);
+ char *text = text_pos.isNull() ? NULL : (char *)segMan->dereference(text_pos, NULL);
int type = GET_SEL32V(obj, type);
int state = GET_SEL32V(obj, state);
@@ -1322,16 +1321,24 @@
* effort (see above), and to simply disable the delete functionality for
* that game - bringing the save/load dialog on a par with SCI0.
*/
- if (type == K_CONTROL_BUTTON && text && (s->_gameName == "sq4") &&
- s->resMan->sciVersion() < SCI_VERSION_1_1 && !strcmp(text, " Delete ")) {
+ // NOTE: This _only_ works with the English version
+ if (type == K_CONTROL_BUTTON && text && (gameName == "sq4") &&
+ segMan->sciVersion() < SCI_VERSION_1_1 && !strcmp(text, " Delete ")) {
PUT_SEL32V(obj, state, (state | kControlStateDisabled) & ~kControlStateEnabled);
}
+
+ // Disable the "Change Directory" button, as we don't allow the game engine to
+ // change the directory where saved games are placed
+ // NOTE: This _only_ works with the English version
+ if (type == K_CONTROL_BUTTON && text && !strcmp(text, "Change\r\nDirectory")) {
+ PUT_SEL32V(obj, state, (state | kControlStateDisabled) & ~kControlStateEnabled);
+ }
}
reg_t kDrawControl(EngineState *s, int, int argc, reg_t *argv) {
reg_t obj = argv[0];
- _k_disable_delete_for_now(s, obj);
+ disableCertainButtons(s->segMan, s->_gameName, obj);
_k_draw_control(s, obj, 0);
FULL_REDRAW();
return NULL_REG;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list