summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-10-10 01:15:07 +0000
committerbelugas <belugas@openttd.org>2007-10-10 01:15:07 +0000
commit56ba73a714f0e33096bd04d786f3f6f964fdfca0 (patch)
tree1c255eebc46c9e34cfb69c0f338ccdda3dec0583 /src
parent22fd539413fac5d53a6e1b91872addf0be49fef6 (diff)
downloadopenttd-56ba73a714f0e33096bd04d786f3f6f964fdfca0.tar.xz
(svn r11242) -Codechange: When displaying the industry funding gui, present the industries in the same order as they are available.
Prior of this, they were separated in processing/organic and extractive. Now, all are mixed, just filtered when required. This will allow easy comparison with TTDPatch's list. (glx and me)
Diffstat (limited to 'src')
-rw-r--r--src/industry_gui.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 70160936d..682b61641 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -112,28 +112,23 @@ static void BuildDynamicIndustryWndProc(Window *w, WindowEvent *e)
WP(w, fnd_d).timer_enabled = false;
}
- /* We'll perform two distinct loops, one for secondary industries, and the other one for
- * primary ones. Each loop will fill the _fund_gui structure. */
+ /* Fill the _fund_gui structure with industries.
+ * The tests performed after the enabled allow to load the industries
+ * In the same way they are inserted by grf (if any)
+ */
for (ind = 0; ind < NUM_INDUSTRYTYPES; ind++) {
indsp = GetIndustrySpec(ind);
- if (indsp->enabled && (!indsp->IsRawIndustry() || _game_mode == GM_EDITOR)) {
+ if (indsp->enabled){
+ /* Rule is that editor mode loads all industries.
+ * In game mode, all non raw industries are loaded too
+ * and raw ones are loaded only when setting allows it */
+ if (_game_mode != GM_EDITOR && indsp->IsRawIndustry() && _patches.raw_industry_construction == 0) continue;
_fund_gui.index[_fund_gui.count] = ind;
_fund_gui.enabled[_fund_gui.count] = (_game_mode == GM_EDITOR) || CheckIfCallBackAllowsAvailability(ind, IACT_USERCREATION);
_fund_gui.count++;
}
}
- if (_patches.raw_industry_construction != 0 && _game_mode != GM_EDITOR) {
- for (ind = 0; ind < NUM_INDUSTRYTYPES; ind++) {
- indsp = GetIndustrySpec(ind);
- if (indsp->enabled && indsp->IsRawIndustry()) {
- _fund_gui.index[_fund_gui.count] = ind;
- _fund_gui.enabled[_fund_gui.count] = (_game_mode == GM_EDITOR) || CheckIfCallBackAllowsAvailability(ind, IACT_USERCREATION);
- _fund_gui.count++;
- }
- }
- }
-
/* first indutry type is selected.
* I'll be damned if there are none available ;) */
WP(w, fnd_d).index = 0;