Commit Graph

51026 Commits (8cf798d1e1b4427537aed78d4d74d057ab1077df)
 

Author SHA1 Message Date
Peter Nelson f5722a999e Cleanup: Use std::vector in RandomSpriteGroup.
(cherry picked from commit 913d8a7f28)
3 years ago
Peter Nelson a69a1d19a9 Cleanup: Use std::vector in DeterministicSpriteGroup.
(cherry picked from commit 1aeaf39954)
3 years ago
Peter Nelson d3b9d19c5a Cleanup: Use std::vector in RealSpriteGroup.
(cherry picked from commit f785a70a2b)
3 years ago
Loïc Guilloux d4c466200f Fix: Don't consider regression AIs when starting a random AI (#9164)
(cherry picked from commit 376f2509ad)
3 years ago
rubidium42 03f8ed7d3f Feature: make the town directory horizontally resizable
(cherry picked from commit 0345f99180)
3 years ago
Loïc Guilloux 1ac0f186c8 Fix d4f0b6f4: [CMake] CMAKE_PROJECT_VERSION_XXX are not in CMake 3.9 (#9154)
(cherry picked from commit 2985277bec)
3 years ago
rubidium42 442f6d7063 Fix #9152, Fix #9153: screenshot command showed error messages when successful
(cherry picked from commit 40528db993)
3 years ago
Peter Nelson 78ccee01d4 Codechange: Scale sprite font height once on init instead of every call to GetHeight().
Scaling is not expensive, but it does not change either, and this avoids the need for a virtual method call. This cascades back to all GetCharacterHeight(FS_xxx) and FONT_HEIGHT_xxx calls.

(cherry picked from commit 9c6c0a0966)
3 years ago
Peter Nelson dc746288ce Cleanup: Use GetDefaultFontHeight() call instead of direct access.
This makes this part of font size setup in FreeTypeFontCache consist with OSX and Windows variants.

(cherry picked from commit ce55cd0ce7)
3 years ago
Peter Nelson b997bb0cee Fix: Cargo legend blob in cargo payment rate window did not rescale.
(cherry picked from commit 49aa392440)
3 years ago
Peter Nelson 2a87430036 Fix: Scale cargo lines in industry chain window.
Replaces constant pixel values with values scaled based on font size.
This allows the industry chain to maintain a consistent look across
different sizes. Previously all except cargo line height were fixed.

(cherry picked from commit 055067c49c)
3 years ago
Peter Nelson d3e70ff521 Fix: Scale industry chain legend blob by font size.
(cherry picked from commit 254ffe9dcc)
3 years ago
Peter Nelson f0a884bfa0 Fix: Improved scaling and spacing of sign list window.
Both company icon sprite and text now centred within each row, and extra
padding added to avoid the sprites running into each other.

(cherry picked from commit 957beaaefc)
3 years ago
Peter Nelson d7ed6d5ade Fix: Scale legend blobs in Fund new industry window.
(cherry picked from commit 617e85cc65)
3 years ago
Peter Nelson ce69d6e216 Fix: Scale smallmap legend 'blob' to fit text.
(cherry picked from commit 5434d63f91)
3 years ago
Peter Nelson 6e272df9b0 Fix: Tidy up sizing of sprite aligner window sprite list.
(cherry picked from commit af70195e44)
3 years ago
Peter Nelson c3cd3bae71 Fix: Company Key window scaling.
(cherry picked from commit 1df510c297)
3 years ago
Peter Nelson 1a904590cf Fix: Use unscaled values for padding OSK
(cherry picked from commit 09206be054)
3 years ago
Peter Nelson ff8d1222d9 Codechange: Use text lines instead of pixel height of font for link graph widgets.
(cherry picked from commit 56a6f66903)
3 years ago
Peter Nelson a4a0da1d4b Codechange: Apply minimum size to toolbar widgets
(cherry picked from commit 63cc340dc1)
3 years ago
Peter Nelson 2b233a2a8c Codechange: No longer necessary to manually resize volume sliders.
(cherry picked from commit d32df00b5c)
3 years ago
Peter Nelson a469b4f395 Fix: Recalculate padding and minimum sizes when GUI or Font zoom is changed.
(cherry picked from commit 4791ff2862)
3 years ago
Peter Nelson 43a3a233df Cleanup: Set unchanging scrollbar properties in constructor.
(cherry picked from commit 6fe5353da2)
3 years ago
Peter Nelson 1a4a6f579e Cleanup: Call SetMinimalSize instead of setting min_y directly.
(cherry picked from commit 03a43b8247)
3 years ago
Peter Nelson 23938cb583 Fix: Specify width when width is required instead of top.
(cherry picked from commit f5569763c9)
3 years ago
Peter Nelson 7bf0eefd36 Codechange: Simplify calling of DrawCharCentered()
(cherry picked from commit 2efa390a7d)
3 years ago
Peter Nelson 5a7e04e0d8 Cleanup: Tidy up resize, fill and minimal size on widgets in town list window.
(cherry picked from commit 4f93dd95e4)
3 years ago
Peter Nelson bdd55aad07 Cleanup: Remove fairly redundant DrawDropdown() function.
(cherry picked from commit 4c6cca459a)
3 years ago
Peter Nelson dc6055bd82 Cleanup: Horizontal widget size is commonly width rather than length.
(cherry picked from commit 5153e1b6e3)
3 years ago
rubidium42 da425711e1 Fix: String validation could leave invalid Utf8 encoded strings (#9096)
In case a character was encoded in multiple bytes, but required fewer bytes to be encoded, the first byte would be copied to the output leaving an invalid Utf8 encoded string. Later uses of the validated string would use the same decode logic, which would yield a question mark and just read a single byte, so nothing dangerous happened.
Furthermore, because the next byte would not be a first byte of an encoded Utf8 character, the last few valid characters could be removed by the validation as well.

(cherry picked from commit f00564eeb2)
3 years ago
PeterN 9d72eb02f5 Cleanup: Remove old FiosList helper methods. (#9139)
(cherry-picked from commit f018471b36)
3 years ago
glx22 050b95e351 Codechange: Replace FOR_ALL_CARGOSPECS with range-based for loops
(cherry picked from commit 9a8756d7ed)
3 years ago
glx22 dfe616bef4 Codechange: Replace window related FOR_ALL with range-based for loops
(cherry picked from commit 14e92bd8e2)
3 years ago
PeterN c7cac34025 Fix: 'Cache' top and bottom lines of textfile viewer to avoid overdraw. (#9131)
* Fix: 'Cache' top and bottom lines of textfile viewer to avoid overdraw.

The text file viewer calculated the number of lines required to set the scrollbar, but did not retain this information, so this was recalculated on every draw operation. This includes overdrawing text outside the bounds of the current scroll position.

With this change the top and bottom lines for each line of text are remembered, and reflowing is avoided where possible. Text outside the current scroll bounds is not drawn.
Additionally the scroll interval is now based on text lines instead of pixel lines, which increases the text capacity depending on the font size.

* Fix: Limit text viewer to showing 64k lines.

Text files with more than 64k wrapped lines would exceed the scrollbar capacity and cause an assert. This is harder to reach now that the scrollbar counts lines instead of pixels.

(cherry picked from commit 0b460bf4a1)
3 years ago
Loïc Guilloux 88bc7bd235 Fix: [MinGW] Set minimum OS version to Windows XP (#9135)
(cherry picked from commit 356bbbb90a)
3 years ago
Peter Nelson 4fc433c871 Cleanup: Replace FOR_ALL_SORTED_CARGOSPECS macro with range iterator.
(cherry picked from commit 20ac0b4148)
3 years ago
Peter Nelson 5e1b4e1844 Cleanup: Replace FOR_ALL_SORTED_ROADTYPES macro with range iterator.
(cherry picked from commit de81afdf4b)
3 years ago
Peter Nelson 571f807b20 Cleanup: Replace FOR_ALL_SORTED_RAILTYPES macro with range iterator.
(cherry picked from commit 3b3d80c8ef)
3 years ago
PeterN a4821e2732 Fix: Incorrect vertical alignment of icon and text in DropDownListIconItem. (#9133)
This happens if the bounding dimensions are changed so that each item is the same size, as happens on the railtype/roadtype dropdown lists, as the vertical offset was calculated before this dimension is changed.

(cherry picked from commit ae7f07de74)
3 years ago
Jonathan G Rennison 95ca147445 Add cheat: town local authority ratings fixed as Outstanding 3 years ago
Jonathan G Rennison a9515456cb Merge branch 'master' into jgrpp
# Conflicts:
#	src/network/core/os_abstraction.h
#	src/network/core/tcp_content.h
#	src/network/core/udp.cpp
#	src/table/currency_settings.ini
#	src/table/settings.h.preamble
3 years ago
Jonathan G Rennison e0d5bf584d Fix assertion failure when removing airport with order backup
See: #252, https://github.com/OpenTTD/OpenTTD/issues/9113
3 years ago
Jonathan G Rennison ca7dd193d4 Fix #253: Right column width in station window group/sort with large font 3 years ago
Jonathan G Rennison 743c9023c6 Doc: Add element IDs/link anchors to NewGRF additions 3 years ago
Patric Stout 0deb1d852d Remove: performance measurements in YAPF
YAPF was constantly measuring its performance, but only at
certain debug-levels this information was shown.

Now after years, I sincerely wonder if anyone still knows about this
feature and who still use it. Especially with the new framerate window,
this detailed performance is not as meaningful anymore as it once
was.

(cherry picked from commit 665a3928e2)
3 years ago
Patric Stout e0041df005 Cleanup: remove weird left-over comment in yapf.hpp
(cherry picked from commit e162aff7a3)
3 years ago
Jonathan G Rennison a809564bed Merge branch 'master' into jgrpp
# Conflicts:
#	src/lang/english.txt
#	src/lang/korean.txt
#	src/network/core/os_abstraction.h
#	src/network/core/packet.cpp
#	src/network/core/tcp_content.h
#	src/network/core/udp.cpp
#	src/table/currency_settings.ini
#	src/table/settings.h.preamble
3 years ago
Patric Stout 8fa53f543a
Change: [Network] lower TCP connect() timeout to 3s (#9112)
Currently we use default OS timeout for TCP connections, which
is around 30s. 99% of the users will never notice this, but there
are a few cases where this is an issue:

- If you have a broken IPv6 connection, using Content Service is
  first tried over IPv6. Only after 30s it times out and tries
  IPv4. Nobody is waiting for that 30s.
- Upcoming STUN support has several methods of establishing a
  connection between client and server. This requires feedback
  from connect() to know if any method worked (they have to be
  tried one by one). With 30s, this would take a very long time.

What is good to mention, is that there is no good value here. Any
value will have edge-cases where the experience is suboptimal. But
with 3s we support most of the stable connections, and if it fails,
the user can just retry. On the other side of the spectrum, with 30s,
it means the user has no possibility to use the service. So worst case
we annoy a few users with them having the retry vs annoying a few
users which have no means of resolving the situation.
3 years ago
rubidium42 015e3b412e Cleanup: remove #ifdefs for compiling the old content server 3 years ago
translators b89dba7e4e Update: Translations from eints
japanese: 26 changes by scabtert
catalan: 43 changes by J0anJosep
3 years ago