extern int WireMode;
extern int MultiPlayerMode;
extern int SugarMode;
+extern int LegacyMode;
extern int sim_delay;
extern int sim_skips;
extern int sim_skip;
int WireMode = 0;
int MultiPlayerMode = 0;
int SugarMode = 0;
+int LegacyMode = 0;
int TilesAnimated = 0;
int DoAnimation = 1;
int DoMessages = 1;
sim = MakeNewSim();
- sprintf(initCmd, "source %s/micropolis.tcl", ResourceDir);
+ sprintf(initCmd, "%s/simcity.tcl", ResourceDir);
+ if (access(initCmd, R_OK) == 0) {
+ printf("Found %s, entering legacy mode.\n", initCmd);
+ LegacyMode = 1;
+ SugarMode = 0;
+ Eval("winfo-setlegacy");
+ }
+
+ if (!LegacyMode) {
+ sprintf(initCmd, "source %s/micropolis.tcl", ResourceDir);
+ } else {
+ sprintf(initCmd, "source %s/simcity.tcl", ResourceDir);
+ }
filename2UNIX(initCmd);
if (Eval(initCmd)) {
sim_exit(1); // Just sets tkMustExit and ExitReturn
{ char buf[1024];
- sprintf(buf, "UIStartMicropolis {%s} {%s} {%s}",
- HomeDir, ResourceDir, HostName);
+ if (!LegacyMode) {
+ sprintf(buf, "UIStartMicropolis {%s} {%s} {%s}",
+ HomeDir, ResourceDir, HostName);
+ } else {
+ sprintf(buf, "UIStartSimCity {%s} {%s} {} {%s}",
+ HomeDir, ResourceDir, HostName);
+ }
filename2UNIX(buf);
if (Eval(buf) != TCL_OK) {
sim_exit(1); // Just sets tkMustExit and ExitReturn
sprintf(str, "%s %d", dateStr[m], y);
- sprintf(buf,
- "UISetDate {%s} %d %d",
- str, m, y);
+ if (!LegacyMode) {
+ sprintf(buf,
+ "UISetDate {%s} %d %d",
+ str, m, y);
+ } else {
+ sprintf(buf,
+ "UISetDate {%s}",
+ str);
+ }
Eval(buf);
}
}
UpdateOptionsMenu(int options)
{
char buf[256];
- sprintf(buf, "UISetOptions %d %d %d %d %d %d %d %d",
- (options&1)?1:0, (options&2)?1:0,
- (options&4)?1:0, (options&8)?1:0,
- (options&16)?1:0, (options&32)?1:0,
- (options&64)?1:0, (options&128)?1:0);
+ if (!LegacyMode) {
+ sprintf(buf, "UISetOptions %d %d %d %d %d %d %d %d",
+ (options&1)?1:0, (options&2)?1:0,
+ (options&4)?1:0, (options&8)?1:0,
+ (options&16)?1:0, (options&32)?1:0,
+ (options&64)?1:0, (options&128)?1:0);
+ } else {
+ sprintf(buf, "UISetOptions %d %d %d %d %d %d",
+ (options&1)?1:0, (options&2)?1:0,
+ (options&4)?1:0, (options&8)?1:0,
+ (options&16)?1:0, (options&32)?1:0);
+ }
Eval(buf);
}
Tcl_Interp *interp, int argc, char **argv));
extern int Tk_WinfoCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int argc, char **argv));
+extern int Tk_WinfoCmdSetLegacy _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int argc, char **argv));
extern int Tk_WmCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int argc, char **argv));
extern int Tcp_AcceptCmd _ANSI_ARGS_((ClientData clientData,
}
}
\f
+static int LegacyMode = 0;
+
+int
+Tk_WinfoCmdSetLegacy (
+ ClientData clientData, /* Main window associated with
+ * interpreter. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int argc, /* Number of arguments. */
+ char **argv /* Argument strings. */
+)
+{
+ LegacyMode = 1;
+
+ return TCL_OK;
+}
+
/*
*----------------------------------------------------------------------
*
case PseudoColor: interp->result = "pseudocolor"; break;
case GrayScale: interp->result = "grayscale"; break;
case DirectColor: interp->result = "directcolor"; break;
- case TrueColor: interp->result = "truecolor"; break;
+ case TrueColor: interp->result = LegacyMode?"pseudocolor":"truecolor"; break;
case StaticColor: interp->result = "staticcolor"; break;
case StaticGray: interp->result = "staticgray"; break;
default: interp->result = "unknown"; break;
{"tkwait", Tk_TkwaitCmd},
{"update", Tk_UpdateCmd},
{"winfo", Tk_WinfoCmd},
+ {"winfo-setlegacy", Tk_WinfoCmdSetLegacy},
{"wm", Tk_WmCmd},
{"accept", Tcp_AcceptCmd},
{"shutdown", Tcp_ShutdownCmd},