Commit Graph

74 Commits

Author SHA1 Message Date
Darkvater
3807e914e8 (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
f2a70e3e26 (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
6d54dcdd24 (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
3beb23e1c6 (svn r7383) -Codechange: fix up typo in news-gui s/MoveToNexItem/MoveToNextItem/. 2006-12-05 22:31:10 +00:00
Darkvater
75ec6d9b77 (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
f14a24ac26 (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
8df7ca8f4a (svn r7368) -Fix: [FS#332] Vehicle Deletion Crash [News Window Related?] (r3757). 2006-12-05 11:51:23 +00:00
peter1138
f660d48e6a (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
02a6df391d (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
c7c65ce6d5 (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
494c56475f (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
57dbb50e13 (svn r6804) -Codechange: Remove the unused NF_NOEXPIRE flag. 2006-10-17 18:15:35 +00:00
Darkvater
d4b990a01d (svn r6803) -Codechange: Substitute magic numbers by an enum for the news windows 2006-10-17 17:59:41 +00:00
belugas
688da1d940 (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
cf210fdf6b (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
98ba395277 (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
21ac20aeca (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
650b9be724 (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
908d3bcfe6 (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
e87e065e41 (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
dc54e608e3 (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
9fc837ad85 (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
40a8964911 (svn r5609) CodeChange : Apply coding style 2006-07-26 03:33:12 +00:00
tron
a2362674e3 (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
9c1856d8f1 (svn r3778) - Fix crash when resizing news history window. 2006-03-06 23:01:35 +00:00
tron
6394725ae8 (svn r3761) Fix two bugs in r3757 2006-03-04 17:18:13 +00:00
tron
ca0862c3f4 (svn r3758) Remove the news validation callback. It is superseded by r3757. 2006-03-04 11:15:44 +00:00
tron
332b54d5a6 (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
04c096ee63 (svn r3339) Remove unnecessary includes 2005-12-24 20:54:31 +00:00
peter1138
5f3dc36983 (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
9d0e7b6458 (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
181d586a7c (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
8980891b09 (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
d2a891db7e (svn r2747) -Fix: r2736 broke the newpaper display. Sorry. 2005-07-29 15:55:14 +00:00
tron
647cbd6bdd (svn r2701) Insert Id tags into all source files 2005-07-24 14:12:37 +00:00
tron
54cbd01825 (svn r2673) Include functions.h directly, not globally via openttd.h 2005-07-22 07:02:20 +00:00
tron
71140a5768 (svn r2669) Shuffle some more stuff around to reduce dependencies 2005-07-21 22:15:02 +00:00
tron
6ad3895306 (svn r2660) Get rid of some more shifting/anding/casting 2005-07-21 06:31:02 +00:00
Darkvater
12507a725a (svn r2611) - CodeChange: use standardized truncutation with the newsmessage-history window as well 2005-07-17 16:02:17 +00:00
tron
255609f2d6 (svn r2465) Remove some unreachable code 2005-06-20 20:09:46 +00:00
hackykid
90900802b9 (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
ba8c649fac (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 2005-06-02 19:30:21 +00:00
Darkvater
e25dfa6e7e (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
648fa7c97d (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
fb78ca8a62 (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
tron
701a32d048 (svn r1840) Repel str_buffr and use local buffers where possible 2005-02-07 12:32:35 +00:00
tron
257e97c09a (svn r1833) byte -> char transition: the rest 2005-02-06 22:25:27 +00:00
tron
d3f84347ac (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
dominik
bb34830bee (svn r1598) Feature: Message history now is stickyable and resizeable
The news messages are now precisely cropped according to pixel width to fit optimal into the window.
Introduced a new date format: DATE_TINY, which is ISOish.
2005-01-22 23:13:20 +00:00
tron
97f893ae2f (svn r1596) Add some more statics 2005-01-22 22:47:58 +00:00