Mercurial > hg > openttd
changeset 8470:4a0f0d97a7d9 draft
(svn r12041) -Codechange: Add the loader and the property for action 00 industries, prop 24, nearby station name.
No assignation yet, no real work either.
author | belugas <belugas@openttd.org> |
---|---|
date | Sat, 02 Feb 2008 03:23:26 +0000 |
parents | 066d7c3ca93d |
children | 1e4ea519bfaf |
files | src/industry.h src/newgrf.cpp src/table/build_industry.h |
diffstat | 3 files changed, 14 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/industry.h +++ b/src/industry.h @@ -179,6 +179,7 @@ GRFMappedStringID closure_text; ///< Message appearing when the industry closes GRFMappedStringID production_up_text; ///< Message appearing when the industry's production is increasing GRFMappedStringID production_down_text; ///< Message appearing when the industry's production is decreasing + GRFMappedStringID station_name; ///< Default name for nearby station byte appear_ingame[NUM_LANDSCAPE]; ///< Probability of appearance in game byte appear_creation[NUM_LANDSCAPE]; ///< Probability of appearance during map creation uint8 number_of_sounds; ///< Number of sounds available in the sounds array
--- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -2126,6 +2126,10 @@ indsp->removal_cost_multiplier = grf_load_dword(&buf); break; + case 0x24: // name for nearby station + indsp->station_name = GRFMappedStringID(grf_load_dword(&buf), _cur_grffile->grfid); + break; + default: ret = true; break; @@ -5421,6 +5425,14 @@ strid = GetGRFStringID(indsp->grf_prop.grffile->grfid, indsp->new_industry_text); if (strid != STR_UNDEFINED) indsp->new_industry_text = strid; + indsp->station_name.MapString(); + if (indsp->station_name != STR_NULL) { + /* STR_NULL (0) can be set by grf. It has a meaning regarding assignation of the + * station's name. Don't wont to loose the value, therefor, do not process. */ + strid = GetGRFStringID(indsp->grf_prop.grffile->grfid, indsp->station_name); + if (strid != STR_UNDEFINED) indsp->station_name = strid; + } + _industry_mngr.SetEntitySpec(indsp); _loaded_newgrf_features.has_newindustries = true; }
--- a/src/table/build_industry.h +++ b/src/table/build_industry.h @@ -1176,7 +1176,7 @@ #define MI(tbl, sndc, snd, d, pc, ai1, ai2, ai3, ai4, ag1, ag2, ag3, ag4, col, \ c1, c2, c3, proc, p1, r1, p2, r2, m, a1, im1, a2, im2, a3, im3, pr, clim, bev, in, intx, s1, s2, s3) \ {tbl, lengthof(tbl), min(255, d), 0, d, pc, {c1, c2, c3}, proc, {p1, p2}, {r1, r2}, m, \ - {a1, a2, a3}, {{im1, 0}, {im2, 0}, {im3, 0}}, pr, clim, bev, col, GRFMappedStringID(in, 0), GRFMappedStringID(intx, 0), GRFMappedStringID(s1, 0), GRFMappedStringID(s2, 0), GRFMappedStringID(s3, 0), {ai1, ai2, ai3, ai4}, {ag1, ag2, ag3, ag4}, \ + {a1, a2, a3}, {{im1, 0}, {im2, 0}, {im3, 0}}, pr, clim, bev, col, GRFMappedStringID(in, 0), GRFMappedStringID(intx, 0), GRFMappedStringID(s1, 0), GRFMappedStringID(s2, 0), GRFMappedStringID(s3, 0), GRFMappedStringID(STR_UNDEFINED, 0), {ai1, ai2, ai3, ai4}, {ag1, ag2, ag3, ag4}, \ sndc, snd, 0, 0, true, {INVALID_INDUSTRYTYPE, 0, NULL, NULL, INVALID_INDUSTRYTYPE}} /* Format: tile table count and sounds table