Commit Graph

79 Commits

Author SHA1 Message Date
rubidium 4b6d1f9027 (svn r9851) [0.5] -Backport from trunk (r9731, r9741, r9743, r9753, r9757):
- Fix: when you have closed the "Load game"/"New game" windows which you started from the "start server" menu, you shouldn't start a server when starting a new game [SF#1244842] (r9757)
- Fix: Trains were lost after autorenewal/autoreplace [FS#732] (r9753)
- Fix: Stop flooded towns from building roads on water [FS#598] (r9743)
- Fix: Station signs were not resized when the language changed [FS#672] (r9741)
- Fix: In news history, newlines were not replaced with spaces [FS#677] (r9731)
2007-05-15 21:42:27 +00:00
rubidium 759d155b08 (svn r9343) [0.5] -Backport from trunk (r9000, r9001, r9097, r9137):
- Fix: new locomotive names were not announced in the news, it said "new railway locomotive available - railway locomotive" (r9000, r9001)
- Feature: add an extra news group for opening and closing of industries (r9097)
- Fix: when all news-setting buttons are 'full', make the for-all button show 'full' too (r9137)
2007-03-19 19:22:26 +00:00
rubidium 61b95ff1fc (svn r8627) [0.5] -Backport from trunk (8409, 8420 + 8421, 8533, 8612):
-Regression: When the latest news was deleted, the news queue wrapped back to the oldest item, showing all news again.
-Regression [FS#573]: ShowLastNewsMessage could show an out-of-bounds news item because it did not checked if a previous item actually existed the first time it is called (forced news is INVALID_NEWS).
-Codechange: Rename the 'New <vehtype>' button of the global vehicle lists to 'Available <vehtype>' as it is a view-only list, not one from which you can purchase (rolling) stock.
-Fix: segmentation fault when the toolbar gets removed and you have selected one of the items in a submenu of the toolbar. 
-Fix [FS#582]: When the currently selected player in the performance details window is no longer active, choose the first active player instead of the first player as that may also be inactive.
2007-02-08 11:03:00 +00:00
Darkvater c73bbe531e (svn r8178) -Backport from turnk (r8049, r8079, r8080, r8135):
- oe more news-window fix and fix up ShowLastNewsMessage (r8049)
 - float division by 0 in YAPF code on Win9x (r8079, r8080)
 - do not assert when removing duplicates would remove non-static grf (r8135)
2007-01-17 00:51:04 +00:00
Darkvater 0a635c692e (svn r7952) -Backport from trunk (r7823, r7861):
- News windows could still crash due to moving news items around while a news window was still open.
2007-01-07 12:15:36 +00:00
Darkvater 17eeba3245 (svn r7402) -Fix: [FS#255] Long Delay for Message Windows to Appear. Immediately show a new message
if present if no news window is open, or has just been closed instead of waiting for the
 timer of the current news to time out.
2006-12-06 17:28:14 +00:00
Darkvater b461b8dbe5 (svn r7388) -Fix (r7384 / r7368 / r3757): When adding a new news item for the first time (_latest_news
is INVALID_NEWS), make it the value of _oldest_news, not zero as DeleteVehicleNews can
 change _oldest_news. Also remove the (i == INVALID_NEWS) return 0; guard from increaseIndex
 as it's only used in 2 places, nowhere else.
2006-12-05 23:37:04 +00:00
Darkvater a9ea304121 (svn r7384) -Fix: No vehicle was removed in DeleteVehicleNews when the fifo-array was full. Update the
bound conditions of the loop, add an assert and also update _current_news when needed. (r3757)
2006-12-05 22:35:25 +00:00
Darkvater 0a0368014d (svn r7383) -Codechange: fix up typo in news-gui s/MoveToNexItem/MoveToNextItem/. 2006-12-05 22:31:10 +00:00
Darkvater 681f994d16 (svn r7370) -Cleanup: Use NewsID instead of byte for news identifiers, and some minor other things 2006-12-05 12:17:31 +00:00
Darkvater a46daf3fb1 (svn r7369) -Cleanup: Some coding style, usage of increaseIndex and decreaseIndex to loop through the
fifo-array-buffer, typo's.
2006-12-05 11:59:28 +00:00
Darkvater 8904c04192 (svn r7368) -Fix: [FS#332] Vehicle Deletion Crash [News Window Related?] (r3757). 2006-12-05 11:51:23 +00:00
peter1138 1a4f1c8177 (svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come. 2006-11-16 22:05:33 +00:00
Darkvater 1e69ac550d (svn r6926) -Codechange: Rename WWT_4 to WWT_TEXTBTN_2 and WWT_6 to WWT_INSET (credits to peter1138
for the aptly found name)
-Codechange: Remove the explicit numbering from WindowWidgetTypes
2006-10-24 16:27:18 +00:00
Darkvater d303ef94b3 (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
WWT_IMGBTN must contain an image for drawing. Renamed WWT_PANEL_2 to WWT_IMGBTN_2
 because that is what it is. Added WWT_PUSHBTN that is either just a pushable button,
 or a textbutton, which text's drawn dynamically independent of widget.
2006-10-24 14:15:17 +00:00
Darkvater ee27bb497c (svn r6884) -Codechange: Add strict bounds checking in string formatting system.
The last parameter should point to the end of the buffer (eg lastof(buf))
 Courtesy of Tron.
2006-10-21 23:31:34 +00:00
Darkvater 5ecd5eb4f4 (svn r6804) -Codechange: Remove the unused NF_NOEXPIRE flag. 2006-10-17 18:15:35 +00:00
Darkvater fba7d2f7f3 (svn r6803) -Codechange: Substitute magic numbers by an enum for the news windows 2006-10-17 17:59:41 +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 753b572400 (svn r6619) -Codechange: Use accessors for disabled_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 02:08:15 +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
rubidium 63687763e9 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
-Cleanup: whitespace alignment of a few tables.
2006-09-04 20:40:33 +00:00
belugas 4c2abf1de5 (svn r6046) CodeChange : Rename WWT_5 Widget type to WWT_LABEL : a centered label
CodeChange : Move almost all fixed strings from ON_PAINT event to Widget array using WWT_LABEL.
Feature : All "Select Refit Cargo" are now centered, instead of been left aligned
2006-08-22 15:23:25 +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
rubidium 3cab5f30c0 (svn r5926) -Codechange: make _cur_year contain the full year, instead of the offset since 1920
-Codechange: store all year related variables that are _not_ stored in a savegame/transported over the network in the same format as _cur_year
2006-08-16 11:39:55 +00:00
rubidium 8aa76f306d (svn r5915) -Cleanup: some variables were named *_date while they were only holding years; rename these variables to match this. 2006-08-15 14:52:17 +00:00
rubidium 243872b4fd (svn r5887) -Cleanup: move date related functions, defines and variables to date.[ch]
-Cleanup: fix whitespace related coding style issues in date.[ch]
-Cleanup: make original comments doxygen compatible and remove/change outdated comments
2006-08-14 14:21:15 +00:00
belugas 6082507fea (svn r5609) CodeChange : Apply coding style 2006-07-26 03:33:12 +00:00
tron 0a72639c2d (svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc. 2006-06-10 08:37:41 +00:00
peter1138 a172b194c2 (svn r3778) - Fix crash when resizing news history window. 2006-03-06 23:01:35 +00:00
tron 5913c3931b (svn r3761) Fix two bugs in r3757 2006-03-04 17:18:13 +00:00
tron 87fdb129d2 (svn r3758) Remove the news validation callback. It is superseded by r3757. 2006-03-04 11:15:44 +00:00
tron 4270026b42 (svn r3757) -Feature: Delete news items about vehicles, when they get stale
This is used to delete
- all news about a vehicle, when it gets deleted
- "vehicle has stopped in depot" news, when it gets started
- "vehicle has invalid orders" news, when the orders get changed
2006-03-04 11:01:35 +00:00
tron fa78c057ee (svn r3339) Remove unnecessary includes 2005-12-24 20:54:31 +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 f7abff5f96 (svn r3181) -Bracing
-Indentation
-Whitespace
-DeMorgan's Law
-Test with NULL or 0 for non-booleans
-'\0' instead of 0 for chars
-Remove redundantly redundant comments (like DoFoo(); // Do foo)
-Join multiple short lines with a single statement
-Split single lines with multiple statements
-Avoid assignments in if
2005-11-14 19:48:04 +00:00
tron 47137cefb7 (svn r3078) Some more stuff, which piled up:
- const, whitespace, indentation, bracing, GB/SB, pointless casts
- use the trinary operator where appropriate
- data types (uint[] -> AcceptedCargo, ...)
- if cascade -> switch
- if (ptr) -> if (ptr != NULL)
- DeMorgan's Law
- Fix some comments
- 0 -> '\0', change magic numbers to symbolic constants
2005-10-23 13:04:44 +00:00
tron 3397e202c8 (svn r3024) -Codechange: Another batch of replacements of int/uint/int16/byte/-1 with proper types and constants 2005-10-07 07:35:15 +00:00
celestar 1a5de9ff9b (svn r2747) -Fix: r2736 broke the newpaper display. Sorry. 2005-07-29 15:55:14 +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
tron d71788c402 (svn r2660) Get rid of some more shifting/anding/casting 2005-07-21 06:31:02 +00:00
Darkvater 0eef2daf06 (svn r2611) - CodeChange: use standardized truncutation with the newsmessage-history window as well 2005-07-17 16:02:17 +00:00
tron c887ff331a (svn r2465) Remove some unreachable code 2005-06-20 20:09:46 +00:00
hackykid 8607bbf06d (svn r2444) - CodeChange: Add an enum for demagicifying the values of the 'flags' parameter of DrawFrameRect(). (_Abraxa_) 2005-06-15 17:27:14 +00:00
Darkvater b438b1248c (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 2005-06-02 19:30:21 +00:00
Darkvater febae668fe (svn r2192) - Add greater control to the 'message options' window. Now you can turn off the telegraphc ticker sound for summarized messages, or turn off news-messages altogether (you get a red blot to notify you though). The [<][>] set the settings in one way, while clicking on the option itself, cycles it. This commit also 'fixes' bugs [1166973], [1121484] and patch [1169930].
- I also changed an order of strings from On, Off to Off, On, so this can be used ingame with the WWT_4 widget type.
- Since the newssettings now take 2 bits per setting (off/summary/on) _news_display_opt is widened to 32 bits and the settings code changed slightly to accomodate for a maximum of 16 message-types.
2005-04-13 23:03:31 +00:00
darkvater 22d36985cd (svn r2152) - Fix: Chatbar in MP games is now on-top of the news window.
- CodeChange: Introduction of SendWindowMessage() where a window can send another window a message (ala windows style msg, wparam, lparam). Messages can be sent by windowclass and by windowpointer.
- CodeChange: IsVitalWindow() simplifies a lot of checks for window handling that need to know what windows it can close, or be on top of, etc.
2005-04-05 21:03:30 +00:00
Darkvater d865c55007 (svn r1894) - Codechange: cleaned up the console a bit, wholly unified handling of text with that of editboxes
- Codechange: Introduction of Textbuf struct which not only holds physical data as length but also pixel-constrains (width) and information about the caret
- Codechange: Move Clipboard function to OS specific file. Currently only Windows has clipboard actions
- Feature: Editboxes, console and exit screen also accept the numeric-enter as a yes
- Feature: Navigation through text with cursor keys is possible, as well as arbitrary insertion (also paste) and deletion; both backspace and del keys. Functions DeleteTextBufferChar, InsertTextBufferChar and InsertTextBufferClipboard handle input and deletion. Navigation is done through MoveTextBufferPos.
- Fix: OTTD crash when opening 'add server' editbox
- CodeChange: fix up some stringwidth calculations in gfx.c. You can get the width in pixels of a character by calling GetCharacterWidth().
2005-02-21 18:59:54 +00:00