Commit Graph

65 Commits

Author SHA1 Message Date
Darkvater dad5d5dd72 (svn r6774) -Codechange: Rename the badly named OWNER_SPECTATOR to PLAYER_SPECTATOR and
put it into player.h where it belongs (instead of map.h)
2006-10-14 15:49:43 +00:00
belugas 17eb65050b (svn r6631) -Codechange: Use accessors for click_state.
Another step toward merging XTDwidget.
The only two files not converted (window.h and widget.c) will be done at the very last commit)
2006-10-03 20:16:20 +00:00
belugas 1c56a5ae0f (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct 2006-09-23 02:39:24 +00:00
peter1138 6717160ebe (svn r6475) - Fix (r6055): Don't try to sort industries when there are none. Thanks to 'Delboy' 2006-09-18 06:34:37 +00:00
truelight 5fd9aeb12b (svn r6055) -Codechange: added GetXXXArraySize, which returns HighestID + 1 (or, will do that).
It isn't the best name, but we couldn't find any better.
  This unifies the pool-system even more.
2006-08-22 20:41:26 +00:00
truelight 0461d89612 (svn r6047) -Codechange: FOR_ALL now _only_ loops valid items, and skips invalid ones
-Codechange: use IsValidXXX where ever possible
  Note: both changes to prepare for new pool system, which needs those changes.
  For every pool there are 2 ugly lines, which will be removed when done
  implementing new pool system.
  Based on FS#13 by blathijs, partly implemented.
2006-08-22 15:33:35 +00:00
rubidium 480af9c917 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct. 2006-08-22 14:38:37 +00:00
truelight 83d56d6d79 (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
allow certain patterns (like numbers only)
2006-08-19 09:31:22 +00:00
tron 721987817e (svn r5912) -Fix: Sort order for produced amount and transported percentage was reversed in the industry list
Also slightly change these sorting criteria: If an industry produces more than one type of cargo sort by the sum (amount) resp. minimum (%) instead of the mean
2006-08-15 13:31:43 +00:00
tron 4ad8d1c7a2 (svn r5907) Remove more indirection by using pointers instead of IDs. Also fix some bogus warnings on MSVC by using (void*) casts 2006-08-15 07:07:17 +00:00
miham 76ea272c9c (svn r5714) Backport from branches/TGP (r5701 and r5711)
-Fix: < > boxes in patch-settings didn't grey out when they hit the limit of their range
 -Codechange: while at it, prettyfied DrawArrowButtons() a bit
 -Fix: < > boxes in industry production window (when cheat enabled) had a minor glitch
2006-08-02 18:36:53 +00:00
Darkvater 9abf858aaf (svn r5654) -Cleanup: Change an ugly define into a function 2006-07-30 14:56:40 +00:00
Darkvater 93800fc268 (svn r5653) -Cleanup: Do a little cleanup of the industry gui code. 2006-07-30 14:55:25 +00:00
Darkvater 205c9c227c (svn r5652) -Fix [SF 1480301]: Industry production change button doesn't work 2006-07-30 14:53:59 +00:00
belugas 6082507fea (svn r5609) CodeChange : Apply coding style 2006-07-26 03:33:12 +00:00
belugas 7ab8b20faf (svn r4614) CodeChange : Cleanup of industry_cmd (Step-4).
Removing the _industry_type_costs in favor of IndustrySpec.cost_multiplier;
In order to let industry_gui use the GetIndustrySpec accessor,
some structs had to be moved in industry.h
2006-04-28 21:58:16 +00:00
Darkvater 61b43672e9 (svn r3710) - Use the general function DrawArrowButtons() instead of doing it manually. The function has two parameters added, colour and an enabled flag. 2006-03-01 20:24:22 +00:00
tron ea73b46684 (svn r3597) Miscellaneous (I like that word) changes: Fix some indentation, add consts, reduce indentation level by short-circuit logic, convert if cascades to switch, whitespace, bracing, plus some minor stuff 2006-02-13 21:15:00 +00:00
tron 453b30e387 (svn r3564) Several smaller changes:
- Don't treat non-booleans as booleans
- Reduce variable scope
- Bracing
- Use DeMorgan's law to make conditionals easier to read
- if cascade -> switch
- Replace some magic numbers by symbolic names
- Avoid assignments within other statements
2006-02-06 09:18:04 +00:00
tron 84fb96fe85 (svn r3511) More whitespace ([FS#46] by Rubidium) 2006-02-01 07:36:15 +00:00
tron 22dc05faf2 (svn r3510) Fiddle with whitespace and parentheses 2006-02-01 06:32:03 +00:00
peter1138 d13763a9c4 (svn r3414) - Fix: Disable the Fund New Industry menu item and window when connected to a server as a spectator. 2006-01-21 21:45:34 +00:00
peter1138 1c57091230 (svn r3270) Correct all (mis)uses of WWT_CLOSEBOX / WWT_TEXTBTN to reflect their actual use, and add "Close Window" tooltip where missing. 2005-12-07 15:48:52 +00:00
tron 203726ed34 (svn r3090) Remove long dead pieces of code 2005-10-26 07:12:14 +00:00
tron ce1c72cf6e (svn r2995) Replace 0xFF/0xFFFF with CT_INVALID/OWNER_SPECTATOR/INVALID_STATION where appropriate 2005-09-28 19:35:36 +00:00
tron 0fe36a6900 (svn r2932) Give the strings consisting of an up/a down arrow symbolic names 2005-09-10 07:38:03 +00:00
tron a227065ab7 (svn r2701) Insert Id tags into all source files 2005-07-24 14:12:37 +00:00
tron 559babcdc9 (svn r2673) Include functions.h directly, not globally via openttd.h 2005-07-22 07:02:20 +00:00
tron 0762aa9ec9 (svn r2669) Shuffle some more stuff around to reduce dependencies 2005-07-21 22:15:02 +00:00
ludde 64f6839816 (svn r2594) Fix: [strgen] Misc updates to the string system.
- Renamed the plural command to "P" instead of "PLURAL". Now write something like this to append an s on plural: {P "" s}. (You can optionally still add an argument index to explicitly specifiy which number that's used)
  - Removed the pluralized cargo strings from the string files. The new method is to use the plural specifier {P}
  - Added support for genders. First add "##gender der das die" on top, then use {G=der} on a cargoname/industry to set the gender, and to switch between genders do something like {G neu neu neue} {STRING}
  - Updated the swedish/english translation with P strings.
2005-07-16 20:58:04 +00:00
ludde 3486e7e9d5 (svn r2580) Change: Added {INDUSTRY} command for printing industry names instead of the old {TOWN} {STRING} way.
- The formatting of the industry name can be controlled with the string STR_INDUSTRY_FORMAT.
Change: Changed several occurences of {STRING1} into {TOWN} to get rid of townnametype being used directly.
2005-07-15 18:30:13 +00:00
ludde 2fa79c9b4d (svn r2572) - Codechange: [string] Changed string system so it's not as dependent on decode_parameters
- Feature: [strgen] Allow changing the order of parameters in translated strings.
  - Use {1:TOWN} syntax to set the order.
- Codechange: [strgen] Rewrote lots of strgen internals.
2005-07-15 14:53:44 +00:00
tron bec5e4fb4c (svn r2487) Replace TILE_XY by TileXY/TileDiffXY 2005-06-25 16:44:57 +00:00
Darkvater 5fed47964e (svn r2420) - Codechange: magic number elminitation of cursorsprites. 2005-06-06 13:47:06 +00:00
Darkvater b438b1248c (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 2005-06-02 19:30:21 +00:00
Darkvater 5e6923e936 (svn r2290) - CodeChange: protect the next batch of commands. This brings us to a total of 61, which is 53% :)
- CodeChange: To correctly accept engine-prototypes, the best-player checking has been moved to its own function, I hope it functions the same as before.
- CodeChange: Added symbolic types of PlayerID, OrderID and EngineID. For engines also added GetEngine() and IsEngineIndex(), similar to the other such functions.
- CodeChange: To correctly build industries, some tables have been moved to build_industry.h. The only way to find out currently if an industry is valid in a climate is by looping all industries and checking if it matches. Also to comply with the patch setting build_rawmaterial_industries, it is assumed that these industries do not accept any cargo of any type. This can and probably should changed in the future to some flag in their struct. Also use _opt_ptr instead of _opt.
- CodeChange: implemented the HQ checking code inspired by MarkR2 in "[ 1190944 ] Many commands not checked for security".  Unfortunately it is impossible to prevent only deleting a HQ by a modified client atm.
- CodeChange: For insert order and modify order their parameters are implicitely truncated to 8 bits, instead of the 16 bits said in the comments.
2005-05-11 00:00:27 +00:00
bjarni 4af271c494 (svn r2170) -fix: [1179457] the industry list can now no longer scroll down then the end of the list is reached (Hackykid) 2005-04-08 23:46:18 +00:00
celestar ae2cfeefe3 (svn r1892) -Fix: [ 1117730 ] Production values of temperate-climate banks can now be altered 2005-02-20 07:58:38 +00:00
tron 2de3dc2735 (svn r1890) Begin to clean up the edit box: Remove one global variable and split the combined edit/original buffer into two 2005-02-19 14:40:32 +00:00
tron 0381073e56 (svn r1813) Declare functions implemented in strings.c in their own shiny new header (though i think some of these function don't belong into strings.c) 2005-02-06 08:18:00 +00:00
tron f0f85a7ef3 (svn r1803) Move debugging stuff into files of it's own 2005-02-05 15:58:59 +00:00
tron 04921a9015 (svn r1791) Remove the remnants of CMD_DESTROY_INDUSTRY, which was removed a long time ago 2005-02-04 17:14:36 +00:00
truelight 83a889d678 (svn r1771) -Add: Industries are now dynamic (up to 64k industries). Generating
1kx1k maps should now be much faster, and give more than just oil-stuff ;)
2005-02-02 17:30:29 +00:00
miham 7874c86cb2 (svn r1678) Added cheat option for setting production of raw-material product industries in game 2005-01-26 10:52:23 +00:00
tron 189ca73707 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile 2005-01-22 20:23:18 +00:00
tron 3279a7c9a2 (svn r1520) Trim 134 (!) lines with trailing whitespace ): 2005-01-15 08:58:31 +00:00
miham 9e10458209 (svn r1503) Added feature:
o allows users to setup the production values of the rawmaterial producing 
  industries in the editor

Modified:
o ttd.h - added CT_INVALID for 0xFF cargo type
o english.txt - added 1 string
o industry_gui.c - the feature itself
o window.h - added compile asserts to the structs which checks whether their
  sizes are smaller than WINDOW_CUSTOM_SIZE

Thanks:
o Darkvater to bother me to constantly improve the patch
o Various users at #openttd for testing
2005-01-14 00:14:13 +00:00
truelight 63e97754fb (svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns and _industries
(in prepare of dynamic arrays):
  - DEREF_XXX is changed into GetXXX
  - All direct call are directed via GetXXX
  - struct Industry has now an index-field
  - ENUM'd some stuff
  - Replaced home built loops with FOR_ALL_XXX
  - Added _stations_size, _vehicles_size, ... which gives the length of the
    array (which will be dynamic in the near future)
  - Changed lengtof(XXX) to _XXX_size (e.g. _stations_size)
  - Removed all endof(XXX) (because mostly it was part of a FOR_ALL_XXX)
  - Made the sort-functions of all 4 dynamic
  - Made all 4 Initialize functions more of the same
  - Some minor tab-fixing and stuff
  (tnx to Tron for proof-reading my 100kb patch ;))

  Note for all: please do NOT directly call _stations, _vehicles, _towns and
  _industries, but use the right wrapper to access them. Thank you.
  Ps: please also do not use 'v++', where v is of type Vehicle *.
2005-01-06 22:31:58 +00:00
darkvater 4c5f6fe360 (svn r1379) -Fix: various GUI glitches. Added default sizes to various widgets. Sticky/Resize- and Scrollbar must be 11 pixels wide, Horizontal scrollbar 11 pixels high, caption must be 13 pixels. I hope I didn't forget any widgets, the game will assert for that so report them to me! 2005-01-04 21:28:09 +00:00
truelight a94fe04a9a (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
how the system works. All useful windows are already made resizable. Enjoy :)
-Fix: fixed some GUI-glitches and flaws along the way
2005-01-03 19:45:18 +00:00