This repository has been archived by the owner on May 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
luca_patch.diff
executable file
·129 lines (116 loc) · 2.98 KB
/
luca_patch.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
Index: ttd.c
===================================================================
--- ttd.c (revision 2236)
+++ ttd.c (working copy)
@@ -1025,6 +1025,36 @@
_current_player = p;
}
+ if (_game_mode == GM_MENU && _tick_counter - _sign_last_update > 370) {
+ // 370 ticks ~ 10 secs
+ SignStruct *ss;
+ Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
+ assert(w);
+
+ char buf1[64];
+ int zoom_level;
+ bool found = false;
+
+ while (!found) {
+ _view_sign_number++;
+ if (_view_sign_number + 1 > GetSignPoolSize())
+ _view_sign_number = 0;
+ ss = GetSign(_view_sign_number);
+ if (ss != NULL && ss->str != NULL)
+ found = true;
+ }
+
+ GetString(buf1, ss->str);
+ zoom_level = strtol(buf1, NULL, 10);
+ if (zoom_level < 0 || zoom_level > 3)
+ zoom_level = 0;
+
+ DEBUG(misc, 0) ("Sign number: %d Zoom: %d", _view_sign_number + 1, zoom_level);
+ w->viewport->zoom = zoom_level;
+ ScrollMainWindowToTile(TILE_FROM_XY(ss->x, ss->y));
+ _sign_last_update = _tick_counter;
+ }
+
_in_state_game_loop = false;
}
Index: ttd.h
===================================================================
--- ttd.h (revision 2236)
+++ ttd.h (working copy)
@@ -527,6 +527,9 @@
};
VARDEF byte _no_scroll;
+VARDEF uint16 _sign_last_update;
+VARDEF uint32 _view_sign_number;
+
#include "functions.h"
#include "variables.h"
Index: viewport.c
===================================================================
--- viewport.c (revision 2236)
+++ viewport.c (working copy)
@@ -916,7 +916,7 @@
int left, top, right, bottom;
StringSpriteToDraw *sstd;
- if (!(_display_opt & DO_SHOW_SIGNS))
+ if (!(_display_opt & DO_SHOW_SIGNS || _game_mode == GM_MENU))
return;
left = dpi->left;
Index: disaster_cmd.c
===================================================================
--- disaster_cmd.c (revision 2236)
+++ disaster_cmd.c (working copy)
@@ -947,14 +947,14 @@
#define MK(a,b) {a-20,b-20}
static const DisasterYears _dis_years[8] = {
- MK(30,55),
- MK(40,70),
- MK(60,90),
- MK(70,100),
- MK(100,200),
- MK(40,65),
- MK(75,110),
- MK(50,85),
+// MK(30,55),
+// MK(40,70),
+// MK(60,90),
+// MK(70,100),
+// MK(100,200),
+// MK(40,65),
+// MK(75,110),
+// MK(50,85),
};
@@ -965,14 +965,14 @@
int i,j;
for(i=j=0; i!=lengthof(_dis_years); i++) {
- if (year >= _dis_years[i].min &&
- year < _dis_years[i].max)
+ //if (year >= _dis_years[i].min &&
+ // year < _dis_years[i].max)
buf[j++] = i;
}
if (j == 0)
return;
-
+ IConsoleError("Doing disaster!");
_disaster_initprocs[buf[(uint16)Random() * j >> 16]]();
}
Index: console_cmds.c
===================================================================
--- console_cmds.c (revision 2236)
+++ console_cmds.c (working copy)
@@ -116,6 +116,7 @@
DEF_CONSOLE_CMD(ConResetEngines)
{
StartupEngines();
+ _disaster_delay = 1;
return 0;
}
Index: data/opntitle.dat
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream