diff --git a/Makefile.bundle.in b/Makefile.bundle.in index ffa6a442e3..03e9583b99 100644 --- a/Makefile.bundle.in +++ b/Makefile.bundle.in @@ -58,7 +58,7 @@ ifdef OSXAPP $(Q)mkdir -p "$(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources" $(Q)echo "APPL????" > "$(BUNDLE_DIR)/$(OSXAPP)/Contents/PkgInfo" $(Q)cp "$(ROOT_DIR)/os/macosx/openttd.icns" "$(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/openttd.icns" - $(Q)$(ROOT_DIR)/os/macosx/plistgen.sh "$(BUNDLE_DIR)/$(OSXAPP)" "$(REV)" + $(Q)$(ROOT_DIR)/os/macosx/plistgen.sh "$(BUNDLE_DIR)/$(OSXAPP)" "$(VERSION)" $(Q)cp "$(ROOT_DIR)/os/macosx/splash.png" "$(BASESET_DIR)" endif ifeq ($(OS),UNIX) @@ -158,10 +158,10 @@ bundle_lha: bundle bundle_dmg: bundle @echo '[BUNDLE] Creating $(BUNDLE_NAME).dmg' - $(Q)mkdir -p "$(BUNDLES_DIR)/OpenTTD $(REV)" - $(Q)cp -R "$(BUNDLE_DIR)/" "$(BUNDLES_DIR)/OpenTTD $(REV)" - $(Q)hdiutil create -ov -format UDZO -srcfolder "$(BUNDLES_DIR)/OpenTTD $(REV)" "$(BUNDLES_DIR)/$(BUNDLE_NAME).dmg" - $(Q)rm -fr "$(BUNDLES_DIR)/OpenTTD $(REV)" + $(Q)mkdir -p "$(BUNDLES_DIR)/OpenTTD $(VERSION)" + $(Q)cp -R "$(BUNDLE_DIR)/" "$(BUNDLES_DIR)/OpenTTD $(VERSION)" + $(Q)hdiutil create -ov -format UDZO -srcfolder "$(BUNDLES_DIR)/OpenTTD $(VERSION)" "$(BUNDLES_DIR)/$(BUNDLE_NAME).dmg" + $(Q)rm -fr "$(BUNDLES_DIR)/OpenTTD $(VERSION)" bundle_exe: all @echo '[BUNDLE] Creating $(BUNDLE_NAME).exe' diff --git a/README.md b/README.md index 71c85fa053..833a4d8cf5 100644 --- a/README.md +++ b/README.md @@ -361,7 +361,7 @@ When you are sure it is not already reported you should: After you have done all that you can report the bug. Please include the following information in your bug report: -- OpenTTD version (PLEASE test the latest SVN/nightly build) +- OpenTTD version (PLEASE test the latest Git revision/nightly build) - Bug details, including instructions how to reproduce it - Platform (Windows, Linux, FreeBSD, …) and compiler (including version) if you compiled OpenTTD yourself. @@ -938,7 +938,7 @@ someone else may have already started translating to the same language. So, now that you have notified the development team about your intention to translate (You did, right? Of course you did.) you can pick up english.txt -(found in the SVN repository under /src/lang) and translate. +(found in the Git repository under /src/lang) and translate. You must change the first two lines of the file appropriately: diff --git a/azure-pipelines-ci.yml b/azure-pipelines-ci.yml index e71ab60ea4..d624f8ce73 100644 --- a/azure-pipelines-ci.yml +++ b/azure-pipelines-ci.yml @@ -17,37 +17,12 @@ jobs: BuildPlatform: 'x64' steps: - # Rebase to origin/master for every PR. This means users don't have to - # rebase every time master changes. As long as the PR applies cleanly, we - # will validate it. - - script: | - git config user.email 'info@openttd.org' - git config user.name 'OpenTTD CI' - git rebase origin/master - displayName: 'Rebase to master' - - bash: | - set -ex - curl -L https://github.com/OpenTTD/OpenTTD-CF/releases/download/latest/windows-dependencies.zip > windows-dependencies.zip - unzip windows-dependencies.zip - rm -f windows-dependencies.zip - displayName: 'Download dependencies' - workingDirectory: $(Build.ArtifactStagingDirectory) - - script: $(Build.ArtifactStagingDirectory)\windows-dependencies\vcpkg.exe integrate install - displayName: 'Install dependencies' - - bash: | - set -ex - cd bin/baseset - curl -L https://binaries.openttd.org/extra/opengfx/0.5.2/opengfx-0.5.2-all.zip > opengfx-0.5.2-all.zip - unzip opengfx-0.5.2-all.zip - rm -f opengfx-0.5.2-all.zip - displayName: 'Install OpenGFX' - - task: VSBuild@1 - displayName: 'Build' - inputs: - solution: 'projects/openttd_vs141.sln' - platform: $(BuildPlatform) - configuration: Release - maximumCpuCount: true + - template: azure-pipelines/templates/ci-git-rebase.yml + - template: azure-pipelines/templates/windows-dependencies.yml + - template: azure-pipelines/templates/ci-opengfx.yml + - template: azure-pipelines/templates/windows-build.yml + parameters: + BuildPlatform: $(BuildPlatform) - script: | call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86 cd projects @@ -67,22 +42,13 @@ jobs: linux-i386-gcc-6: {} steps: - # Rebase to origin/master for every PR. This means users don't have to - # rebase every time master changes. As long as the PR applies cleanly, we - # will validate it. - - script: | - git config user.email 'info@openttd.org' - git config user.name 'OpenTTD CI' - git rebase origin/master - displayName: 'Rebase to master' - - task: Docker@1 - displayName: 'Build and test' - inputs: - command: 'Run an image' - imageName: openttd/compile-farm-ci:$(Agent.JobName) - volumes: '$(Build.SourcesDirectory):$(Build.SourcesDirectory)' - workingDirectory: '$(Build.SourcesDirectory)' - runInBackground: false + - template: azure-pipelines/templates/ci-git-rebase.yml + # The dockers already have the dependencies installed + # The dockers already have OpenGFX installed + - template: azure-pipelines/templates/linux-build.yml + parameters: + Image: compile-farm-ci + Tag: $(Agent.JobName) - job: macos displayName: 'MacOS' @@ -90,27 +56,9 @@ jobs: vmImage: 'macOS-10.13' steps: - # Rebase to origin/master for every PR. This means users don't have to - # rebase every time master changes. As long as the PR applies cleanly, we - # will validate it. - - script: | - git config user.email 'info@openttd.org' - git config user.name 'OpenTTD CI' - git rebase origin/master - displayName: 'Rebase to master' - - script: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config lzo xz libpng - displayName: 'Install dependencies' - - bash: | - set -ex - mkdir -p ~/Documents/OpenTTD/baseset - cd ~/Documents/OpenTTD/baseset - wget https://binaries.openttd.org/extra/opengfx/0.5.2/opengfx-0.5.2-all.zip - unzip opengfx-0.5.2-all.zip - rm -f opengfx-0.5.2-all.zip - displayName: 'Install OpenGFX' - - script: './configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig --enable-static' - displayName: 'Configure' - - script: 'make -j2' - displayName: 'Build' + - template: azure-pipelines/templates/ci-git-rebase.yml + - template: azure-pipelines/templates/osx-dependencies.yml + - template: azure-pipelines/templates/ci-opengfx.yml + - template: azure-pipelines/templates/osx-build.yml - script: 'make regression' displayName: 'Test' diff --git a/azure-pipelines-release-stable.yml b/azure-pipelines-release-stable.yml new file mode 100644 index 0000000000..3c42c6bee5 --- /dev/null +++ b/azure-pipelines-release-stable.yml @@ -0,0 +1,7 @@ +trigger: none +pr: none + +jobs: +- template: azure-pipelines/templates/release.yml + parameters: + IsStableRelease: true diff --git a/azure-pipelines-release.yml b/azure-pipelines-release.yml new file mode 100644 index 0000000000..79e2da77ac --- /dev/null +++ b/azure-pipelines-release.yml @@ -0,0 +1,7 @@ +trigger: none +pr: none + +jobs: +- template: azure-pipelines/templates/release.yml + parameters: + IsStableRelease: false diff --git a/azure-pipelines/changelog.sh b/azure-pipelines/changelog.sh new file mode 100755 index 0000000000..71bc56fac7 --- /dev/null +++ b/azure-pipelines/changelog.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +tag=$(git describe --tags 2>/dev/null) + +# If we are a tag, show the part of the changelog that matches the tag. +# In case of a stable, also show all betas and RCs. +if [ -n "$tag" ]; then + grep="." + if [ "$(echo $tag | grep '-')" = "" ]; then + grep='^[0-9]\.[0-9]\.[0-9][^-]' + fi + next=$(cat changelog.txt | grep '^[0-9]' | awk 'BEGIN { show="false" } // { if (show=="true") print $0; if ($1=="'$tag'") show="true"} ' | grep "$grep" | head -n1 | sed 's/ .*//') + cat changelog.txt | awk 'BEGIN { show="false" } /^[0-9].[0-9].[0-9]/ { if ($1=="'$next'") show="false"; if ($1=="'$tag'") show="true";} // { if (show=="true") print $0 }' + exit 0 +fi + +# In all other cases, show the git log of the last 7 days +revdate=$(git log -1 --pretty=format:"%ci") +last_week=$(date -u -d "$revdate -7days" +"%Y-%m-%d %H:%M") +git log --after="${last_week}" --pretty=fuller diff --git a/azure-pipelines/manifest.sh b/azure-pipelines/manifest.sh new file mode 100755 index 0000000000..4d11972777 --- /dev/null +++ b/azure-pipelines/manifest.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +set -ex + +if [ -z "$1" ]; then + echo "Usage: $0 " + exit 1 +fi + +FOLDER=$1 + +if [ ! -e .version ] || [ ! -e .release_date ]; then + echo "This script should be executed in the root of an extracted source tarball" + exit 1 +fi + +# Find the name based on the version +if [ "${ISSTABLERELEASE}" = "true" ]; then + isTesting=$(cat .version | grep "RC\|beta" || true) + if [ -z "${isTesting}" ]; then + NAME="stable" + else + NAME="testing" + fi +else + NAME=$(cat .version | cut -d- -f2 | cut -d- -f-2) +fi + +# Convert the date to a YAML date +DATE=$(cat .release_date | tr ' ' T | sed 's/TUTC/:00-00:00/') +VERSION=$(cat .version) +BASE="openttd-${VERSION}" + +echo "name: ${NAME}" >> manifest.yaml +echo "date: ${DATE}" >> manifest.yaml +echo "base: ${BASE}-" >> manifest.yaml +echo "files:" >> manifest.yaml + +error="" +for i in $(ls ${FOLDER} | grep -v ".txt$\|.md$\|sum$" | sort); do + if [ -n "$(echo $i | grep pdb.xz)" ]; then continue; fi + if [ -n "$(echo $i | grep dbg.deb)" ]; then continue; fi + + if [ ! -e ${FOLDER}/$i.md5sum ] || [ ! -e ${FOLDER}/$i.sha1sum ] || [ ! -e ${FOLDER}/$i.sha256sum ]; then + echo "ERROR: missing checksum file for ${i}" 1>&2 + error="y" + continue + fi + + echo "- id: $i" >> manifest.yaml + echo " size: $(stat -c"%s" ${FOLDER}/$i)" >> manifest.yaml + echo " md5sum: $(cat ${FOLDER}/$i.md5sum | cut -d\ -f1)" >> manifest.yaml + echo " sha1sum: $(cat ${FOLDER}/$i.sha1sum | cut -d\ -f1)" >> manifest.yaml + echo " sha256sum: $(cat ${FOLDER}/$i.sha256sum | cut -d\ -f1)" >> manifest.yaml +done + +if [ -n "${error}" ]; then + echo "ERROR: exiting due to earlier errors" 1>&2 + exit 1 +fi diff --git a/azure-pipelines/templates/ci-git-rebase.yml b/azure-pipelines/templates/ci-git-rebase.yml new file mode 100644 index 0000000000..924302fee3 --- /dev/null +++ b/azure-pipelines/templates/ci-git-rebase.yml @@ -0,0 +1,9 @@ +steps: +# Rebase to origin/master for every PR. This means users don't have to +# rebase every time master changes. As long as the PR applies cleanly, we +# will validate it. +- script: | + git config user.email 'info@openttd.org' + git config user.name 'OpenTTD CI' + git rebase origin/master + displayName: 'Rebase to master' diff --git a/azure-pipelines/templates/ci-opengfx.yml b/azure-pipelines/templates/ci-opengfx.yml new file mode 100644 index 0000000000..098f0d2a69 --- /dev/null +++ b/azure-pipelines/templates/ci-opengfx.yml @@ -0,0 +1,8 @@ +steps: +- bash: | + set -ex + cd bin/baseset + curl -L https://binaries.openttd.org/extra/opengfx/0.5.2/opengfx-0.5.2-all.zip > opengfx-0.5.2-all.zip + unzip opengfx-0.5.2-all.zip + rm -f opengfx-0.5.2-all.zip + displayName: 'Install OpenGFX' diff --git a/azure-pipelines/templates/linux-build.yml b/azure-pipelines/templates/linux-build.yml new file mode 100644 index 0000000000..0e4fffefb0 --- /dev/null +++ b/azure-pipelines/templates/linux-build.yml @@ -0,0 +1,18 @@ +parameters: + Image: '' + Tag: '' + ContainerCommand: '' + +steps: +- task: Docker@1 + ${{ if eq(parameters.Image, 'compile-farm') }}: + displayName: 'Build' + ${{ if eq(parameters.Image, 'compile-farm-ci') }}: + displayName: 'Build and test' + inputs: + command: 'Run an image' + imageName: openttd/${{ parameters.Image }}:${{ parameters.Tag }} + volumes: '$(Build.SourcesDirectory):$(Build.SourcesDirectory)' + workingDirectory: '$(Build.SourcesDirectory)' + containerCommand: ${{ parameters.ContainerCommand }} + runInBackground: false diff --git a/azure-pipelines/templates/linux-claim-bundles.yml b/azure-pipelines/templates/linux-claim-bundles.yml new file mode 100644 index 0000000000..4434dfcc7d --- /dev/null +++ b/azure-pipelines/templates/linux-claim-bundles.yml @@ -0,0 +1,5 @@ +steps: +# Because we run the compile in a docker (under root), we are not owner +# of the 'bundles' folder. Fix that by executing a chown on it. +- bash: sudo chown -R $(id -u):$(id -g) bundles + displayName: 'Claim bundles folder back' diff --git a/azure-pipelines/templates/osx-build.yml b/azure-pipelines/templates/osx-build.yml new file mode 100644 index 0000000000..ae1724125d --- /dev/null +++ b/azure-pipelines/templates/osx-build.yml @@ -0,0 +1,5 @@ +steps: +- script: './configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig --enable-static' + displayName: 'Configure' +- script: 'make -j2' + displayName: 'Build' diff --git a/azure-pipelines/templates/osx-dependencies.yml b/azure-pipelines/templates/osx-dependencies.yml new file mode 100644 index 0000000000..c4b723c58b --- /dev/null +++ b/azure-pipelines/templates/osx-dependencies.yml @@ -0,0 +1,11 @@ +steps: +- script: | + set -ex + HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config lzo xz libpng + # Remove the dynamic libraries of these libraries, to ensure we use + # the static versions. That is important, as it is unlikely any + # end-user has these brew libraries installed. + rm /usr/local/Cellar/lzo/*/lib/*.dylib + rm /usr/local/Cellar/xz/*/lib/*.dylib + rm /usr/local/Cellar/libpng/*/lib/*.dylib + displayName: 'Install dependencies' diff --git a/azure-pipelines/templates/release-bundles.yml b/azure-pipelines/templates/release-bundles.yml new file mode 100644 index 0000000000..9c5a48b966 --- /dev/null +++ b/azure-pipelines/templates/release-bundles.yml @@ -0,0 +1,19 @@ +parameters: + CalculateChecksums: true + +steps: +- ${{ if eq(parameters.CalculateChecksums, true) }}: + - bash: | + set -ex + cd bundles + for i in $(ls); do + openssl dgst -r -md5 -hex $i > $i.md5sum + openssl dgst -r -sha1 -hex $i > $i.sha1sum + openssl dgst -r -sha256 -hex $i > $i.sha256sum + done + displayName: 'Calculate checksums' +- task: PublishBuildArtifacts@1 + displayName: 'Publish bundles' + inputs: + PathtoPublish: bundles/ + ArtifactName: bundles diff --git a/azure-pipelines/templates/release-fetch-source.yml b/azure-pipelines/templates/release-fetch-source.yml new file mode 100644 index 0000000000..8b43983067 --- /dev/null +++ b/azure-pipelines/templates/release-fetch-source.yml @@ -0,0 +1,20 @@ +# Fetch the source tarball as prepared by an earlier job. In there is the +# version predefined. This ensures we are all going to compile the same +# source with the same version. + +steps: +- checkout: none +- task: DownloadBuildArtifacts@0 + displayName: 'Download source' + inputs: + downloadType: specific + itemPattern: 'bundles/openttd-*-source.tar.xz' + downloadPath: '$(Build.ArtifactStagingDirectory)' +- bash: tar --xz -xf ../a/bundles/openttd-*-source.tar.xz --strip-components=1 + displayName: 'Extracting source' +- bash: | + set -e + VERSION=$(cat .version) + echo "${VERSION}" + echo "##vso[build.updatebuildnumber]${VERSION}" + displayName: 'Change BuildNumber to version' diff --git a/azure-pipelines/templates/release-manifest.yml b/azure-pipelines/templates/release-manifest.yml new file mode 100644 index 0000000000..5c076b30e9 --- /dev/null +++ b/azure-pipelines/templates/release-manifest.yml @@ -0,0 +1,13 @@ +steps: +- task: DownloadBuildArtifacts@0 + displayName: 'Download all bundles' + inputs: + downloadType: specific + itemPattern: 'bundles/*' + downloadPath: '$(Build.ArtifactStagingDirectory)' +- script: | + set -ex + ./azure-pipelines/manifest.sh ../a/bundles/ + mkdir -p bundles + mv manifest.yaml bundles/ + displayName: 'Create manifest.yaml' diff --git a/azure-pipelines/templates/release-prepare-source.yml b/azure-pipelines/templates/release-prepare-source.yml new file mode 100644 index 0000000000..22ec126b1f --- /dev/null +++ b/azure-pipelines/templates/release-prepare-source.yml @@ -0,0 +1,24 @@ +# Set the revisions, and remove the VCS files. +# This ensures everything else picks up on the predefined versions, and not +# that because of some build process the version all of a sudden changes. + +steps: +- script: | + set -ex + git checkout -B ${BUILD_SOURCEBRANCHNAME} + ./findversion.sh > .ottdrev + ./azure-pipelines/changelog.sh > .changelog + TZ='UTC' date +"%Y-%m-%d %H:%M UTC" > .release_date + cat .ottdrev | cut -f 1 -d$'\t' > .version + echo "Release Date: $(cat .release_date)" + echo "Revision: $(cat .ottdrev)" + echo "Version: $(cat .version)" + displayName: 'Create version files' +- script: | + set -e + VERSION=$(cat .version) + echo "${VERSION}" + echo "##vso[build.updatebuildnumber]${VERSION}" + displayName: 'Change BuildNumber to version' +- script: find . -iname .hg -or -iname .git -or -iname .svn | xargs rm -rf + displayName: 'Remove VCS information' diff --git a/azure-pipelines/templates/release.yml b/azure-pipelines/templates/release.yml new file mode 100644 index 0000000000..4daf66dedb --- /dev/null +++ b/azure-pipelines/templates/release.yml @@ -0,0 +1,169 @@ +parameters: + # If this is false, not all targets are triggered. For example: + # The NSIS installer for Windows and the creation of debs only work for + # releases. Not for any other type of binary. So they are skilled if this + # is set to false. + IsStableRelease: false + +jobs: +- job: source + displayName: 'Source' + pool: + vmImage: 'ubuntu-16.04' + + steps: + - template: release-prepare-source.yml + - script: | + set -ex + + # Rename the folder to openttd-NNN-source + mkdir openttd-$(Build.BuildNumber) + find . -maxdepth 1 -not -name . -not -name openttd-$(Build.BuildNumber) -exec mv {} openttd-$(Build.BuildNumber)/ \; + # Copy back release_date, as it is needed for the template 'release-bundles' + cp openttd-$(Build.BuildNumber)/.release_date .release_date + + mkdir bundles + tar --xz -cf bundles/openttd-$(Build.BuildNumber)-source.tar.xz openttd-$(Build.BuildNumber) + zip -9 -r -q bundles/openttd-$(Build.BuildNumber)-source.zip openttd-$(Build.BuildNumber) + displayName: 'Create bundle' + - template: release-bundles.yml + +- job: meta + displayName: 'Metadata' + pool: + vmImage: 'ubuntu-16.04' + dependsOn: source + + steps: + - template: release-fetch-source.yml + - script: | + set -ex + + mkdir -p bundles + cp .changelog bundles/changelog.txt + cp .release_date bundles/released.txt + cp README.md bundles/README.md + displayName: 'Copy meta files' + - template: release-bundles.yml + parameters: + CalculateChecksums: false + +- job: docs + displayName: 'Docs' + pool: + vmImage: 'ubuntu-16.04' + dependsOn: source + + steps: + - template: release-fetch-source.yml + - template: linux-build.yml + parameters: + Image: compile-farm + ContainerCommand: '$(Build.BuildNumber)' + Tag: docs + - template: linux-claim-bundles.yml + - template: release-bundles.yml + +- job: windows + displayName: 'Windows' + pool: + vmImage: 'VS2017-Win2016' + dependsOn: source + + strategy: + matrix: + Win32: + BuildPlatform: 'Win32' + BundlePlatform: 'win32' + Win64: + BuildPlatform: 'x64' + BundlePlatform: 'win64' + + steps: + - template: release-fetch-source.yml + - template: windows-dependencies.yml + - template: windows-dependency-zip.yml + - ${{ if eq(parameters.IsStableRelease, true) }}: + - template: windows-dependency-nsis.yml + - template: windows-build.yml + parameters: + BuildPlatform: $(BuildPlatform) + - bash: | + set -ex + make -f Makefile.msvc bundle_pdb bundle_zip PLATFORM=$(BundlePlatform) BUNDLE_NAME=openttd-$(Build.BuildNumber)-windows-$(BundlePlatform) + displayName: 'Create bundles' + - ${{ if eq(parameters.IsStableRelease, true) }}: + - bash: | + set -ex + # NSIS will be part of the Hosted image in the next update. Till then, we set the PATH ourself + export PATH="${PATH}:/c/Program Files (x86)/NSIS" + make -f Makefile.msvc bundle_exe PLATFORM=$(BundlePlatform) BUNDLE_NAME=openttd-$(Build.BuildNumber)-windows-$(BundlePlatform) + displayName: 'Create installer bundle' + - template: release-bundles.yml + +- ${{ if eq(parameters.IsStableRelease, true) }}: + - job: linux_stable + displayName: 'Linux' + pool: + vmImage: 'ubuntu-16.04' + dependsOn: source + + strategy: + matrix: + linux-ubuntu-xenial-i386-gcc: {} + linux-ubuntu-xenial-amd64-gcc: {} + linux-ubuntu-bionic-i386-gcc: {} + linux-ubuntu-bionic-amd64-gcc: {} + linux-debian-jessie-i386-gcc: {} + linux-debian-jessie-amd64-gcc: {} + linux-debian-stretch-i386-gcc: {} + linux-debian-stretch-amd64-gcc: {} + + steps: + - template: release-fetch-source.yml + - template: linux-build.yml + parameters: + Image: compile-farm + ContainerCommand: '$(Build.BuildNumber)' + Tag: $(Agent.JobName) + - template: linux-claim-bundles.yml + - template: release-bundles.yml + +- job: macos + displayName: 'MacOS' + pool: + vmImage: 'macOS-10.13' + dependsOn: source + + steps: + - template: release-fetch-source.yml + - template: osx-dependencies.yml + - template: osx-build.yml + - script: 'make bundle_zip bundle_dmg BUNDLE_NAME=openttd-$(Build.BuildNumber)-macosx' + displayName: 'Create bundles' + - template: release-bundles.yml + +- job: manifest + displayName: 'Manifest' + pool: + vmImage: 'ubuntu-16.04' + dependsOn: + - source + - docs + - windows + - ${{ if eq(parameters.IsStableRelease, true) }}: + - linux_stable + - macos + # "Skipped" is not a status, and is not succeeded. So it seems to be + # considered failed. So we trigger if all the earlier jobs are done (which + # might be succeeded, failed, or skipped), and run this job. This is not + # optimal, but given the rules, it is the only way to get this to work (as + # some jobs might be skipped). + condition: succeededOrFailed() + + steps: + - template: release-fetch-source.yml + - template: release-manifest.yml + - template: release-bundles.yml + parameters: + CalculateChecksums: false diff --git a/azure-pipelines/templates/windows-build.yml b/azure-pipelines/templates/windows-build.yml new file mode 100644 index 0000000000..5e12f2243f --- /dev/null +++ b/azure-pipelines/templates/windows-build.yml @@ -0,0 +1,11 @@ +parameters: + BuildPlatform: '' + +steps: +- task: VSBuild@1 + displayName: 'Build' + inputs: + solution: 'projects/openttd_vs141.sln' + platform: ${{ parameters.BuildPlatform }} + configuration: Release + maximumCpuCount: true diff --git a/azure-pipelines/templates/windows-dependencies.yml b/azure-pipelines/templates/windows-dependencies.yml new file mode 100644 index 0000000000..06f56e626b --- /dev/null +++ b/azure-pipelines/templates/windows-dependencies.yml @@ -0,0 +1,10 @@ +steps: +- bash: | + set -ex + curl -L https://github.com/OpenTTD/OpenTTD-CF/releases/download/latest/windows-dependencies.zip > windows-dependencies.zip + unzip windows-dependencies.zip + rm -f windows-dependencies.zip + displayName: 'Download dependencies' + workingDirectory: $(Build.ArtifactStagingDirectory) +- script: $(Build.ArtifactStagingDirectory)\windows-dependencies\vcpkg.exe integrate install + displayName: 'Install dependencies' diff --git a/azure-pipelines/templates/windows-dependency-nsis.yml b/azure-pipelines/templates/windows-dependency-nsis.yml new file mode 100644 index 0000000000..a1ee8f81e5 --- /dev/null +++ b/azure-pipelines/templates/windows-dependency-nsis.yml @@ -0,0 +1,28 @@ +parameters: + condition: true + +steps: +- bash: | + set -ex + # NSIS will be part of the Hosted image in the next update. Till then, we install it ourself + choco install nsis -y + + mkdir nsis-plugin; cd nsis-plugin + curl -L https://devs.openttd.org/~truebrain/nsis-plugins/Nsis7z.zip > Nsis7z.zip + unzip Nsis7z.zip + cp -R Plugins/* "/c/Program Files (x86)/NSIS/Plugins/" + cd ..; rm -rf nsis-plugin + + mkdir nsis-plugin; cd nsis-plugin + curl -L https://devs.openttd.org/~truebrain/nsis-plugins/NsisGetVersion.zip > NsisGetVersion.zip + unzip NsisGetVersion.zip + cp -R Plugins/* "/c/Program Files (x86)/NSIS/Plugins/x86-ansi/" + cd ..; rm -rf nsis-plugin + + mkdir nsis-plugin; cd nsis-plugin + curl -L https://devs.openttd.org/~truebrain/nsis-plugins/NsisFindProc.zip > NsisFindProc.zip + unzip NsisFindProc.zip + cp -R *.dll "/c/Program Files (x86)/NSIS/Plugins/x86-ansi/" + cd ..; rm -rf nsis-plugin + displayName: 'Install NSIS with the 7z, GetVersion, and FindProc plugins' + condition: and(succeeded(), ${{ parameters.condition }}) diff --git a/azure-pipelines/templates/windows-dependency-zip.yml b/azure-pipelines/templates/windows-dependency-zip.yml new file mode 100644 index 0000000000..e2ae06dbe7 --- /dev/null +++ b/azure-pipelines/templates/windows-dependency-zip.yml @@ -0,0 +1,5 @@ +steps: +- bash: | + set -ex + choco install zip + displayName: 'Install zip' diff --git a/bin/ai/regression/run.sh b/bin/ai/regression/run.sh index d47a664ea3..c9197c4d56 100755 --- a/bin/ai/regression/run.sh +++ b/bin/ai/regression/run.sh @@ -43,11 +43,11 @@ for tst in $tests; do if [ -n "$gdb" ]; then $gdb ./openttd -x -c ai/regression/regression.cfg $params -g $sav else - ./openttd -x -c ai/regression/regression.cfg $params -g $sav -d script=2 -d misc=9 2>&1 | awk '{ gsub("0x(\\(nil\\)|0+)(x0)?", "0x00000000", $0); gsub("^dbg: \\[script\\]", "", $0); gsub("^ ", "ERROR: ", $0); gsub("ERROR: \\[1\\] ", "", $0); gsub("\\[P\\] ", "", $0); print $0; }' | grep -v '^dbg: \[.*\]' > tmp.regression + ./openttd -x -c ai/regression/regression.cfg $params -g $sav -d script=2 -d misc=9 2>&1 | awk '{ gsub("0x(\\(nil\\)|0+)(x0)?", "0x00000000", $0); gsub("^dbg: \\[script\\]", "", $0); gsub("^ ", "ERROR: ", $0); gsub("ERROR: \\[1\\] ", "", $0); gsub("\\[P\\] ", "", $0); print $0; }' | grep -v '^dbg: \[.*\]' > $tst/tmp.regression fi if [ -z "$gdb" ]; then - res="`diff -ub $tst/result.txt tmp.regression`" + res="`diff -ub $tst/result.txt $tst/tmp.regression`" if [ -z "$res" ]; then echo "passed!" else @@ -58,14 +58,14 @@ for tst in $tests; do fi rm $tst/info.nut + + if [ "$1" != "-k" ]; then + rm -f $tst/tmp.regression + fi done if [ -f scripts/game_start.scr.regression ]; then mv scripts/game_start.scr.regression scripts/game_start.scr fi -if [ "$1" != "-k" ]; then - rm -f tmp.regression -fi - exit $ret diff --git a/bin/ai/regression/run.vbs b/bin/ai/regression/run.vbs index 88cea5c4eb..930562ec68 100644 --- a/bin/ai/regression/run.vbs +++ b/bin/ai/regression/run.vbs @@ -99,11 +99,11 @@ Function RunTest(test, params, ret) command = ".\openttd -x -c ai/regression/regression.cfg " & params & " -g " & sav & " -d script=2 -d misc=9" ' 2>&1 must be after >tmp.regression, else stderr is not redirected to the file - WshShell.Run "cmd /c " & command & " >tmp.regression 2>&1", 0, True + WshShell.Run "cmd /c " & command & " >"& test & "/tmp.regression 2>&1", 0, True - FilterFile "tmp.regression" + FilterFile test & "/tmp.regression" - If CompareFiles(test & "/result.txt", "tmp.regression") Then + If CompareFiles(test & "/result.txt", test & "/tmp.regression") Then RunTest = "passed!" Else RunTest = "failed!" @@ -111,6 +111,14 @@ Function RunTest(test, params, ret) End If FSO.DeleteFile test & "/info.nut" + + If WScript.Arguments.Count > 0 Then + If WScript.Arguments.Item(0) = "-k" Then + Exit Function + End If + End If + + FSO.DeleteFile test & "/tmp.regression" End Function On Error Resume Next @@ -143,12 +151,4 @@ If FSO.FileExists("scripts/game_start.scr.regression") Then FSO.MoveFile "scripts/game_start.scr.regression", "scripts/game_start.scr" End If -If WScript.Arguments.Count > 0 Then - If WScripts.Arguments.Items(0) = "-k" Then - WScript.Quit ret - End If -End If - -FSO.DeleteFile "tmp.regression" - WScript.Quit ret diff --git a/config.lib b/config.lib index 2e7208368e..18edb82782 100644 --- a/config.lib +++ b/config.lib @@ -1268,6 +1268,8 @@ make_compiler_cflags() { eval eval "ldflags=\\\$$4" eval eval "features=\\\$$5" + cppstd="-std=c++11" + if [ `echo "$version_line" | cut -d' ' -f1` = "icc" ]; then # Enable some things only for certain ICC versions cc_version=`$1 -dumpversion | cut -c 1-4 | sed s@\\\.@@g` @@ -1361,7 +1363,7 @@ make_compiler_cflags() { elif echo "$version_line" | grep -q "clang"; then # Enable some things only for certain clang versions # Need to try really hard to get the version line, because OSX clang likes to hide its true version - cc_version="`$1 -v 2>&1 | grep -i version | head -n 1 | sed s@[^0-9]@@g | cut -c 1-2`" + cc_version="`$1 -v 2>&1 | grep -i version | head -n 1 | sed s@[^0-9.]@@g | $awk -F . '{printf "%d%02d\n", $1, $2}'`" # aliasing rules are not held in openttd code flags="$flags -fno-strict-aliasing" @@ -1383,14 +1385,14 @@ make_compiler_cflags() { # it happens when using the FOR_ALL_WINDOWS_FROM_BACK_FROM macro flags="$flags -Wno-self-assign" - if [ "$cc_version" -lt "30" ]; then + if [ "$cc_version" -lt "300" ]; then # warning: equality comparison with extraneous parentheses flags="$flags -Wno-parentheses" # warning: operands of ? are integers of different signs: 'unsigned int' and 'int' flags="$flags -Wno-sign-compare" fi - if [ "$cc_version" -ge "30" ]; then + if [ "$cc_version" -ge "300" ]; then # warning: equality comparison with extraneous parentheses # this warning could be useful, but it warns about code in squirrel flags="$flags -Wno-parentheses-equality" @@ -1409,11 +1411,11 @@ make_compiler_cflags() { flags="$flags -Wno-unused-variable" fi - if [ "$cc_version" -ge "33" ]; then + if [ "$cc_version" -ge "303" ]; then # clang completed C++11 support in version 3.3 flags="$flags -DCUSTOM_ALLOCATOR" else - log 1 "configure: error: clang version is too old: `$1 -v 2>&1 | head -n 1`, minumum: 3.3" + log 1 "configure: error: clang version is too old: `$1 -v 2>&1 | grep -i version | head -n 1`, minumum: 3.3" exit 1 fi @@ -1436,6 +1438,7 @@ make_compiler_cflags() { flags="$flags -Wwrite-strings -Wpointer-arith" flags="$flags -W -Wno-unused-parameter -Wredundant-decls" flags="$flags -Wformat=2 -Wformat-security" + cppstd="-std=gnu++11" if [ $enable_assert -eq 0 ]; then # Do not warn about unused variables when building without asserts @@ -1531,7 +1534,7 @@ make_compiler_cflags() { fi eval "$2=\"$flags\"" - eval "$3=\"$cxxflags\"" + eval "$3=\"$cxxflags $cppstd\"" eval "$4=\"$ldflags\"" eval "$5=\"$features\"" } @@ -1595,8 +1598,6 @@ make_cflags_and_ldflags() { CFLAGS="$CFLAGS -D$os" CFLAGS_BUILD="$CFLAGS_BUILD -D$os" - CXXFLAGS="$CXXFLAGS -std=c++11" - CXXFLAGS_BUILD="$CXXFLAGS_BUILD -std=c++11" if [ "$enable_static" != "0" ]; then STATIC_FLAGS="--static" diff --git a/docs/HOWTO_compile_lang_files.txt b/docs/HOWTO_compile_lang_files.txt index c56f97a621..547854e508 100644 --- a/docs/HOWTO_compile_lang_files.txt +++ b/docs/HOWTO_compile_lang_files.txt @@ -29,7 +29,7 @@ english.txt to work. Below are some examples of strgen usage. 1.1) Examples ---- -------- Example 1: -if you are in the root of your working copy (svn code), you should type +if you are in the root of your working copy (git repository), you should type strgen/strgen -s lang lang/english.txt to compile englist.txt into english.lng. It will be placed in the lang dir @@ -50,7 +50,7 @@ You can interchange english.txt to whichever language you want to generate a 1.2) strgen command switches ---- ----------------------- -v | --version -strgen will tell what svn revision it was last modified +strgen will tell what git revision it was last modified -t | --todo strgen will add to any untranslated/missing strings and use the english diff --git a/docs/multiplayer.txt b/docs/multiplayer.txt index 7f4227cd8a..62314d7b4c 100644 --- a/docs/multiplayer.txt +++ b/docs/multiplayer.txt @@ -90,7 +90,7 @@ Table of contents - [network] sync_freq: change it in console with: 'set network.sync_freq ' the number should be between the 50 and 1000, not much lower, not much - higer. It indicates the time between sync-frames. A sync-frame is a frame + higher. It indicates the time between sync-frames. A sync-frame is a frame which checks if all clients are still in sync. When the value it too high, clients can desync in 1960, but the server detects it in 1970. Not really handy. The lower the value, the more bandwidth it uses. @@ -104,7 +104,7 @@ Table of contents - In UNIX like systems, you can fork your dedicated server by adding -f as parameter. - - You can automaticly clean companies that do not have a client connected to + - You can automatically clean companies that do not have a client connected to them, for, let's say, 3 years. You can do this via: 'set autoclean_companies' and 'set autoclean_protected' and 'set autoclean_unprotected'. Unprotected removes a password from a company when it is not used for more then the @@ -113,7 +113,7 @@ Table of contents - You can also do this manually via the console: 'reset_company'. - - You can let your server automaticly restart a map when, let's say, year 2030 + - You can let your server automatically restart a map when, let's say, year 2030 is reached. See 'set restart_game_date' for detail. - If you want to be on the server-list, enable Advertising. To do this, select diff --git a/findversion.sh b/findversion.sh index 8e704ad87f..a6e3817b60 100755 --- a/findversion.sh +++ b/findversion.sh @@ -74,8 +74,6 @@ if [ -d "$ROOT_DIR/.git" ]; then if [ -n "$TAG" ]; then VERSION="${TAG}" - elif [ "${BRANCH}" = "master" ]; then - VERSION="${ISODATE}-g${SHORTHASH}" else VERSION="${ISODATE}-${BRANCH}-g${SHORTHASH}" fi diff --git a/projects/openttd_vs140.vcxproj b/projects/openttd_vs140.vcxproj index 6433164933..e5b74aef1f 100644 --- a/projects/openttd_vs140.vcxproj +++ b/projects/openttd_vs140.vcxproj @@ -540,6 +540,7 @@ + diff --git a/projects/openttd_vs140.vcxproj.filters b/projects/openttd_vs140.vcxproj.filters index 487f101997..3e8cf9faaa 100644 --- a/projects/openttd_vs140.vcxproj.filters +++ b/projects/openttd_vs140.vcxproj.filters @@ -711,6 +711,9 @@ Header Files + + Header Files + Header Files diff --git a/projects/openttd_vs141.vcxproj b/projects/openttd_vs141.vcxproj index 9fea006f4f..f3cccf7f05 100644 --- a/projects/openttd_vs141.vcxproj +++ b/projects/openttd_vs141.vcxproj @@ -540,6 +540,7 @@ + diff --git a/projects/openttd_vs141.vcxproj.filters b/projects/openttd_vs141.vcxproj.filters index 487f101997..3e8cf9faaa 100644 --- a/projects/openttd_vs141.vcxproj.filters +++ b/projects/openttd_vs141.vcxproj.filters @@ -711,6 +711,9 @@ Header Files + + Header Files + Header Files diff --git a/source.list b/source.list index 22833f62c3..a0524ae10b 100644 --- a/source.list +++ b/source.list @@ -230,6 +230,7 @@ group.h group_gui.h group_type.h gui.h +guitimer_func.h heightmap.h highscore.h hotkeys.h diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 101a97d0a9..4b248f5efc 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -29,6 +29,7 @@ #include "../widgets/dropdown_func.h" #include "../hotkeys.h" #include "../core/geometry_func.hpp" +#include "../guitimer_func.h" #include "ai.hpp" #include "ai_gui.hpp" @@ -286,7 +287,7 @@ struct AISettingsWindow : public Window { bool clicked_increase; ///< Whether we clicked the increase or decrease button. bool clicked_dropdown; ///< Whether the dropdown is open. bool closing_dropdown; ///< True, if the dropdown list is currently closing. - int timeout; ///< Timeout for unclicking the button. + GUITimer timeout; ///< Timeout for unclicking the button. int clicked_row; ///< The clicked row of settings. int line_height; ///< Height of a row in the matrix widget. Scrollbar *vscroll; ///< Cache of the vertical scrollbar. @@ -505,7 +506,7 @@ struct AISettingsWindow : public Window { if (new_val != old_val) { this->ai_config->SetSetting(config_item.name, new_val); this->clicked_button = num; - this->timeout = 5; + this->timeout.SetInterval(150); } } else if (!bool_item && !config_item.complete_labels) { /* Display a query box so users can enter a custom value. */ @@ -568,9 +569,9 @@ struct AISettingsWindow : public Window { this->vscroll->SetCapacityFromWidget(this, WID_AIS_BACKGROUND); } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { - if (--this->timeout == 0) { + if (this->timeout.Elapsed(delta_ms)) { this->clicked_button = -1; this->SetDirty(); } diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 2bdd4a2176..0ec5620771 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -543,7 +543,7 @@ public: this->SelectFirstAvailableAirport(false); } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { CheckRedrawStationCoverage(this); } diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index 547d5c5b8b..1d1d819427 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -20,6 +20,7 @@ #include "articulated_vehicles.h" #include "tracerestrict.h" #include "core/random_func.hpp" +#include "vehiclelist.h" #include "table/strings.h" @@ -791,6 +792,9 @@ CommandCost CmdSetAutoReplace(TileIndex tile, DoCommandFlag flags, uint32 p1, ui if (flags & DC_EXEC) { GroupStatistics::UpdateAutoreplace(_current_company); if (IsLocalCompany()) SetWindowDirty(WC_REPLACE_VEHICLE, Engine::Get(old_engine_type)->type); + + const VehicleType vt = Engine::Get(old_engine_type)->type; + SetWindowDirty(GetWindowClassForVehicleType(vt), VehicleListIdentifier(VL_GROUP_LIST, vt, _current_company).Pack()); } if ((flags & DC_EXEC) && IsLocalCompany()) InvalidateAutoreplaceWindow(old_engine_type, id_g); diff --git a/src/clear_cmd.cpp b/src/clear_cmd.cpp index fa537bb5c2..f0c814ec47 100644 --- a/src/clear_cmd.cpp +++ b/src/clear_cmd.cpp @@ -233,16 +233,19 @@ static void TileLoopClearAlps(TileIndex tile) } /** - * Tests if at least one surrounding tile is desert + * Tests if at least one surrounding tile is non-desert * @param tile tile to check - * @return does this tile have at least one desert tile around? + * @return does this tile have at least one non-desert tile around? */ -static inline bool NeighbourIsDesert(TileIndex tile) +static inline bool NeighbourIsNormal(TileIndex tile) { - return GetTropicZone(tile + TileDiffXY( 1, 0)) == TROPICZONE_DESERT || - GetTropicZone(tile + TileDiffXY( -1, 0)) == TROPICZONE_DESERT || - GetTropicZone(tile + TileDiffXY( 0, 1)) == TROPICZONE_DESERT || - GetTropicZone(tile + TileDiffXY( 0, -1)) == TROPICZONE_DESERT; + for (DiagDirection dir = DIAGDIR_BEGIN; dir < DIAGDIR_END; dir++) { + TileIndex t = tile + TileOffsByDiagDir(dir); + if (!IsValidTile(t)) continue; + if (GetTropicZone(t) != TROPICZONE_DESERT) return true; + if (HasTileWaterClass(t) && GetWaterClass(t) == WATER_CLASS_SEA) return true; + } + return false; } static void TileLoopClearDesert(TileIndex tile) @@ -254,9 +257,7 @@ static void TileLoopClearDesert(TileIndex tile) /* Expected desert level - 0 if it shouldn't be desert */ uint expected = 0; if (GetTropicZone(tile) == TROPICZONE_DESERT) { - expected = 3; - } else if (NeighbourIsDesert(tile)) { - expected = 1; + expected = NeighbourIsNormal(tile) ? 1 : 3; } if (current == expected) return; diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 162395aba4..f48e381154 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -2217,16 +2217,16 @@ struct CompanyWindow : Window uint y = r.top; /* Collect rail and road counts. */ - uint rail_pices = c->infrastructure.signal; + uint rail_pieces = c->infrastructure.signal; uint road_pieces = 0; - for (uint i = 0; i < lengthof(c->infrastructure.rail); i++) rail_pices += c->infrastructure.rail[i]; + for (uint i = 0; i < lengthof(c->infrastructure.rail); i++) rail_pieces += c->infrastructure.rail[i]; for (uint i = 0; i < lengthof(c->infrastructure.road); i++) road_pieces += c->infrastructure.road[i]; - if (rail_pices == 0 && road_pieces == 0 && c->infrastructure.water == 0 && c->infrastructure.station == 0 && c->infrastructure.airport == 0) { + if (rail_pieces == 0 && road_pieces == 0 && c->infrastructure.water == 0 && c->infrastructure.station == 0 && c->infrastructure.airport == 0) { DrawString(r.left, r.right, y, STR_COMPANY_VIEW_INFRASTRUCTURE_NONE); } else { - if (rail_pices != 0) { - SetDParam(0, rail_pices); + if (rail_pieces != 0) { + SetDParam(0, rail_pieces); DrawString(r.left, r.right, y, STR_COMPANY_VIEW_INFRASTRUCTURE_RAIL); y += FONT_HEIGHT_NORMAL; } diff --git a/src/core/random_func.hpp b/src/core/random_func.hpp index 0c6b8f1ca7..ae476624e8 100644 --- a/src/core/random_func.hpp +++ b/src/core/random_func.hpp @@ -29,7 +29,7 @@ struct Randomizer { void SetSeed(uint32 seed); }; extern Randomizer _random; ///< Random used in the game state calculations -extern Randomizer _interactive_random; ///< Random used every else where is does not (directly) influence the game state +extern Randomizer _interactive_random; ///< Random used everywhere else, where it does not (directly) influence the game state /** Stores the state of all random number generators */ struct SavedRandomSeeds { diff --git a/src/currency.cpp b/src/currency.cpp index 615c5113bb..b87f77393b 100644 --- a/src/currency.cpp +++ b/src/currency.cpp @@ -63,6 +63,7 @@ static const CurrencySpec origin_currency_specs[CURRENCY_END] = { { 3, "", CF_NOEURO, "", NBSP "GEL", 1, STR_GAME_OPTIONS_CURRENCY_GEL }, ///< Georgian Lari { 4901, "", CF_NOEURO, "", NBSP "Rls", 1, STR_GAME_OPTIONS_CURRENCY_IRR }, ///< Iranian Rial { 80, "", CF_NOEURO, "", NBSP "rub", 1, STR_GAME_OPTIONS_CURRENCY_RUB }, ///< New Russian Ruble + { 24, "", CF_NOEURO, "$", "", 0, STR_GAME_OPTIONS_CURRENCY_MXN }, ///< Mexican peso }; /** Array of currencies used by the system */ diff --git a/src/currency.h b/src/currency.h index 2529aca11f..401df5ec1f 100644 --- a/src/currency.h +++ b/src/currency.h @@ -59,6 +59,7 @@ enum Currencies { CURRENCY_GEL, ///< Georgian Lari CURRENCY_IRR, ///< Iranian Rial CURRENCY_RUB, ///< New Russian Ruble + CURRENCY_MXN, ///< Mexican Peso CURRENCY_END, ///< always the last item }; diff --git a/src/departures_gui.cpp b/src/departures_gui.cpp index dde92ddd86..798a05f760 100644 --- a/src/departures_gui.cpp +++ b/src/departures_gui.cpp @@ -172,6 +172,8 @@ public: this->LowerWidget(WID_DB_SHOW_VIA); } + + if (_pause_mode != PM_UNPAUSED) this->OnGameTick(); } virtual ~DeparturesWindow() @@ -313,7 +315,7 @@ public: } } - virtual void OnTick() + virtual void OnGameTick() override { if (_pause_mode == PM_UNPAUSED) { this->tick_count += 1; diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index a66e2f6d96..2bb5153af6 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -454,7 +454,7 @@ public: } } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { CheckRedrawStationCoverage(this); } diff --git a/src/framerate_gui.cpp b/src/framerate_gui.cpp index 7e8e5f34fd..908cf81c0b 100644 --- a/src/framerate_gui.cpp +++ b/src/framerate_gui.cpp @@ -15,9 +15,9 @@ #include "window_gui.h" #include "table/sprites.h" #include "strings_func.h" -#include "debug.h" #include "console_func.h" #include "console_type.h" +#include "guitimer_func.h" #include "widgets/framerate_widget.h" @@ -295,7 +295,7 @@ static const NWidgetPart _framerate_window_widgets[] = { struct FramerateWindow : Window { bool small; - uint32 next_update; + GUITimer next_update; struct CachedDecimal { StringID strid; @@ -339,21 +339,24 @@ struct FramerateWindow : Window { this->InitNested(number); this->small = this->IsShaded(); this->UpdateData(); + this->next_update.SetInterval(100); } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { + bool elapsed = this->next_update.Elapsed(delta_ms); + /* Check if the shaded state has changed, switch caption text if it has */ if (this->small != this->IsShaded()) { this->small = this->IsShaded(); this->GetWidget(WID_FRW_CAPTION)->SetDataTip(this->small ? STR_FRAMERATE_CAPTION_SMALL : STR_FRAMERATE_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS); - this->next_update = 0; + elapsed = true; } - if (_realtime_tick >= this->next_update) { + if (elapsed) { this->UpdateData(); this->SetDirty(); - this->next_update = _realtime_tick + 100; + this->next_update.SetInterval(100); } } @@ -527,7 +530,7 @@ static const NWidgetPart _frametime_graph_window_widgets[] = { struct FrametimeGraphWindow : Window { int vertical_scale; ///< number of TIMESTAMP_PRECISION units vertically int horizontal_scale; ///< number of half-second units horizontally - uint32 next_scale_update; ///< realtime tick for next scale update + GUITimer next_scale_update; ///< interval for next scale update PerformanceElement element; ///< what element this window renders graph for Dimension graph_size; ///< size of the main graph area (excluding axis labels) @@ -537,7 +540,7 @@ struct FrametimeGraphWindow : Window { this->element = (PerformanceElement)number; this->horizontal_scale = 4; this->vertical_scale = TIMESTAMP_PRECISION / 10; - this->next_scale_update = 0; + this->next_scale_update.SetInterval(1); this->InitNested(number); } @@ -649,12 +652,12 @@ struct FrametimeGraphWindow : Window { this->SelectVerticalScale(peak_value); } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { this->SetDirty(); - if (this->next_scale_update < _realtime_tick) { - this->next_scale_update = _realtime_tick + 500; + if (this->next_scale_update.Elapsed(delta_ms)) { + this->next_scale_update.SetInterval(500); this->UpdateScale(); } } diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 48b8c4c84a..bbf1c22d62 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -539,7 +539,7 @@ public: if (widget == WID_CV_KEY_BUTTON) ShowGraphLegend(); } - virtual void OnTick() + virtual void OnGameTick() { this->UpdateStatistics(false); } @@ -998,9 +998,9 @@ struct PaymentRatesGraphWindow : BaseGraphWindow { } } - virtual void OnTick() + virtual void OnGameTick() { - /* Override default OnTick */ + /* Override default OnGameTick */ } /** @@ -1239,7 +1239,7 @@ public: } - virtual void OnTick() + virtual void OnGameTick() { if (this->companies.NeedResort()) { this->SetDirty(); @@ -1472,10 +1472,8 @@ struct PerformanceRatingDetailWindow : Window { } } - virtual void OnTick() + virtual void OnGameTick() { - if (_pause_mode != PM_UNPAUSED) return; - /* Update the company score every 5 days */ if (--this->timeout == 0) { this->UpdateCompanyStats(); diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp index d2ceffb5ed..1f945690cc 100644 --- a/src/group_cmd.cpp +++ b/src/group_cmd.cpp @@ -240,7 +240,7 @@ void GroupStatistics::Clear() stats.autoreplace_defined = true; stats.autoreplace_finished = true; } - if (stats.num_engines[erl->from] > 0) stats.autoreplace_finished = false; + if (GetGroupNumEngines(company, erl->group_id, erl->from) > 0) stats.autoreplace_finished = false; } } @@ -423,11 +423,12 @@ CommandCost CmdAlterGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 if (flags & DC_EXEC) { g->parent = (pg == NULL) ? INVALID_GROUP : pg->index; + GroupStatistics::UpdateAutoreplace(g->owner); } } if (flags & DC_EXEC) { - SetWindowDirty(WC_REPLACE_VEHICLE, g->vehicle_type); + InvalidateWindowData(WC_REPLACE_VEHICLE, g->vehicle_type, 1); InvalidateWindowData(GetWindowClassForVehicleType(g->vehicle_type), VehicleListIdentifier(VL_GROUP_LIST, g->vehicle_type, _current_company).Pack()); } diff --git a/src/group_gui.cpp b/src/group_gui.cpp index e11f5d703b..6dd1a96419 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -997,9 +997,8 @@ public: this->SetDirty(); } - virtual void OnTick() + virtual void OnGameTick() { - if (_pause_mode != PM_UNPAUSED) return; if (this->groups.NeedResort() || this->vehicles.NeedResort()) { this->SetDirty(); } diff --git a/src/guitimer_func.h b/src/guitimer_func.h new file mode 100644 index 0000000000..44ce042287 --- /dev/null +++ b/src/guitimer_func.h @@ -0,0 +1,65 @@ +/* $Id$ */ + +/* + * This file is part of OpenTTD. + * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. + * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . + */ + +/** @file guitimer_func.h GUI Timers. */ + +#ifndef GUITIMER_FUNC_H +#define GUITIMER_FUNC_H + +class GUITimer +{ +protected: + uint timer; + uint interval; + +public: + GUITimer() : timer(0), interval(0) { } + explicit GUITimer(uint interval) : timer(0), interval(interval) { } + + inline bool HasElapsed() const + { + return this->interval == 0; + } + + inline void SetInterval(uint interval) + { + this->timer = 0; + this->interval = interval; + } + + /** + * Count how many times the interval has elapsed. + * Use to ensure a specific amount of events happen within a timeframe, e.g. for animation. + * @param delta Time since last test. + * @return Number of times the interval has elapsed. + */ + inline uint CountElapsed(uint delta) + { + if (this->interval == 0) return 0; + uint count = delta / this->interval; + if (this->timer + (delta % this->interval) >= this->interval) count++; + this->timer = (this->timer + delta) % this->interval; + return count; + } + + /** + * Test if a timer has elapsed. + * Use to ensure an event happens only once within a timeframe, e.g. for window updates. + * @param delta Time since last test. + * @return True iff the timer has elapsed. + */ + inline bool Elapsed(uint delta) + { + if (this->CountElapsed(delta) == 0) return false; + this->SetInterval(0); + return true; + } +}; + +#endif /* GUITIMER_FUNC_H */ diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 3097834e6a..811553ade3 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -647,9 +647,8 @@ public: if (success && !_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); } - virtual void OnTick() + virtual void OnGameTick() { - if (_pause_mode != PM_UNPAUSED) return; if (!this->timer_enabled) return; if (--this->callback_timer == 0) { /* We have just passed another day. diff --git a/src/lang/afrikaans.txt b/src/lang/afrikaans.txt index 7f2a4528bd..2b4c5b950e 100644 --- a/src/lang/afrikaans.txt +++ b/src/lang/afrikaans.txt @@ -1252,6 +1252,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Verander STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Infrastruktuur onderhoud: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :As dit geaktiveer is sal dit veroorsaak dat infrastruktuur onderhoudskoste verhoog. Die koste groei oor-proporsioneel met die netwerk grootte, wat groter maatskappye meer as kleiner maatskappye benadeel + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Lughawes verval nooit nie: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Wanner hierdie stelling geaktiveer is, maak dit dat alle lughawens ewig beskikbaar bly, na hul bekendstelling datum diff --git a/src/lang/arabic_egypt.txt b/src/lang/arabic_egypt.txt index 06ae75e84d..b190e56e9b 100644 --- a/src/lang/arabic_egypt.txt +++ b/src/lang/arabic_egypt.txt @@ -1119,6 +1119,7 @@ STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :السماح ب STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}تغير هذا الخيار غير متاح عندما يكون هناك عربات STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :صيانة البنية التحتية: {STRING} + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :المطارات لا تنتهي صلاحيتها {STRING} STR_CONFIG_SETTING_WARN_LOST_VEHICLE :حذر إذا فقدت المركبة {STRING} diff --git a/src/lang/basque.txt b/src/lang/basque.txt index 3c33bc4533..308bb38bf9 100644 --- a/src/lang/basque.txt +++ b/src/lang/basque.txt @@ -1225,6 +1225,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Hau ezin STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Azpiegituren mantentze-lana: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Gaitua dagoenean, azpiegiturek mantentze kostuak eragiten dituzte. Kostuak garraio sarearekin proportzionalki hazten dira, hau da, kostu handiagoak izango dituzten konpainia handiagoek + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Aireportuei inoiz ez zaie epea amaitzen: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Gaitua badago, aireportu mota ezberdinak betirako egongo dira aukeran diff --git a/src/lang/belarusian.txt b/src/lang/belarusian.txt index bc0eaa9546..619435016f 100644 --- a/src/lang/belarusian.txt +++ b/src/lang/belarusian.txt @@ -1568,6 +1568,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Зьме STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Утрыманьне iнфраструктуры: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Калі ўключана, інфраструктура патрабуе выдаткаў на ўтрыманьне. Кошт расьце прапарцыянальна памерам сеткі, таму гэта больш датычыць вялікіх кампаніяў, ніж малых. + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Малыя аэрапорты ніколі не састарэюць: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Уключэньне гэтай наладкі робіць усе віды аэрапортаў даступнымі назаўжды. diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt index 54ed6800fb..36542b306b 100644 --- a/src/lang/brazilian_portuguese.txt +++ b/src/lang/brazilian_portuguese.txt @@ -1259,6 +1259,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Impossí STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Manutenção de Infraestrutura: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Quando ativado, infraestrutura gera custos de manutenção. O custo aumenta proporcionalmente à malha de transportes, afetando companhias maiores mais do que as menores + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Aeroportos nunca saem de linha: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Ativando essa config. mantém todos os tipos de aeroportos disponíveis à construção após sua introdução diff --git a/src/lang/bulgarian.txt b/src/lang/bulgarian.txt index ddb4d651da..7ebf982bf5 100644 --- a/src/lang/bulgarian.txt +++ b/src/lang/bulgarian.txt @@ -1246,6 +1246,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Пром STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Поддръжка на инфраструктурата: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Когато е разрешено, съществуват разходи за поддръжка на инфраструктурата. Разходите се увеличават пропорционално на размера на пътната мрежа, влияейки повече на големите компании отколкото на по-малките + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Летишата не губят валидност: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Разрешавайки тази настройка, всеки вид летище остава завинаги достъпно след неговото представяне diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index e1f2fcf65a..b178a20232 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -1257,6 +1257,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}No es po STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Manteniment de la infraestructura: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Quan està activat, la infraestructura provoca costos de manteniment. El cost creix proporcionalment al tamany de la xarxa de transport, afectant en conseqüència més a les companyies grosses que a les petites + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Els aeroports mai caduquen: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Activant aquesta opció fa que cada tipus d'aeroport estigui disponible per sempre després de la seva introducció diff --git a/src/lang/croatian.txt b/src/lang/croatian.txt index 7f811fead5..67e0cc4ff7 100644 --- a/src/lang/croatian.txt +++ b/src/lang/croatian.txt @@ -285,6 +285,7 @@ STR_COLOUR_ORANGE :Narančasta STR_COLOUR_BROWN :Smeđa STR_COLOUR_GREY :Siva STR_COLOUR_WHITE :Bijela +STR_COLOUR_RANDOM :Nasumično # Units used in OpenTTD STR_UNITS_VELOCITY_IMPERIAL :{COMMA}{NBSP}mph @@ -1025,6 +1026,7 @@ STR_GAME_OPTIONS_CURRENCY_CUSTOM :Proizvoljno... STR_GAME_OPTIONS_CURRENCY_GEL :Gruzijski Lari (GEL) STR_GAME_OPTIONS_CURRENCY_IRR :Iranski Rial (IRR) STR_GAME_OPTIONS_CURRENCY_RUB :Nove ruske rublje (RUB) +STR_GAME_OPTIONS_CURRENCY_MXN :Meksički Pesos (MXN) ############ end of currency region STR_GAME_OPTIONS_ROAD_VEHICLES_FRAME :{BLACK}Cestovna vozila @@ -1354,6 +1356,9 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Mijenjan STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Održavanje infrastrukture: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Kada je omogućeno, infrastruktura uzrokuje troškove održavanja. Cijena raste više nego proporcionalno s veličinom mreže, čime utječe veće tvrtke više od manjih +STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR :Početna boja za kompaniju: {STRING} +STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_HELPTEXT :Odaberi početnu boju za kompaniju + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Zračne luke nikad ne ističu: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Uključivanjem ove postavke čini svaku vrstu zračne luke dostupnom zauvijek nakon uvođenja @@ -2470,9 +2475,9 @@ STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP :{BLACK}Kombo si STR_BUILD_SIGNAL_ELECTRIC_PBS_TOOLTIP :{BLACK}Putni signal (električni){}Putni signal omogućava da više od jednog vlaka uđe istovremeno u signalni blok, ako vlak može rezervirati putanju do sigurnog zaustavnog mjesta. Standardne putne signale moguće je proći iz suprotnog smjera STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TOOLTIP :{BLACK}Jednosmjerni putni signal (električni){}Putni znak omogućava da više od jednog vlaka uđe istovremeno u signalni blok, ako vlak može rezervirati putanju do sigurnog zaustavnog mjesta. Jednosmjerne putne signale nije moguće proći iz suprotnog smjera. STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}Pretvaranje signala{}Kada je odabrano, klikanjem na postojeći signal pretvara taj signal u odabranu vrstu i varijantu, Ctrl+Klik mijenja postojeću varijantu. Shift+Klik prikazuje procjenu troška pretvorbe -STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}Gustoća signala prilikom izgradnje -STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}Smanji gustoću signala prilikom izgradnje -STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}Povećaj gustoću signala prilikom izgradnje +STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}Razmak između signala prilikom izgradnje +STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}Smanji razmak između signala prilikom izgradnje +STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}Povećaj razmak između signala prilikom izgradnje # Bridge selection window STR_SELECT_RAIL_BRIDGE_CAPTION :{WHITE}Odaberi željeznički most @@ -3955,6 +3960,7 @@ STR_ORDER_CONDITIONAL_AGE :Starost vozila STR_ORDER_CONDITIONAL_REQUIRES_SERVICE :Treba servis STR_ORDER_CONDITIONAL_UNCONDITIONALLY :Uvijek STR_ORDER_CONDITIONAL_REMAINING_LIFETIME :Preostali životni vijek (godina) +STR_ORDER_CONDITIONAL_MAX_RELIABILITY :Maksimalna pouzdanost STR_ORDER_CONDITIONAL_COMPARATOR_TOOLTIP :{BLACK}Kako usporediti podatke vozila sa zadanom vrijednošću STR_ORDER_CONDITIONAL_COMPARATOR_EQUALS :je jednako diff --git a/src/lang/czech.txt b/src/lang/czech.txt index 2853efdaa1..ffe94cc1c1 100644 --- a/src/lang/czech.txt +++ b/src/lang/czech.txt @@ -1343,6 +1343,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Toto nas STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Udržování infrastruktury: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Pokud je zapnuto, je třeba platit za údržbu infrastruktury. Náklady vzrůstají společně s velikostí dopravní sítě, takže velké společnosti platí více než malé. + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Žádný druh letiště nezastará: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Povolení této možnosti způsobí, že všechny druhy letišť zůstanou po uvedení dostupné napořád. (nezastarají). diff --git a/src/lang/danish.txt b/src/lang/danish.txt index 7b7d568253..d07bc431b7 100644 --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -1254,6 +1254,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Denne in STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Infrastruktur vedligeholdelse: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Når aktiveret, infrastruktur forårsager vedligeholdelsesomkostninger. Omkostningerne vokser over-proportional med nettets størrelse, hvilket påvirker større virksomheder mere end de små + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Lufthavnenes levealder udløber aldrig: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Aktiveres denne indstilling gøres at hver lufthavnstype forbliver tilgængelig for evigt efter dens indførelse diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index 623f07a90c..a9b0d6684c 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -1257,6 +1257,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Deze ins STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Onderhoud infrastructuur: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Wanneer dit is ingeschakeld, veroorzaakt de infrastructuur onderhoudskosten. De kosten groeien boven-proportioneel met de grootte van het netwerk, waardoor grotere bedrijven hierdoor meer worden beïnvloed dan kleinere + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Vliegvelden verlopen niet: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Het inschakelen van deze instelling zorgt ervoor dat elke luchthaven soort altijd beschikbaar blijft na de introductie diff --git a/src/lang/english.txt b/src/lang/english.txt index d456c08ce9..a504f39ca4 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -189,6 +189,7 @@ STR_COLOUR_ORANGE :Orange STR_COLOUR_BROWN :Brown STR_COLOUR_GREY :Grey STR_COLOUR_WHITE :White +STR_COLOUR_RANDOM :Random # Units used in OpenTTD STR_UNITS_VELOCITY_IMPERIAL :{COMMA}{NBSP}mph @@ -937,6 +938,7 @@ STR_GAME_OPTIONS_CURRENCY_CUSTOM :Custom... STR_GAME_OPTIONS_CURRENCY_GEL :Georgian Lari (GEL) STR_GAME_OPTIONS_CURRENCY_IRR :Iranian Rial (IRR) STR_GAME_OPTIONS_CURRENCY_RUB :New Russian Ruble (RUB) +STR_GAME_OPTIONS_CURRENCY_MXN :Mexican Peso (MXN) ############ end of currency region STR_GAME_OPTIONS_ROAD_VEHICLES_FRAME :{BLACK}Road vehicles @@ -1282,6 +1284,9 @@ STR_CONFIG_SETTING_NO_TRAIN_CRASH_OTHER_COMPANY_HELPTEXT :This setting is STR_CONFIG_SETTING_FLIP_DIRECTION_ALL_TRAINS :All train vehicles may be direction flipped in depot: {STRING2} STR_CONFIG_SETTING_FLIP_DIRECTION_ALL_TRAINS_HELPTEXT :Enable flipping the direction of all train vehicles in depots, even if it is not enabled by the NewGRF. +STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR :Starting company colour: {STRING2} +STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_HELPTEXT :Choose starting colour for the company + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Airports never expire: {STRING2} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Enabling this setting makes each airport type stay available forever after its introduction @@ -2589,9 +2594,9 @@ STR_BUILD_SIGNAL_ELECTRIC_PROG_TOOLTIP :{BLACK}Programm STR_BUILD_SIGNAL_ELECTRIC_PBS_TOOLTIP :{BLACK}Path Signal (electric){}A path signal allows more than one train to enter a signal block at the same time, if the train can reserve a path to a safe stopping point. Standard path signals can be passed from the back side STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TOOLTIP :{BLACK}One-way Path Signal (electric){}A path signal allows more than one train to enter a signal block at the same time, if the train can reserve a path to a safe stopping point. One-way path signals can't be passed from the back side STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}Signal Convert{}When selected, clicking an existing signal will convert it to the selected signal type and variant. Ctrl+Click will toggle the existing variant. Shift+Click shows estimated conversion cost -STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}Dragging signal density -STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}Decrease dragging signal density -STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}Increase dragging signal density +STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}Dragging signal distance +STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}Decrease dragging signal distance +STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}Increase dragging signal distance # Tracerestrict GUI STR_TRACE_RESTRICT_CONDITIONAL_COMPARATOR_EQUALS :is diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt index 60b53778fd..e08d6efd62 100644 --- a/src/lang/english_AU.txt +++ b/src/lang/english_AU.txt @@ -1230,6 +1230,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Changing STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Infrastructure maintenance: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :When enabled, infrastructure causes maintenance costs. The cost grows in proportion to the network size, thus affecting larger companies more than smaller ones + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Airports never expire: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Enabling this setting makes each airport type stay available forever after its introduction diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index 663d7e8543..f9a602eaaf 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -1255,6 +1255,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Changing STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Infrastructure maintenance: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :When enabled, infrastructure causes maintenance costs. The cost grows over-proportional with the network size, thus affecting bigger companies more than smaller ones + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Airports never expire: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Enabling this setting makes each airport type stay available forever after its introduction diff --git a/src/lang/esperanto.txt b/src/lang/esperanto.txt index 30795bbdf7..2ba061cdf0 100644 --- a/src/lang/esperanto.txt +++ b/src/lang/esperanto.txt @@ -1156,6 +1156,7 @@ STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Permesu trairaj STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Permesu trairajn strathaltejojn sur stratoj posedataj de konkurantoj: {STRING} STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Ne eblas ŝanĝi ĉi tiujn agordon dum veturiloj ĉeestas + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Flughavenoj neniam antikviĝas: {STRING} STR_CONFIG_SETTING_WARN_LOST_VEHICLE :Avertu se veturilo estas perdita: {STRING} diff --git a/src/lang/estonian.txt b/src/lang/estonian.txt index 3b489d00ec..058bd33747 100644 --- a/src/lang/estonian.txt +++ b/src/lang/estonian.txt @@ -1308,6 +1308,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Sõiduki STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Taristu hooldamine: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Taristuga kaasnevad halduskulud. Kulud kasvavad taristu hulga suhtes ebaproportsionaalselt, ning mõjutavad pigem suurettevõtteid + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Aegumatud lennuväljad: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Selle seade sisse lülitamine jätab kõik lennujaamade tüübid avatuks lõpmata ajaks peale nende avanemist diff --git a/src/lang/faroese.txt b/src/lang/faroese.txt index f17a68e495..e416cbb11b 100644 --- a/src/lang/faroese.txt +++ b/src/lang/faroese.txt @@ -1203,6 +1203,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Ikki mø STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Innakervis viðlílkahald: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Um gilda, innankervi elvir til viðlíkahalds kostnað. Kostnaðurin vaksur yvir-lutfalsliga við støddina á kervinum, og ávirkar harvið størri fyritøkur meira enn smærri fyritøkur + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Floghavnir ganga ongantíð út: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Gildan av hesi áseting ger at hvørt floghavna slag altíð er tøkt eftir tað er komi í nýtslu diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index 4e62196cb5..2bce4861b5 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -1256,6 +1256,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Tätä a STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Infrastruktuurin huoltokustannukset: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Mikäli käytössä, infrastruktuurista aiheutuu huoltokuluja. Kulut kasvavat suhteettomasti verkon kokoon nähden, täten ne vaikuttavat suurempiin yhtiöihin enemmän kuin pieniin + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Lentokentät eivät vanhene: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Mikäli käytössä, kaikki lentokenttätyypit ovat saatavilla ikuisesti niiden julkistamisen jälkeen diff --git a/src/lang/french.txt b/src/lang/french.txt index ec56c02c37..874ad03de0 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -190,6 +190,7 @@ STR_COLOUR_ORANGE :Orange STR_COLOUR_BROWN :Marron STR_COLOUR_GREY :Gris STR_COLOUR_WHITE :Blanc +STR_COLOUR_RANDOM :Aléatoire # Units used in OpenTTD STR_UNITS_VELOCITY_IMPERIAL :{COMMA}{NBSP}mph @@ -816,6 +817,7 @@ STR_NEWS_MERGER_TAKEOVER_TITLE :{BIG_FONT}{BLAC STR_PRESIDENT_NAME_MANAGER :{BLACK}{PRESIDENT_NAME}{}(Président) STR_NEWS_NEW_TOWN :{BLACK}{BIG_FONT}{STRING} a sponsorisé la construction de la nouvelle ville {TOWN}{NBSP}! +STR_NEWS_NEW_TOWN_UNSPONSORED :{BLACK}{BIG_FONT}Une nouvelle ville nommée {TOWN} a été construite{NBSP}! STR_NEWS_INDUSTRY_CONSTRUCTION :{BIG_FONT}{BLACK}Un{G 0 "" "" e} nouv{G 0 eau el elle} {STRING} en construction près de {TOWN}{NBSP}! STR_NEWS_INDUSTRY_PLANTED :{BIG_FONT}{BLACK}Un{G 0 "" "" e} nouv{G 0 eau el elle} {STRING} s'implante près de {TOWN}{NBSP}! @@ -1258,6 +1260,9 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Il n'est STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Entretien de l'infrastructure{NBSP}: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Si activé, les infrastructures entraineront des coût d'entretien. Le coût augmente proportionnellement à la taille du réseau, affectant les grosses compagnies plus que les petites +STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR :Couleur de la compagnie au démarrage{NBSP}: {STRING} +STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_HELPTEXT :Choisir la couleur de démarrage pour la compagnie + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Les aéroports n'expirent jamais{NBSP}: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Activer ce paramètre fait que chaque type d'aéroports reste toujours disponible après son introduction @@ -2701,36 +2706,36 @@ STR_ABOUT_COPYRIGHT_OPENTTD :{BLACK}OpenTTD # Framerate display window STR_FRAMERATE_CAPTION :{WHITE}Fréquence d'images STR_FRAMERATE_CAPTION_SMALL :{STRING}{WHITE} ({DECIMAL}x) -STR_FRAMERATE_RATE_GAMELOOP :{WHITE}Fréquence de simulation{NBSP}: {STRING} +STR_FRAMERATE_RATE_GAMELOOP :{BLACK}Fréquence de simulation{NBSP}: {STRING} STR_FRAMERATE_RATE_GAMELOOP_TOOLTIP :{BLACK}Nombre de ticks simulés par seconde. -STR_FRAMERATE_RATE_BLITTER :{WHITE}Fréquence des graphismes{NBSP}: {STRING} +STR_FRAMERATE_RATE_BLITTER :{BLACK}Fréquence des graphismes{NBSP}: {STRING} STR_FRAMERATE_RATE_BLITTER_TOOLTIP :{BLACK}Nombre d'images rendues par seconde. -STR_FRAMERATE_SPEED_FACTOR :{WHITE}Facteur de vitesse actuel{NBSP}: {DECIMAL}x +STR_FRAMERATE_SPEED_FACTOR :{BLACK}Facteur de vitesse actuel{NBSP}: {DECIMAL}x STR_FRAMERATE_SPEED_FACTOR_TOOLTIP :{BLACK}À quelle vitesse le jeu tourne actuellement, comparé à la vitesse attendue pour la simulation normale. STR_FRAMERATE_CURRENT :{WHITE}Actuel STR_FRAMERATE_AVERAGE :{WHITE}Moyen -STR_FRAMERATE_DATA_POINTS :{WHITE}Données basées sur {COMMA} mesures -STR_FRAMERATE_MS_GOOD :{LTBLUE}{DECIMAL}{WHITE} ms -STR_FRAMERATE_MS_WARN :{YELLOW}{DECIMAL}{WHITE} ms -STR_FRAMERATE_MS_BAD :{RED}{DECIMAL}{WHITE} ms -STR_FRAMERATE_FPS_GOOD :{LTBLUE}{DECIMAL}{WHITE} images/s -STR_FRAMERATE_FPS_WARN :{YELLOW}{DECIMAL}{WHITE} images/s -STR_FRAMERATE_FPS_BAD :{RED}{DECIMAL}{WHITE} images/s +STR_FRAMERATE_DATA_POINTS :{BLACK}Données basées sur {COMMA} mesures +STR_FRAMERATE_MS_GOOD :{LTBLUE}{DECIMAL} ms +STR_FRAMERATE_MS_WARN :{YELLOW}{DECIMAL} ms +STR_FRAMERATE_MS_BAD :{RED}{DECIMAL} ms +STR_FRAMERATE_FPS_GOOD :{LTBLUE}{DECIMAL} images/s +STR_FRAMERATE_FPS_WARN :{YELLOW}{DECIMAL} images/s +STR_FRAMERATE_FPS_BAD :{RED}{DECIMAL} images/s STR_FRAMERATE_GRAPH_MILLISECONDS :{TINY_FONT}{COMMA} ms STR_FRAMERATE_GRAPH_SECONDS :{TINY_FONT}{COMMA} s ############ Leave those lines in this order!! -STR_FRAMERATE_GAMELOOP :{WHITE}Total de la boucle de jeu{NBSP}: -STR_FRAMERATE_GL_ECONOMY :{WHITE} Traitement des marchandises{NBSP}: -STR_FRAMERATE_GL_TRAINS :{WHITE} Ticks des trains{NBSP}: +STR_FRAMERATE_GAMELOOP :{BLACK}Total de la boucle de jeu{NBSP}: +STR_FRAMERATE_GL_ECONOMY :{BLACK} Traitement des marchandises{NBSP}: +STR_FRAMERATE_GL_TRAINS :{BLACK} Ticks des trains{NBSP}: STR_FRAMERATE_GL_ROADVEHS :{WHITE} Ticks des véhicules routiers{NBSP}: -STR_FRAMERATE_GL_SHIPS :{WHITE} Ticks des navires{NBSP}: -STR_FRAMERATE_GL_AIRCRAFT :{WHITE} Ticks des aéroplanes{NBSP}: -STR_FRAMERATE_GL_LANDSCAPE :{WHITE} Ticks du monde{NBSP}: -STR_FRAMERATE_GL_LINKGRAPH :{WHITE} Délai du flux des marchandises{NBSP}: -STR_FRAMERATE_DRAWING :{WHITE}Rendu des graphismes{NBSP}: -STR_FRAMERATE_DRAWING_VIEWPORTS :{WHITE} Vues{NBSP}: -STR_FRAMERATE_VIDEO :{WHITE}Sortie vidéo{NBSP}: -STR_FRAMERATE_SOUND :{WHITE}Mixage sonore{NBSP}: +STR_FRAMERATE_GL_SHIPS :{BLACK} Ticks des navires{NBSP}: +STR_FRAMERATE_GL_AIRCRAFT :{BLACK} Ticks des aéroplanes{NBSP}: +STR_FRAMERATE_GL_LANDSCAPE :{BLACK} Ticks du monde{NBSP}: +STR_FRAMERATE_GL_LINKGRAPH :{BLACK} Délai du flux des marchandises{NBSP}: +STR_FRAMERATE_DRAWING :{BLACK}Rendu des graphismes{NBSP}: +STR_FRAMERATE_DRAWING_VIEWPORTS :{BLACK} Vues{NBSP}: +STR_FRAMERATE_VIDEO :{BLACK}Sortie vidéo{NBSP}: +STR_FRAMERATE_SOUND :{BLACK}Mixage sonore{NBSP}: ############ End of leave-in-this-order ############ Leave those lines in this order!! STR_FRAMETIME_CAPTION_GAMELOOP :Boucle de jeu @@ -2770,6 +2775,7 @@ STR_SAVELOAD_DETAIL_CAPTION :{BLACK}Détails STR_SAVELOAD_DETAIL_NOT_AVAILABLE :{BLACK}Pas d'informations disponibles STR_SAVELOAD_DETAIL_COMPANY_INDEX :{SILVER}{COMMA}{NBSP}: {WHITE}{STRING} STR_SAVELOAD_DETAIL_GRFSTATUS :{SILVER}NewGRF{NBSP}: {WHITE}{STRING} +STR_SAVELOAD_FILTER_TITLE :{BLACK}Filtre{NBSP}: STR_SAVELOAD_OSKTITLE :{BLACK}Entrer un nom pour la sauvegarde @@ -2968,6 +2974,8 @@ STR_NEWGRF_ERROR_READ_BOUNDS :Lecture après STR_NEWGRF_ERROR_GRM_FAILED :Indisponibilité de la ressource demandée (sprite {3:NUM}) STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} a été désactivé par {STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Format de sprite invalide ou inconnu (sprite {3:NUM}) +STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Trop d'éléments dans la liste des valeurs de la propriété (sprite {3:NUM}, propriété {4:HEX}) +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Fonction de rappel de production d'industrie invalide (sprite {3:NUM}, "{1:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Attention{NBSP}! @@ -3856,6 +3864,7 @@ STR_ORDER_CONDITIONAL_AGE :Âge du véhicu STR_ORDER_CONDITIONAL_REQUIRES_SERVICE :Entretien nécessaire STR_ORDER_CONDITIONAL_UNCONDITIONALLY :Toujours STR_ORDER_CONDITIONAL_REMAINING_LIFETIME :Durée de vie restante (années) +STR_ORDER_CONDITIONAL_MAX_RELIABILITY :Fiabilité maximum STR_ORDER_CONDITIONAL_COMPARATOR_TOOLTIP :{BLACK}Comment comparer les données du véhicule à la valeur donnée STR_ORDER_CONDITIONAL_COMPARATOR_EQUALS :est égal à diff --git a/src/lang/gaelic.txt b/src/lang/gaelic.txt index 79542e2900..776cbb0fe4 100644 --- a/src/lang/gaelic.txt +++ b/src/lang/gaelic.txt @@ -1453,6 +1453,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Cha ghab STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Cumail suas a' bhun-structair: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Nuair a bhios seo air, bidh cumail suas a' bhun-structair a' cosg airgid. Fàsaidh na cosgaisean nas luaithe na meud an lìonraidh, mar sin bheir an roghainn seo barrachd buaidh air companaidhean mòra + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Chan fhalbh an ùine air puirt-adhair: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Nuair a chuireas tu an roghainn seo an comas, cumaidh gach port-adhair a' dol gu bràth an dèidh a thogail diff --git a/src/lang/galician.txt b/src/lang/galician.txt index 93c487d3d9..7ce7e5d500 100644 --- a/src/lang/galician.txt +++ b/src/lang/galician.txt @@ -1252,6 +1252,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Non é p STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Mantemento de infraestrutura: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Cando se activa, a infraestrutura provoca custos de mantemento. O custo aumenta sobre-proporcionadamente co tamaño da rede, e afecta máis ás compañías máis grandes cás pequenas + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Os aeroportos nunca caducan: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Activar esta opción fai que cada tipo de aeroporto siga estando dispoñíbel para sempre dende a súa aparición diff --git a/src/lang/german.txt b/src/lang/german.txt index 001b4cf7a3..1616569b41 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -1271,6 +1271,7 @@ STR_CONFIG_SETTING_CHUNNEL_HELPTEXT :Wenn aktiviert, STR_CONFIG_SETTING_NO_TRAIN_CRASH_OTHER_COMPANY :Züge verschiedener Firmen stoßen nicht mehr zusammen: {STRING} STR_CONFIG_SETTING_NO_TRAIN_CRASH_OTHER_COMPANY_HELPTEXT :Diese Einstellung ist in erster Linie dafür da um zu verhindern, dass Spielern denen man nicht vertraut bewusst Zusammenstöße mit Zügen anderer Firmen in Multiplayer-Spielen mit Infrastructure Sharing provozieren. + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Flughäfen veralten nie: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Wird diese Option aktiviert, können Flughäfen, die einmal eingeführt wurden, das ganze Spiel über gebaut werden und veralten nie diff --git a/src/lang/greek.txt b/src/lang/greek.txt index 31a9d614b1..aac0881f3b 100644 --- a/src/lang/greek.txt +++ b/src/lang/greek.txt @@ -1362,6 +1362,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Δεν STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Συντήρηση υποδομής: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Όταν είναι ενεργοποιημένη, οι υποδομές προκαλούν έξοδα συντήρησης. Το κόστος μεγαλώνει δυσανάλογα με το μέγεθος του δικτύου, επηρεάζοντας έτσι τις μεγάλες εταιρείες περισσότερο από τις μικρότερες + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Τα αεροδρόμια δεν λήγουν ποτέ: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Ενεργοποιώντας αυτήν τη ρύθμιση κάθε τύπος αεροδρομίου παραμένει διαθέσιμο για πάντα μετά την παρουσίασή του diff --git a/src/lang/hebrew.txt b/src/lang/hebrew.txt index bc1d4fb83b..7b77cefa81 100644 --- a/src/lang/hebrew.txt +++ b/src/lang/hebrew.txt @@ -686,10 +686,12 @@ STR_MUSIC_TOOLTIP_TOGGLE_PROGRAM_SHUFFLE :{BLACK}עירב STR_MUSIC_TOOLTIP_SHOW_MUSIC_TRACK_SELECTION :{BLACK}הצג את חלון בחירת המנגינה # Playlist window +STR_PLAYLIST_MUSIC_SELECTION_SETNAME :{WHITE}תוכנית מוזיקה - '{STRING}' STR_PLAYLIST_TRACK_NAME :{TINY_FONT}{LTBLUE}{ZEROFILL_NUM} "{STRING}" STR_PLAYLIST_TRACK_INDEX :{TINY_FONT}{BLACK}רשימת רצועות STR_PLAYLIST_PROGRAM :{TINY_FONT}{BLACK}תוכנית- '{STRING}' STR_PLAYLIST_CLEAR :{TINY_FONT}{BLACK}מחק +STR_PLAYLIST_CHANGE_SET :{BLACK}ערכת שינוי STR_PLAYLIST_TOOLTIP_CLEAR_CURRENT_PROGRAM_CUSTOM1 :{BLACK}מחק תוכנית נוכחית STR_PLAYLIST_TOOLTIP_CLICK_TO_ADD_TRACK :{BLACK}(לחץ כאן כדי להוסיף לתוכנית הנוכחית(מותאם אישית1 או מותאם אישית 2 בלבד STR_PLAYLIST_TOOLTIP_CLICK_TO_REMOVE_TRACK :{BLACK}(לחץ על רצועה כדי להסיר אותה מהתוכנית הנוחכית(מותאם אישית 1 או מותאם אישית 2 בלבד @@ -1268,6 +1270,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}שינו STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :תחזוקת תשתיות: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :כאשר מאופשר, תשתיות גורמות לעלויות תחזוקה. העלות גדלה באופן שהוא מעבר ליחסי לעומת גודל הרשת, וכך משפיע יותר על חברות גדולות מאשר על חברות קטנות + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :בטל התיישנות נמלי תעופה: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :אפשור הגדרה זו גורם לכל סוג נמל תעופה להישאר זמין לעד אחרי השקתו @@ -1351,7 +1354,9 @@ STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_HELPTEXT :צבע פני STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_GREEN :ירוק STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_DARK_GREEN :ירוק כהה STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_VIOLET :סגול +STR_CONFIG_SETTING_SCROLLMODE :התנהגות גלילת תצוגה: {STRING} STR_CONFIG_SETTING_SCROLLMODE_DEFAULT :הזז את התצוגה עם כפתור עכבר ימני, מיקום העכבר נעול +STR_CONFIG_SETTING_SCROLLMODE_RMB_LOCKED :הזזת מפה עם כפתור עכבר ימני, מיקום העכבר נעול STR_CONFIG_SETTING_SCROLLMODE_LMB :הזז מפה עם כפתור עכבר שמאלי STR_CONFIG_SETTING_SMOOTH_SCROLLING :{STRING} :גלילה חלקה של התצוגה המשנית STR_CONFIG_SETTING_SMOOTH_SCROLLING_HELPTEXT :שלוט כיצד התצוגה הראשית נגללת למיקום מסוים כאשר מקליקים על המפה הקטנה אן כאשר נותנים הוראה לגלול לעצם מסוים על גבי המפה. אם מאופשר, חלון התצוגה נגלל באופן חלק, אם מבוטל הוא מוקפץ ישירות אל נקודת המטרה @@ -2704,19 +2709,34 @@ STR_ABOUT_VERSION :{BLACK}{REV} ג STR_ABOUT_COPYRIGHT_OPENTTD :{BLACK}OpenTTD {COPYRIGHT}2002-2018 The OpenTTD team # Framerate display window +STR_FRAMERATE_CAPTION :{WHITE}קצב ריענון STR_FRAMERATE_CAPTION_SMALL :{STRING}{WHITE} ({DECIMAL}x) STR_FRAMERATE_RATE_GAMELOOP :{WHITE}קצב סימולציה: {STRING} +STR_FRAMERATE_RATE_GAMELOOP_TOOLTIP :{BLACK}מספר פעימות משחק לשניה +STR_FRAMERATE_RATE_BLITTER_TOOLTIP :{BLACK}מספר פריימים של וידאו המעובדים בשניה STR_FRAMERATE_SPEED_FACTOR_TOOLTIP :{BLACK} כמה מהר המשחק כרגע רץ, בהשוואה למהירות הצפוייה בקצב סימולציה רגיל. +STR_FRAMERATE_CURRENT :נוכחי{WHITE} STR_FRAMERATE_DATA_POINTS :{WHITE}נתונים מבוססים על {COMMA} מדידות +STR_FRAMERATE_MS_GOOD :{LTBLUE}{DECIMAL} מילישניה +STR_FRAMERATE_FPS_GOOD :{LTBLUE}{DECIMAL} פריים/ים +STR_FRAMERATE_FPS_WARN :{YELLOW}{DECIMAL} פריים/ים +STR_FRAMERATE_FPS_BAD :{RED}{DECIMAL} פריים/ים +STR_FRAMERATE_GRAPH_SECONDS :{TINY_FONT}{COMMA} ש' ############ Leave those lines in this order!! +STR_FRAMERATE_GAMELOOP :{BLACK}סה"כ לולאת משחק: STR_FRAMERATE_GL_ROADVEHS :{WHITE} פעימות כלי רכב: STR_FRAMERATE_GL_SHIPS :{WHITE} פעימות כלי שייט: STR_FRAMERATE_GL_LANDSCAPE :{WHITE} נקודות עולם: STR_FRAMERATE_DRAWING :{WHITE}עיבוד גרפיקה: +STR_FRAMERATE_DRAWING_VIEWPORTS :{BLACK} תצוגות עולם: +STR_FRAMERATE_VIDEO :{BLACK}פלט וידאו: STR_FRAMERATE_SOUND :{WHITE} ערבוב צליל: ############ End of leave-in-this-order ############ Leave those lines in this order!! +STR_FRAMETIME_CAPTION_GAMELOOP :לולאת משחק +STR_FRAMETIME_CAPTION_GL_ECONOMY :טיפול במטען STR_FRAMETIME_CAPTION_GL_TRAINS :פעימות רכבת +STR_FRAMETIME_CAPTION_GL_LANDSCAPE :פעימות עולם STR_FRAMETIME_CAPTION_GL_LINKGRAPH :השהיית גרף קשרים STR_FRAMETIME_CAPTION_DRAWING :עיבוד גרפיקה STR_FRAMETIME_CAPTION_DRAWING_VIEWPORTS :עיבוד תצוגת עולם @@ -2746,6 +2766,7 @@ STR_SAVELOAD_DETAIL_CAPTION :{BLACK}פרטי STR_SAVELOAD_DETAIL_NOT_AVAILABLE :{BLACK}אין מידע זמין STR_SAVELOAD_DETAIL_COMPANY_INDEX :{SILVER}{COMMA}: {WHITE}{STRING} STR_SAVELOAD_DETAIL_GRFSTATUS :{SILVER}NewGRF: {WHITE}{STRING} +STR_SAVELOAD_FILTER_TITLE :{BLACK}מחרוזת סינון: STR_SAVELOAD_OSKTITLE :{BLACK}הכנס שם לשמירה @@ -3831,6 +3852,7 @@ STR_ORDER_CONDITIONAL_AGE :גיל (שני STR_ORDER_CONDITIONAL_REQUIRES_SERVICE :זקוק לטיפול STR_ORDER_CONDITIONAL_UNCONDITIONALLY :תמיד STR_ORDER_CONDITIONAL_REMAINING_LIFETIME :זמן חיים נותר (שנים) +STR_ORDER_CONDITIONAL_MAX_RELIABILITY :אמינות מירבית STR_ORDER_CONDITIONAL_COMPARATOR_TOOLTIP :{BLACK}כיצד יושוו נתוני כלי הרכב לערך נתון מסויים STR_ORDER_CONDITIONAL_COMPARATOR_EQUALS :שווה ל @@ -4515,6 +4537,7 @@ STR_BASESOUNDS_DOS_DESCRIPTION :צלילי Tran STR_BASESOUNDS_WIN_DESCRIPTION :צלילי Transport Tycoon Deluxe המקורי בגרסת Windows. STR_BASESOUNDS_NONE_DESCRIPTION :אוסף צלילים ללא צלילים. STR_BASEMUSIC_WIN_DESCRIPTION :מנגינות Transport Tycoon Deluxe המקורי בגרסת Windows. +STR_BASEMUSIC_DOS_DESCRIPTION :מנגינות Transport Tycoon Deluxe המקורי בגרסת DOS. STR_BASEMUSIC_TTO_DESCRIPTION :מנגינות Transport Tycoon Deluxe (Original/World Editor) המקורי בגרסת DOS. STR_BASEMUSIC_NONE_DESCRIPTION :אוסף מנגינות ללא מנגינות. diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index 3f96ecd254..7edd0661a8 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -1315,6 +1315,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}A beáll STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Az infrastruktúra fenntartási költségének engedélyezése: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Bekapcsolva az infrastruktúrának fenntartási költsége van. A költség hatványozottan nő a hálózatnagysággal, nagyobb hatással a nagyobb vállalatokra mint a kisebbekre + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Repülőterek nem avulnak el: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Bekapcsolva minden repülőtértípus örökké elérhető marad bevezetése után diff --git a/src/lang/icelandic.txt b/src/lang/icelandic.txt index 984ffde824..3e69cd8adf 100644 --- a/src/lang/icelandic.txt +++ b/src/lang/icelandic.txt @@ -1203,6 +1203,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Ekki er STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Viðhald á innviðum: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Ef þessi stilling er virk kostar að reka innviði fyrirtækisins. Kostnaður eykst í auknu hlutfalli við stærð fyrirtækisins, því eru áhrifin meiri á stór fyrirtæki en lítil + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Alltaf hægt að byggja allar gerðir flugvalla: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Ef þessi stilling er virk þá er hver tegund flugvallar alltaf aðgengileg eftir að hann verður fyrst aðgengilegur diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index a120f4b077..4322a67d19 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -1256,6 +1256,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Tidak di STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Pemeliharaan Infrastruktur: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Jika dinyalakan, infrastruktur membutuhkan biaya pemeliharaan. Biaya berkembang secara proporsional sesuai dengan ukuran jaringan, lebih berdampak pada perusahaan besar dari pada perusahaan kecil + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Bandara tidak kedaluarsa: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Menyalakan setelan ini membuat semua jenis bandara tetap ada selamanya sejak pendesainanya diff --git a/src/lang/irish.txt b/src/lang/irish.txt index 32153a23b1..af689a0ff4 100644 --- a/src/lang/irish.txt +++ b/src/lang/irish.txt @@ -1251,6 +1251,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Ní féi STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Cothabháil bonneagair: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Má tá sé cumasaithe, bíonn costais chothabhála ar bhonneagar. Méadaíonn an costas níos tapúla ná méid an líonra, rad a fhágann go mbíonn tionchar níos mó aige ar chuideachtaí móra ná ar chuideachtaí beaga + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Ní imíonn aerfoirt as dáta riamh: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Má dhéantar an socrú seo a chumasú beidh gach cineál aerfoirt ar fáil go deo tar éis é a thabhairt isteach diff --git a/src/lang/italian.txt b/src/lang/italian.txt index b02d31961f..085ba0e215 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -1282,6 +1282,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Non è p STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Manutenzione infrastrutture: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Se abilitata, le infrastrutture causano dei costi di manutenzione. I costi crescono in modo più che proporzionale alla dimensione della rete, influenzando maggiormente le compagnie più grandi rispetto alle piccole + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Non rendere mai obsoleti i tipi di aeroporto: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Abilitando questa impostazione, tutti i tipi di aeroporto rimangono disponibili indefinitamente dopo essere stati introdotti @@ -3889,6 +3890,7 @@ STR_ORDER_CONDITIONAL_AGE :Età (anni) STR_ORDER_CONDITIONAL_REQUIRES_SERVICE :Manutenzione richiesta STR_ORDER_CONDITIONAL_UNCONDITIONALLY :Sempre STR_ORDER_CONDITIONAL_REMAINING_LIFETIME :Vita rimanente (anni) +STR_ORDER_CONDITIONAL_MAX_RELIABILITY :Affidabilità massima STR_ORDER_CONDITIONAL_COMPARATOR_TOOLTIP :{BLACK}Modalità di confronto del dato del veicolo con il valore inserito STR_ORDER_CONDITIONAL_COMPARATOR_EQUALS :è uguale a diff --git a/src/lang/japanese.txt b/src/lang/japanese.txt index cee27168f3..34bed34ea5 100644 --- a/src/lang/japanese.txt +++ b/src/lang/japanese.txt @@ -1251,6 +1251,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}この STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :インフラ補修: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :有効にすると、インフラ設備にも維持費が発生するようになります。維持費はネットワークのサイズに非線形で比例する為、小さい会社よりも大きい会社の方が影響が大きくなります + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :空港の旧式化撤廃: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :有効にすると、いずれの種類の空港であっても、その開発後であれば永久に建設が可能になります diff --git a/src/lang/korean.txt b/src/lang/korean.txt index eed396f9bf..fec98e0f04 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -1282,6 +1282,7 @@ STR_CONFIG_SETTING_NO_TRAIN_CRASH_OTHER_COMPANY_HELPTEXT :이 옵션은 STR_CONFIG_SETTING_FLIP_DIRECTION_ALL_TRAINS :모든 열차가 차량기지에서 뒤집어질 수 있게 함: {STRING} STR_CONFIG_SETTING_FLIP_DIRECTION_ALL_TRAINS_HELPTEXT :NewGRF에서 차량기지에서 열차의 방향을 뒤집을 수 없도록 설정되어 있어도 무시하고 열차를 차량기지에서 뒤집을 수 있게 합니다. + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :옛날 공항을 사라지지 않고 계속 만들 수 있게 함: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :이 설정을 켜면, 소형 공항을 포함한 모든 공항 종류를 도입 이후에 계속 사용할 수 있게 됩니다. diff --git a/src/lang/latin.txt b/src/lang/latin.txt index 62c882239e..5ccd1c8ba1 100644 --- a/src/lang/latin.txt +++ b/src/lang/latin.txt @@ -1443,6 +1443,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Non lice STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Tuitio infrastructurae: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Electa, infrastructura prodit expensa tuitionis. Expensa crescunt celerius quam pro portione magnitudini retis, ergo societates magnae affectantur magis quam parvae + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Aeroportus numquam recedunt: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Electa, omnes aeroportuum typi permanent post introductionem diff --git a/src/lang/latvian.txt b/src/lang/latvian.txt index 5ea800384e..e41f181451 100644 --- a/src/lang/latvian.txt +++ b/src/lang/latvian.txt @@ -1236,6 +1236,7 @@ STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT :Ļauj būvēt c STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Šo iestatījumu nav iespējams mainīt, kad tur ir transportlīdzekļi STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Infrastruktūras uzturēšana: {STRING} + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Lidostas darbosies mūžīgi: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Ieslēdzot šo iestatījumu, katrs lidostas veids pēc tā ieviešanas vienmēr ir pieejams diff --git a/src/lang/lithuanian.txt b/src/lang/lithuanian.txt index b86e380faa..a87425bbdf 100644 --- a/src/lang/lithuanian.txt +++ b/src/lang/lithuanian.txt @@ -1456,6 +1456,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Neįmano STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Infrastruktūros priežiūra reikalauja išlaidų: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Infrastruktūros (kelių, geležinkelių, stotelių, angarą ir kitų objektų) priežiūra kainuoja. Kaštai auga proporcingai kompanijos dydžiui, taigi didesnėms kompanijoms infrastruktūros priežiūra kainuos daugiau, nei mažesnėms + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Oro uostai niekada nepasensta: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Kartą atsiradę, oro uostų tipai niekada nebepasens ir galimybė juos statyti niekuomet nebus pašalinta diff --git a/src/lang/luxembourgish.txt b/src/lang/luxembourgish.txt index 0830605ac5..d5496ef2a6 100644 --- a/src/lang/luxembourgish.txt +++ b/src/lang/luxembourgish.txt @@ -1251,6 +1251,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Déi Ast STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Infrastrukturënnerhalt {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Wann ugeschalt, kaschten Infrastrukturen Ennerhaltskäschten. D'Käschten wuessen iwwerproportional zu der Netzwierkgréisst, an treffen sou grouss Firmen méi wéi klenger + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Fluchhäfen lafen nie of: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Wann ugeschalt, bleift all Fluchhafentyp säit senger Aféierung bestoen diff --git a/src/lang/malay.txt b/src/lang/malay.txt index a84943dc83..3b105f8bba 100644 --- a/src/lang/malay.txt +++ b/src/lang/malay.txt @@ -1208,6 +1208,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Menukar STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Penyelenggaraan Infrastruktur: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Apabila diupayakan,infrastuktur menyebabkan kos penyelenggaraan. Kadar kos tumbuh berdasarkan saiz rangkaian, sekaligus menjejaskan syarikat yang lebih besar daripada yang kecil + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Lapangan terbang tidak akan tamat tempohnya: {STRING} STR_CONFIG_SETTING_WARN_LOST_VEHICLE :Beri amaran sekiranya kenderaan sesat: {STRING} diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt index f6d1c697e8..f0d2fcdccf 100644 --- a/src/lang/norwegian_bokmal.txt +++ b/src/lang/norwegian_bokmal.txt @@ -1254,6 +1254,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Det er i STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Vedlikehold av infrastruktur: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Når aktivert, medfører infrastruktur vedlikeholdskostnader. Kostnadene vokser over-proporsjonalt med nettverkets størrelse, og påvirker dermed større selskaper mer enn de små + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Flyplasser utgår aldri: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Aktivering av denne innstillingen gjør at hver type flyplass forblir tilgjengelig for alltid etter at sin introduksjon diff --git a/src/lang/norwegian_nynorsk.txt b/src/lang/norwegian_nynorsk.txt index 47e37ed9de..de756b93cc 100644 --- a/src/lang/norwegian_nynorsk.txt +++ b/src/lang/norwegian_nynorsk.txt @@ -1240,6 +1240,7 @@ STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT :Tillatt bygging STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Endring av denne instillinga er ikkje mogleg når det finst køyretøy STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Vedlikehald av infrastruktur: {STRING} + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Flyplassar utgår aldri: {STRING} STR_CONFIG_SETTING_WARN_LOST_VEHICLE :Advarsel om køyretøyet køyrer seg vill: {STRING} diff --git a/src/lang/polish.txt b/src/lang/polish.txt index 226b5aa751..5bba588bc2 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -1633,6 +1633,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Zmiana t STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Utrzymywanie infrastruktury: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Kiedy włączone, utrzymanie infrastruktury jest naliczane w kosztach. Koszty wzrastają nadproporcjonalnie do rozmiarów sieci połączeń, a więc dotykają bardziej duże niż małe firmy + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Pozwól budować stare lotniska: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Włączona opcja sprawia, że każdy typ lotniska będzie dostępny na zawsze od chwili wprowadzenia diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index a283ec0fcf..467c719832 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -1252,6 +1252,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Não é STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Manutenção de infraestruturas: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Quando activo, as infraestruturas têm custos de manutenção. O custo cresce mais do que proporcionalmente com o tamanho da rede e com isso afecta mais as companhias maiores comparado com as mais pequeneas + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Aeroportos nunca expiram: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Activar esta preferência torna cada tipo de aeroporto disponível para sempre após a sua introdução diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index 1d88e78f84..7542fd9c29 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -1245,6 +1245,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Schimbar STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Mentenanță infrastructură: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Cand este activă, infrastructura necesita cheltuieli cu intreținerea. Costurile cresc proporțional cu rețeaua de transport, afectând companiile mari mai mult decât companiile mici + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Aeroporturile nu expiră niciodată: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Activarea acestei opțiuni determina ca fiecare tip de aeroport sa fie disponibil permanent, după ce a fost introdus. diff --git a/src/lang/russian.txt b/src/lang/russian.txt index 0c08745d1f..11e43731c3 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -1411,6 +1411,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Изме STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Обслуживание инфраструктуры: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Включает затраты на содержание инфраструктуры. Стоимость непропорционально увеличивается с ростом транспортной сети, оказывая, таким образом, большее влияние на крупные компании, чем на малые. + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Аэропорты не устаревают: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :При включении все типы аэропортов доступны для строительства в любое время после их первоначального появления diff --git a/src/lang/serbian.txt b/src/lang/serbian.txt index cc9cb44b60..6f0d6c4a18 100644 --- a/src/lang/serbian.txt +++ b/src/lang/serbian.txt @@ -1450,6 +1450,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Promena STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Održavanje infrastrukture: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Ako je omogućeno, infrastruktura će imati troškove održavanja. Trošak raste brže sa porastom veličine putne mreže i time više pogađa veća preduzeća od manjih + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Nezastarevanje aerodroma: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Omogućavanje ovog podešavanja čini svaki tip aerodroma zauvek pristupan nakon njegovog uvođenja diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index eeb264d7af..38ece7aee9 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -1256,6 +1256,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}当有 STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :加强版固定资产维护: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :固定资产会发生维护费用,“打开”本选项时,维护费用的增长会超过交通网络的增长规模,因而,对大公司影响更大。 + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :总允许建设小型机场: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :“打开”此选项,每种类型机场出现后一直是可用的 diff --git a/src/lang/slovak.txt b/src/lang/slovak.txt index 4edda2d130..ba1b443e23 100644 --- a/src/lang/slovak.txt +++ b/src/lang/slovak.txt @@ -1319,6 +1319,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Zmena na STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Správa infraštruktúry: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Ak je zapnuté, infraštruktúra generuje výdavky na údržbu. Poplatky rastú proporcionálne s veľkosťou spoločnosti, čo ovplyvňuje viac veľké spoločnosti ako malé. + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Letiská nikdy neexiprujú: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Povoluje zachovať vsetky typy letísk navzdy. diff --git a/src/lang/slovenian.txt b/src/lang/slovenian.txt index 434ec23d70..b95a56ceec 100644 --- a/src/lang/slovenian.txt +++ b/src/lang/slovenian.txt @@ -1404,6 +1404,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Sprememb STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Vzdrževanje infrastrukture: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Če je omogočeno, infrastruktura upošteva vzdrževalne stroške, ki rastejo skozi čas proporcionalno z velikostjo omrežja. + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Letališča nikoli ne potečejo: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Če je omogočeno, bo vsak tip letališča ostal omogočen vedno po uvedbi. diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index 7497cc6f1f..3ba0a0ec4e 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -190,6 +190,7 @@ STR_COLOUR_ORANGE :Naranja STR_COLOUR_BROWN :Marrón STR_COLOUR_GREY :Gris STR_COLOUR_WHITE :Blanco +STR_COLOUR_RANDOM :Aleatorio # Units used in OpenTTD STR_UNITS_VELOCITY_IMPERIAL :{COMMA}{NBSP}mph @@ -374,7 +375,7 @@ STR_SCENEDIT_FILE_MENU_QUIT :Salir ############ range for settings menu starts STR_SETTINGS_MENU_GAME_OPTIONS :Opciones de juego STR_SETTINGS_MENU_CONFIG_SETTINGS_TREE :Configuración -STR_SETTINGS_MENU_SCRIPT_SETTINGS :Configuración de scripts +STR_SETTINGS_MENU_SCRIPT_SETTINGS :Configuración de Scripts STR_SETTINGS_MENU_NEWGRF_SETTINGS :Configuración NewGRF STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS :Opciones de transparencia STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED :Ver nombres de municipios @@ -1259,6 +1260,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Cambiar STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Mantenimiento de infraestructuras: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Cuando se activa, las infraestructuras tienen costes de mantenimiento. Los costes de la infraestructura aumentan con el tamaño de la red, con lo cual afectan a compañías grandes en mayor grado que a las pequeñas + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Aeropuertos nunca caducan: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Permite a todos los aeropuertos estar disponibles permanentemente una vez han sido introducidos @@ -4020,7 +4022,7 @@ STR_AI_GAME_SCRIPT_TOOLTIP :{BLACK}Comproba STR_ERROR_AI_NO_AI_FOUND :No se encontró IA apropiada para cargar.{}Ésta es una IA por defecto que no realiza acción alguna.{}Puedes descargar nuevas IA mediante el sistema de 'Contenido Online' STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}Uno de los scripts ejecutados ha fallado. Por favor, informe del fallo al autor del script con una captura de la ventana de depuración de Script / IA -STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}La ventana de depuración de scripts solo está disponible para el servidor +STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}La ventana de depuración de Scripts solo está disponible para el servidor # AI configuration window STR_AI_CONFIG_CAPTION :{WHITE}Configuración de Scripts de Juego / IA diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt index cd13c2dffc..5d8c262604 100644 --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -190,6 +190,7 @@ STR_COLOUR_ORANGE :Naranja STR_COLOUR_BROWN :Café STR_COLOUR_GREY :Gris STR_COLOUR_WHITE :Blanco +STR_COLOUR_RANDOM :Aleatorio # Units used in OpenTTD STR_UNITS_VELOCITY_IMPERIAL :{COMMA}{NBSP}mph @@ -1259,6 +1260,9 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}No se pu STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Mantenimiento de infraestructura: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Cuando se activa, la infraestructura tiene costo de mantenimiento, el cual aumenta en relación con el tamaño de la red de transporte. Esto afecta en mayor medida a las empresas grandes que a las pequeñas +STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR :Color inicial de la empresa: {STRING} +STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_HELPTEXT :Elegir el color inicial de la empresa + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Aeropuertos siempre disponibles: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Los tipos de aeropuertos estarán disponibles todo el tiempo tras haber sido introducidos @@ -3860,6 +3864,7 @@ STR_ORDER_CONDITIONAL_AGE :Edad (años) STR_ORDER_CONDITIONAL_REQUIRES_SERVICE :Requiere mantenimiento STR_ORDER_CONDITIONAL_UNCONDITIONALLY :Siempre STR_ORDER_CONDITIONAL_REMAINING_LIFETIME :Tiempo de vida restante (años) +STR_ORDER_CONDITIONAL_MAX_RELIABILITY :Fabilidad máxima STR_ORDER_CONDITIONAL_COMPARATOR_TOOLTIP :{BLACK}Comparación de los datos del vehículo respecto al valor dado STR_ORDER_CONDITIONAL_COMPARATOR_EQUALS :es igual a diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index 1602ff8fb5..9d7e72c4c3 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -1251,6 +1251,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Det är STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Underhåll av infrastruktur: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Om det är aktiverat så kostar underhåll av infrastruktur. Kostnaden ökar mer än proportionellt mot nätverkets storlek, vilket innebär att större företag drabbas hårdare än små företag av underhållskostnader. + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Flygplatser blir aldrig gamla: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Aktivering av denna inställning gör så att alla flygplatstyper finns kvar i obegränsad tid efter att de blivit tillgängliga diff --git a/src/lang/tamil.txt b/src/lang/tamil.txt index 77408ddb0b..0f00a95014 100644 --- a/src/lang/tamil.txt +++ b/src/lang/tamil.txt @@ -1173,6 +1173,7 @@ STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :வழிசெ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}வாகனங்கள் இருக்கும் பொது இந்த அமைப்பினை மாற்ற இயலாது STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :கட்டட பராமரிப்பு: {STRING} + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :விமான நிலையங்கள் என்றும் காலாவதியாகாது: {STRING} STR_CONFIG_SETTING_WARN_LOST_VEHICLE :வாகனம் தொலைந்தால் எச்சரிக்கை செய்: {STRING} diff --git a/src/lang/thai.txt b/src/lang/thai.txt index 03363214b3..c16b7c3a5c 100644 --- a/src/lang/thai.txt +++ b/src/lang/thai.txt @@ -1228,6 +1228,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}ไม STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :ค่าบำรุงรักษาโครงสร้างพื้นฐาน: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :เมื่อเปิดใช้งาน สาธารณูประโภคที่สร้างโดยบริษัทจะมีค่าบำรุงรักษา ยิ่งเครือข่ายยิ่งมากจะยิ่งเสียค่าใช้จ่ายมากขึ้น + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :ท่าอากาศยานไม่มีวันหมดอายุ: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :เปิดใช้งานสิ่งนี้ จะทำให้สามารถสร้างท่าอากาศยานแบบเก่าๆได้แม้เวลาจะผ่านไปนานแล้วก็ตาม diff --git a/src/lang/traditional_chinese.txt b/src/lang/traditional_chinese.txt index 6eb13007b2..cf2055f82f 100644 --- a/src/lang/traditional_chinese.txt +++ b/src/lang/traditional_chinese.txt @@ -1251,6 +1251,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}當有 STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :基礎建設維護: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :如啟用此選項,基礎建設會產生維護成本。該成本的增長會根據公司基礎建設的規模而加倍增大,因此該設定對大公司的影響比對小公司更大 + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :機場永不過期:{STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :如啟用此選項,所有機場一經面世,就永遠可以選擇建設 diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index 12cf4c2cb1..25aa67ec89 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -1252,6 +1252,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Araçlar STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Altyapı bakımları: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Etkinleştirildiğinde; altyapı, bakım giderine neden olur. Maliyet ağ büyüklüğüne göre daha hızlı yükselir, dolayısıyla büyük şirketleri küçüklere göre daha çok etkiler + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Havalimanlarının süresi asla dolmasın: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Bu ayarı etkinleştirmek her havaalanı türünün, tanıtımından sonra sürekli olarak kullanılabilir kalmasını sağlar. diff --git a/src/lang/ukrainian.txt b/src/lang/ukrainian.txt index 830d0d544e..78dfc02181 100644 --- a/src/lang/ukrainian.txt +++ b/src/lang/ukrainian.txt @@ -1379,6 +1379,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Цю н STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Витрати на утримання інфраструктури: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :При включенні інфраструктура потребує коштів для утримання. Витрати збільшуються не пропорційно з ростом розміру мережі, більше впливаючи на великі компанії ніж на малі + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Аеропорти не застарівають: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :При включенні кожен аеропорт буде доступним для будівництва безстроково після його впровадження. diff --git a/src/lang/unfinished/chuvash.txt b/src/lang/unfinished/chuvash.txt index 474c328f96..d8661586bc 100644 --- a/src/lang/unfinished/chuvash.txt +++ b/src/lang/unfinished/chuvash.txt @@ -573,6 +573,7 @@ STR_CONFIG_SETTING_HORIZONTAL_POS_RIGHT :Сылтӑмр STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_NONE :ҫук STR_CONFIG_SETTING_PLANE_CRASHES_NONE :ҫук + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Аэропорт кивел мар: {STRING} diff --git a/src/lang/unfinished/frisian.txt b/src/lang/unfinished/frisian.txt index 624eec2f33..2b3b80966e 100644 --- a/src/lang/unfinished/frisian.txt +++ b/src/lang/unfinished/frisian.txt @@ -1249,6 +1249,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}At der f STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Ynfrastruktuerûnderhâld: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :By ynskeakeljen binne der koster ferbûn oan it ûnderhâld fan ynfrastruktuer. De kosten wurde heger by gruttere netwurken wêrtoch gruttere bedriuwen hjir mear lêst fan hawwe + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Fleanfjilden ferrinne nea: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :By ynskeakeljen bliuwe alle fleanfjildtypes foar ivich beskikber diff --git a/src/lang/unfinished/ido.txt b/src/lang/unfinished/ido.txt index 114c434f36..41317c107c 100644 --- a/src/lang/unfinished/ido.txt +++ b/src/lang/unfinished/ido.txt @@ -533,6 +533,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :normala + STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_GREEN :Verda STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_DARK_GREEN :Obskur-verda STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_VIOLET :Violkolora diff --git a/src/lang/unfinished/macedonian.txt b/src/lang/unfinished/macedonian.txt index 30a0f142b1..7e19065f8b 100644 --- a/src/lang/unfinished/macedonian.txt +++ b/src/lang/unfinished/macedonian.txt @@ -843,6 +843,7 @@ STR_CONFIG_SETTING_SMOKE_AMOUNT :Износ на STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Инфраструктура за одржување: {STRING} + STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS :Дебелина на линии во графици: {STRING} diff --git a/src/lang/unfinished/maltese.txt b/src/lang/unfinished/maltese.txt index 4fc0e8cb10..b0f3aecdda 100644 --- a/src/lang/unfinished/maltese.txt +++ b/src/lang/unfinished/maltese.txt @@ -460,6 +460,7 @@ STR_CONFIG_SETTING_CITY_APPROVAL_HELPTEXT :Iddeċiedi kemm + STR_CONFIG_SETTING_WARN_LOST_VEHICLE :Avza jekk jintilef il-vehikolu: {STRING} diff --git a/src/lang/unfinished/marathi.txt b/src/lang/unfinished/marathi.txt index 4576bccbae..f5ff89ac9e 100644 --- a/src/lang/unfinished/marathi.txt +++ b/src/lang/unfinished/marathi.txt @@ -796,6 +796,7 @@ STR_CONFIG_SETTING_REALISTIC :खरेखु STR_CONFIG_SETTING_SMOKE_AMOUNT :वाहनांचा धूर/ठिणग्या: {STRING} + STR_CONFIG_SETTING_WARN_LOST_VEHICLE : वाहन हरवल्यास सूचित करा: {STRING} diff --git a/src/lang/unfinished/persian.txt b/src/lang/unfinished/persian.txt index 26458fd653..db65b1ca30 100644 --- a/src/lang/unfinished/persian.txt +++ b/src/lang/unfinished/persian.txt @@ -1167,6 +1167,7 @@ STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :اجازه اس STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}تغییر دادن این تنظیم هنگامی که خودرو وجود دارد ممکن نیست STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :تعمیر و نگهداری زیرساخت ها: {STRING} + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :فرودگاه‌ها هیچ‌گاه از کار نیافتند: {STRING} STR_CONFIG_SETTING_WARN_LOST_VEHICLE :اعلام هشدار هنگام گم شدن وسیله نقلیه: {STRING} diff --git a/src/lang/unfinished/urdu.txt b/src/lang/unfinished/urdu.txt index 877f429a9e..fa908a0b6c 100644 --- a/src/lang/unfinished/urdu.txt +++ b/src/lang/unfinished/urdu.txt @@ -1113,6 +1113,7 @@ STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :مد مقابل STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}جب گاڑیاں موجود ہوں تو یہ سیٹنگ بدلنا ممکن نہیں STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :انفراسٹرکچر کی بحالی: {STRING} + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :ہوائی اڈوں کی معیاد کبھی ختم نہ ہو: {STRING} STR_CONFIG_SETTING_WARN_LOST_VEHICLE :اگر گاڑی کھو جاے تو انتباہ کیجئیے: {STRING} diff --git a/src/lang/vietnamese.txt b/src/lang/vietnamese.txt index 7638a3a983..acb67de1fd 100644 --- a/src/lang/vietnamese.txt +++ b/src/lang/vietnamese.txt @@ -1258,6 +1258,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Không t STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Phí bảo trì cơ sở hạ tầng: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Khi mở, thì hạ tầng công ty sẽ sinh ra chi phí bảo trì. Chi phí sẽ tăng theo mạng lưới giao thông bạn xây dựng, và sẽ tiêu tốn của công ty lớn nhiều hơn công ty nhỏ + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Sân bay không bao giờ thành đồ cổ: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Bật tùy chọn này cho phép tất cả các loại sân bay không bị lỗi thời diff --git a/src/lang/welsh.txt b/src/lang/welsh.txt index eb969404e4..a0e34c1dce 100644 --- a/src/lang/welsh.txt +++ b/src/lang/welsh.txt @@ -1251,6 +1251,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Nid yw'n STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Cynnal a chadw tanadeiledd: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Pan fo wedi'i alluogi, mae tanadeiledd yn creu costau cynnal a chadw. Mae'r cost yn codi'n gyflymach na'i gyfradd gyda thŵf y rhwydwaith, gan effeithio'n fwy ar gwmniau mawr na rhai bychan + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Maes awyr ddim yn dibennu: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Mae galluogi'r dewis yma'n peri i bob math o faes awyr aros ar gael am byth wedi ei gyflwyniad gyntaf diff --git a/src/main_gui.cpp b/src/main_gui.cpp index d227ac208d..1c37c08f8e 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -32,6 +32,7 @@ #include "linkgraph/linkgraph_gui.h" #include "tilehighlight_func.h" #include "hotkeys.h" +#include "guitimer_func.h" #include "saveload/saveload.h" @@ -211,10 +212,11 @@ enum { struct MainWindow : Window { - uint refresh; + GUITimer refresh; - static const uint LINKGRAPH_REFRESH_PERIOD = 0xff; - static const uint LINKGRAPH_DELAY = 0xf; + /* Refresh times in milliseconds */ + static const uint LINKGRAPH_REFRESH_PERIOD = 7650; + static const uint LINKGRAPH_DELAY = 450; MainWindow(WindowDesc *desc) : Window(desc) { @@ -227,14 +229,14 @@ struct MainWindow : Window this->viewport->map_type = (ViewportMapType) _settings_client.gui.default_viewport_map_mode; this->viewport->overlay = new LinkGraphOverlay(this, WID_M_VIEWPORT, 0, 0, 3); - this->refresh = LINKGRAPH_DELAY; + this->refresh.SetInterval(LINKGRAPH_DELAY); } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { - if (--this->refresh > 0) return; + if (!this->refresh.Elapsed(delta_ms)) return; - this->refresh = LINKGRAPH_REFRESH_PERIOD; + this->refresh.SetInterval(LINKGRAPH_REFRESH_PERIOD); if (this->viewport->overlay->GetCargoMask() == 0 || this->viewport->overlay->GetCompanyMask() == 0) { @@ -430,7 +432,7 @@ struct MainWindow : Window this->viewport->scrollpos_y += ScaleByZoom(delta.y, this->viewport->zoom); this->viewport->dest_scrollpos_x = this->viewport->scrollpos_x; this->viewport->dest_scrollpos_y = this->viewport->scrollpos_y; - this->refresh = LINKGRAPH_DELAY; + this->refresh.SetInterval(LINKGRAPH_DELAY); } virtual void OnMouseWheel(int wheel) @@ -449,7 +451,7 @@ struct MainWindow : Window if (this->viewport != NULL) { NWidgetViewport *nvp = this->GetWidget(WID_M_VIEWPORT); nvp->UpdateViewportCoordinates(this); - this->refresh = LINKGRAPH_DELAY; + this->refresh.SetInterval(LINKGRAPH_DELAY); } } diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index f2e9d3a700..ec123b871f 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -28,6 +28,7 @@ #include "zoom_func.h" #include "tunnelbridge_map.h" #include "viewport_type.h" +#include "guitimer_func.h" #include "widgets/misc_widget.h" @@ -486,16 +487,18 @@ static const char * const _credits[] = { struct AboutWindow : public Window { int text_position; ///< The top of the scrolling text - byte counter; ///< Used to scroll the text every 5 ticks int line_height; ///< The height of a single line static const int num_visible_lines = 19; ///< The number of lines visible simultaneously + static const uint TIMER_INTERVAL = 150; ///< Scrolling interval in ms + GUITimer timer; + AboutWindow() : Window(&_about_desc) { this->InitNested(WN_GAME_OPTIONS_ABOUT); - this->counter = 5; this->text_position = this->GetWidget(WID_A_SCROLLING_TEXT)->pos_y + this->GetWidget(WID_A_SCROLLING_TEXT)->current_y; + this->timer.SetInterval(TIMER_INTERVAL); } virtual void SetStringParameters(int widget) const @@ -536,11 +539,11 @@ struct AboutWindow : public Window { } } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { - if (--this->counter == 0) { - this->counter = 5; - this->text_position--; + uint count = this->timer.CountElapsed(delta_ms); + if (count > 0) { + this->text_position -= count; /* If the last text has scrolled start a new from the start */ if (this->text_position < (int)(this->GetWidget(WID_A_SCROLLING_TEXT)->pos_y - lengthof(_credits) * this->line_height)) { this->text_position = this->GetWidget(WID_A_SCROLLING_TEXT)->pos_y + this->GetWidget(WID_A_SCROLLING_TEXT)->current_y; diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 2be8b13edc..952ed3ee03 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -33,6 +33,7 @@ #include "../map_type.h" #include "../newgrf.h" #include "../error.h" +#include "../guitimer_func.h" #include "../widgets/network_widget.h" @@ -236,6 +237,7 @@ protected: Scrollbar *vscroll; ///< vertical scrollbar of the list of servers QueryString name_editbox; ///< Client name editbox. QueryString filter_editbox; ///< Editbox for filter on servers + GUITimer requery_timer; ///< Timer for network requery int lock_offset; ///< Left offset for lock icon. int blot_offset; ///< Left offset for green/yellow/red compatibility icon. @@ -482,6 +484,8 @@ public: this->server = this->last_joined; if (this->last_joined != NULL) NetworkUDPQueryServer(this->last_joined->address); + this->requery_timer.SetInterval(MILLISECONDS_PER_TICK); + this->servers.SetListing(this->last_sorting); this->servers.SetSortFuncs(this->sorter_funcs); this->servers.SetFilterFuncs(this->filter_funcs); @@ -905,8 +909,11 @@ public: this->vscroll->SetCapacityFromWidget(this, WID_NG_MATRIX); } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { + if (!this->requery_timer.Elapsed(delta_ms)) return; + this->requery_timer.SetInterval(MILLISECONDS_PER_TICK); + NetworkGameListRequery(); } }; diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index e86409f96a..08f399fbcc 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -30,6 +30,7 @@ #include "textfile_gui.h" #include "tilehighlight_func.h" #include "fios.h" +#include "guitimer_func.h" #include "widgets/newgrf_widget.h" #include "widgets/misc_widget.h" @@ -150,7 +151,7 @@ struct NewGRFParametersWindow : public Window { bool clicked_increase; ///< True if the increase button was clicked, false for the decrease button. bool clicked_dropdown; ///< Whether the dropdown is open. bool closing_dropdown; ///< True, if the dropdown list is currently closing. - int timeout; ///< How long before we unpress the last-pressed button? + GUITimer timeout; ///< How long before we unpress the last-pressed button? uint clicked_row; ///< The selected parameter int line_height; ///< Height of a row in the matrix widget. Scrollbar *vscroll; @@ -162,7 +163,6 @@ struct NewGRFParametersWindow : public Window { clicked_button(UINT_MAX), clicked_dropdown(false), closing_dropdown(false), - timeout(0), clicked_row(UINT_MAX), editable(editable) { @@ -403,7 +403,7 @@ struct NewGRFParametersWindow : public Window { par_info->SetValue(this->grf_config, val); this->clicked_button = num; - this->timeout = 5; + this->timeout.SetInterval(150); } } else if (par_info->type == PTYPE_UINT_ENUM && !par_info->complete_labels && click_count >= 2) { /* Display a query box so users can enter a custom value. */ @@ -483,9 +483,9 @@ struct NewGRFParametersWindow : public Window { } } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { - if (--this->timeout == 0) { + if (timeout.Elapsed(delta_ms)) { this->clicked_button = UINT_MAX; this->SetDirty(); } diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 71a39eb3a9..b79418c899 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -33,6 +33,7 @@ #include "command_func.h" #include "company_base.h" #include "settings_internal.h" +#include "guitimer_func.h" #include "widgets/news_widget.h" @@ -260,17 +261,21 @@ struct NewsWindow : Window { uint16 chat_height; ///< Height of the chat window. uint16 status_height; ///< Height of the status bar window const NewsItem *ni; ///< News item to display. - static uint duration; ///< Remaining time for showing current news message (may only be accessed while a news item is displayed). + static int duration; ///< Remaining time for showing the current news message (may only be access while a news item is displayed). + + GUITimer timer; NewsWindow(WindowDesc *desc, const NewsItem *ni) : Window(desc), ni(ni) { - NewsWindow::duration = 555; + NewsWindow::duration = 16650; const Window *w = FindWindowByClass(WC_SEND_NETWORK_MSG); this->chat_height = (w != NULL) ? w->height : 0; this->status_height = FindWindowById(WC_STATUS_BAR, 0)->height; this->flags |= WF_DISABLE_VP_SCROLL; + this->timer.SetInterval(15); + this->CreateNestedTree(); /* For company news with a face we have a separate headline in param[0] */ @@ -485,11 +490,18 @@ struct NewsWindow : Window { this->SetWindowTop(newtop); } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { - /* Scroll up newsmessages from the bottom in steps of 4 pixels */ - int newtop = max(this->top - 4, _screen.height - this->height - this->status_height - this->chat_height); - this->SetWindowTop(newtop); + int count = this->timer.CountElapsed(delta_ms); + if (count > 0) { + /* Scroll up newsmessages from the bottom */ + int newtop = max(this->top - 2 * count, _screen.height - this->height - this->status_height - this->chat_height); + this->SetWindowTop(newtop); + } + + /* Decrement the news timer. We don't need to action an elapsed event here, + * so no need to use TimerElapsed(). */ + if (NewsWindow::duration > 0) NewsWindow::duration -= delta_ms; } private: @@ -536,7 +548,7 @@ private: } }; -/* static */ uint NewsWindow::duration = 0; // Instance creation. +/* static */ int NewsWindow::duration = 0; // Instance creation. /** Open up an own newspaper window for the news item */ @@ -588,11 +600,8 @@ static bool ReadyForNextItem() * Check if the status bar message is still being displayed? */ if (IsNewsTickerShown()) return false; - /* Newspaper message, decrement duration counter */ - if (NewsWindow::duration != 0) NewsWindow::duration--; - /* neither newsticker nor newspaper are running */ - return (NewsWindow::duration == 0 || FindWindowById(WC_NEWS_WINDOW, 0) == NULL); + return (NewsWindow::duration <= 0 || FindWindowById(WC_NEWS_WINDOW, 0) == NULL); } /** Move to the next news item */ diff --git a/src/openttd.cpp b/src/openttd.cpp index afc842b5e5..28307614fa 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -85,7 +85,7 @@ void IncreaseDate(); void DoPaletteAnimations(); void MusicLoop(); void ResetMusic(); -void CallWindowTickEvent(); +void CallWindowGameTickEvent(); bool HandleBootstrap(); extern Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY); @@ -1012,6 +1012,14 @@ static void MakeNewGameDone() Company *c = Company::Get(COMPANY_FIRST); c->settings = _settings_client.company; + /* Overwrite color from settings if needed + * COLOUR_END corresponds to Random colour */ + if (_settings_client.gui.starting_colour != COLOUR_END) { + c->colour = _settings_client.gui.starting_colour; + ResetCompanyLivery(c); + _company_colours[c->index] = (Colours)c->colour; + } + IConsoleCmdExec("exec scripts/game_start.scr 0"); SetLocalCompany(COMPANY_FIRST); @@ -1541,7 +1549,6 @@ void StateGameLoop() #ifndef DEBUG_DUMP_COMMANDS Game::GameLoop(); #endif - CallWindowTickEvent(); return; } @@ -1559,7 +1566,7 @@ void StateGameLoop() BasePersistentStorageArray::SwitchMode(PSM_LEAVE_GAMELOOP); UpdateLandscapingLimits(); - CallWindowTickEvent(); + CallWindowGameTickEvent(); NewsLoop(); } else { if (_debug_desync_level > 2 && _tick_skip_counter == 0 && _date_fract == 0 && (_date & 0x1F) == 0) { @@ -1598,7 +1605,7 @@ void StateGameLoop() #endif UpdateLandscapingLimits(); - CallWindowTickEvent(); + CallWindowGameTickEvent(); NewsLoop(); cur_company.Restore(); } @@ -1661,10 +1668,6 @@ void GameLoop() IncreaseSpriteLRU(); InteractiveRandom(); - extern int _caret_timer; - _caret_timer += 3; - CursorTick(); - #ifdef ENABLE_NETWORK /* Check for UDP stuff */ if (_network_available) NetworkBackgroundLoop(); @@ -1681,21 +1684,12 @@ void GameLoop() /* Singleplayer */ StateGameLoop(); } - - /* Check chat messages roughly once a second. */ - static uint check_message = 0; - if (++check_message > 1000 / MILLISECONDS_PER_TICK) { - check_message = 0; - NetworkChatMessageLoop(); - } #else StateGameLoop(); #endif /* ENABLE_NETWORK */ if (!_pause_mode && HasBit(_display_opt, DO_FULL_ANIMATION)) DoPaletteAnimations(); - if (!_pause_mode || _game_mode == GM_EDITOR || _settings_game.construction.command_pause_level > CMDPL_NO_CONSTRUCTION) MoveAllTextEffects(); - InputLoop(); SoundDriver::GetInstance()->MainLoop(); diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 753d564106..80726c78ba 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -1487,7 +1487,7 @@ public: } } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { CheckRedrawStationCoverage(this); } diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 27386007f1..ef842ce82b 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -375,7 +375,7 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec if (rt == ROADTYPE_ROAD && IsRoadOwner(tile, ROADTYPE_ROAD, OWNER_TOWN)) { /* Update nearest-town index */ const Town *town = CalcClosestTownFromTile(tile); - SetTownIndex(tile, town == NULL ? (TownID)INVALID_TOWN : town->index); + SetTownIndex(tile, town == NULL ? INVALID_TOWN : town->index); } SetRoadBits(tile, ROAD_NONE, rt); SetRoadTypes(tile, rts); @@ -537,7 +537,7 @@ CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 if ((Company::IsValidID(company) && p2 != 0) || (company == OWNER_TOWN && !Town::IsValidID(p2)) || (company == OWNER_DEITY && p2 != 0)) return CMD_ERROR; if (company != OWNER_TOWN) { const Town *town = CalcClosestTownFromTile(tile); - p2 = (town != NULL) ? town->index : (TownID)INVALID_TOWN; + p2 = (town != NULL) ? town->index : INVALID_TOWN; if (company == OWNER_DEITY) { company = OWNER_TOWN; @@ -1569,7 +1569,7 @@ void UpdateNearestTownForRoadTiles(bool invalidate) for (TileIndex t = 0; t < MapSize(); t++) { if (IsTileType(t, MP_ROAD) && !IsRoadDepot(t) && !HasTownOwnedRoad(t)) { - TownID tid = (TownID)INVALID_TOWN; + TownID tid = INVALID_TOWN; if (!invalidate) { const Town *town = CalcClosestTownFromTile(t); if (town != NULL) tid = town->index; diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 2c8d94f260..00cd37fc8a 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -1054,7 +1054,7 @@ struct BuildRoadStationWindow : public PickerWindowBase { } } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { CheckRedrawStationCoverage(this); } diff --git a/src/schdispatch_gui.cpp b/src/schdispatch_gui.cpp index 79ccb0a3c9..41c1d40d4b 100644 --- a/src/schdispatch_gui.cpp +++ b/src/schdispatch_gui.cpp @@ -286,7 +286,7 @@ struct SchdispatchWindow : Window { DrawString(text_left, text_right, y + 2, STR_JUST_DATE_WALLCLOCK_TINY, colour); } - virtual void OnTick() override + virtual void OnGameTick() override { const Vehicle *v = this->vehicle; if (HasBit(v->vehicle_flags, VF_SCHEDULED_DISPATCH) && v->orders.list != NULL) { diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index b19d4a34cb..fd54456e47 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1652,6 +1652,7 @@ static SettingsContainer &GetSettingsTree() company->Add(new SettingEntry("gui.drag_signals_fixed_distance")); company->Add(new SettingEntry("gui.new_nonstop")); company->Add(new SettingEntry("gui.stop_location")); + company->Add(new SettingEntry("gui.starting_colour")); company->Add(new SettingEntry("company.engine_renew")); company->Add(new SettingEntry("company.engine_renew_months")); company->Add(new SettingEntry("company.engine_renew_money")); diff --git a/src/settings_type.h b/src/settings_type.h index d799879da6..588f4c60a2 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -185,6 +185,7 @@ struct GUISettings { bool show_progsig_ui; ///< Show programmable signals feature in UI bool show_veh_list_cargo_filter; ///< Show cargo list filter in UI uint8 osk_activation; ///< Mouse gesture to trigger the OSK. + byte starting_colour; ///< default color scheme for the company to start a new game with bool show_vehicle_route_steps; ///< when a window related to a specific vehicle is focused, show route steps bool show_vehicle_list_company_colour; ///< show the company colour of vehicles which have an owner different to the owner of the vehicle list bool enable_single_veh_shared_order_gui; ///< enable showing a single vehicle in the shared order GUI window diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 74904af63d..f2e960d77a 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -24,6 +24,7 @@ #include "window_func.h" #include "company_base.h" #include "screenshot.h" +#include "guitimer_func.h" #include "smallmap_colours.h" #include "smallmap_gui.h" @@ -959,7 +960,7 @@ void SmallMapWindow::SetupWidgetData() this->GetWidget(WID_SM_SELECT_BUTTONS)->SetDisplayedPlane(plane); } -SmallMapWindow::SmallMapWindow(WindowDesc *desc, int window_number) : Window(desc), refresh(FORCE_REFRESH_PERIOD) +SmallMapWindow::SmallMapWindow(WindowDesc *desc, int window_number) : Window(desc), refresh(GUITimer(FORCE_REFRESH_PERIOD)) { _smallmap_industry_highlight = INVALID_INDUSTRYTYPE; this->overlay = new LinkGraphOverlay(this, WID_SM_MAP, 0, this->GetOverlayCompanyMask(), 1); @@ -1294,7 +1295,7 @@ int SmallMapWindow::GetPositionOnLegend(Point pt) } if (new_highlight != _smallmap_industry_highlight) { _smallmap_industry_highlight = new_highlight; - this->refresh = _smallmap_industry_highlight != INVALID_INDUSTRYTYPE ? BLINK_PERIOD : FORCE_REFRESH_PERIOD; + this->refresh.SetInterval(_smallmap_industry_highlight != INVALID_INDUSTRYTYPE ? BLINK_PERIOD : FORCE_REFRESH_PERIOD); _smallmap_industry_highlight_state = true; this->SetDirty(); } @@ -1483,10 +1484,10 @@ int SmallMapWindow::GetPositionOnLegend(Point pt) } } -/* virtual */ void SmallMapWindow::OnTick() +/* virtual */ void SmallMapWindow::OnRealtimeTick(uint delta_ms) { /* Update the window every now and then */ - if (--this->refresh != 0) return; + if (!this->refresh.Elapsed(delta_ms)) return; if (this->map_type == SMT_LINKSTATS) { uint32 company_mask = this->GetOverlayCompanyMask(); @@ -1498,7 +1499,7 @@ int SmallMapWindow::GetPositionOnLegend(Point pt) } _smallmap_industry_highlight_state = !_smallmap_industry_highlight_state; - this->refresh = _smallmap_industry_highlight != INVALID_INDUSTRYTYPE ? BLINK_PERIOD : FORCE_REFRESH_PERIOD; + this->refresh.SetInterval(_smallmap_industry_highlight != INVALID_INDUSTRYTYPE ? BLINK_PERIOD : FORCE_REFRESH_PERIOD); this->SetDirty(); } diff --git a/src/smallmap_gui.h b/src/smallmap_gui.h index ac2e7db41c..3899cd0086 100644 --- a/src/smallmap_gui.h +++ b/src/smallmap_gui.h @@ -19,6 +19,7 @@ #include "blitter/factory.hpp" #include "linkgraph/linkgraph_gui.h" #include "widgets/smallmap_widget.h" +#include "guitimer_func.h" static const int NUM_NO_COMPANY_ENTRIES = 4; ///< Number of entries in the owner legend that are not companies. @@ -91,8 +92,8 @@ protected: static const uint LEGEND_BLOB_WIDTH = 8; ///< Width of the coloured blob in front of a line text in the #WID_SM_LEGEND widget. static const uint INDUSTRY_MIN_NUMBER_OF_COLUMNS = 2; ///< Minimal number of columns in the #WID_SM_LEGEND widget for the #SMT_INDUSTRY legend. - static const uint FORCE_REFRESH_PERIOD = 0x5F; ///< map is redrawn after that many ticks - static const uint BLINK_PERIOD = 0x0F; ///< highlight blinking interval + static const uint FORCE_REFRESH_PERIOD = 2850; ///< map is redrawn after that many milliseconds. + static const uint BLINK_PERIOD = 450; ///< highlight blinking interval in milliseconds. uint min_number_of_columns; ///< Minimal number of columns in legends. uint min_number_of_fixed_rows; ///< Minimal number of rows in the legends for the fixed layouts only (all except #SMT_INDUSTRY). @@ -103,7 +104,7 @@ protected: int32 subscroll; ///< Number of pixels (0..3) between the right end of the base tile and the pixel at the top-left corner of the smallmap display. int zoom; ///< Zoom level. Bigger number means more zoom-out (further away). - uint8 refresh; ///< Refresh counter, zeroed every FORCE_REFRESH_PERIOD ticks. + GUITimer refresh; ///< Refresh timer. LinkGraphOverlay *overlay; static void BreakIndustryChainLink(); @@ -212,7 +213,7 @@ public: virtual void OnInvalidateData(int data = 0, bool gui_scope = true); virtual bool OnRightClick(Point pt, int widget); virtual void OnMouseWheel(int wheel); - virtual void OnTick(); + virtual void OnRealtimeTick(uint delta_ms); virtual void OnScroll(Point delta); virtual void OnMouseOver(Point pt, int widget); diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 8a277a3626..2ef2cdf815 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1025,18 +1025,20 @@ static CommandCost CheckFlatLandRoadStop(TileArea tile_area, DoCommandFlag flags return cost; } -/** Checks if an airport can be built at the given area. - * @param tile_area Area to check. +/** + * Checks if an airport can be built at the given location and clear the area. + * @param tile_iter Airport tile iterator. * @param flags Operation to perform. * @param station StationID of airport allowed in search area. * @return The cost in case of success, or an error code if it failed. */ -static CommandCost CheckFlatLandAirport(TileArea tile_area, DoCommandFlag flags, StationID *station) +static CommandCost CheckFlatLandAirport(AirportTileTableIterator tile_iter, DoCommandFlag flags, StationID *station) { CommandCost cost(EXPENSES_CONSTRUCTION); int allowed_z = -1; - TILE_AREA_LOOP(tile_cur, tile_area) { + for (; tile_iter != INVALID_TILE; ++tile_iter) { + const TileIndex tile_cur = tile_iter; CommandCost ret = CheckBuildableTile(tile_cur, 0, allowed_z, true, true); if (ret.Failed()) return ret; cost.AddCost(ret); @@ -2349,7 +2351,8 @@ CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint } StationID est = INVALID_STATION; - CommandCost cost = CheckFlatLandAirport(airport_area, flags, &est); + AirportTileTableIterator iter(as->table[layout], tile); + CommandCost cost = CheckFlatLandAirport(iter, flags, &est); if (cost.Failed()) return cost; Station *st = NULL; @@ -2376,7 +2379,6 @@ CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint } /* The noise level is the noise from the airport and reduce it to account for the distance to the town center. */ - AirportTileTableIterator iter(as->table[layout], tile); Town *nearest = AirportGetNearestTown(as, iter); uint newnoise_level = nearest->noise_reached + GetAirportNoiseLevelForTown(as, iter, nearest->xy); diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 2fb74dcfb9..7c12385fec 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -623,9 +623,8 @@ public: } } - virtual void OnTick() + virtual void OnGameTick() { - if (_pause_mode != PM_UNPAUSED) return; if (this->stations.NeedResort()) { DEBUG(misc, 3, "Periodic rebuild station list company %d", this->window_number); this->SetDirty(); @@ -2323,7 +2322,7 @@ struct SelectStationWindow : Window { DeleteWindowById(WC_SELECT_STATION, 0); } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { if (_thd.dirty & 2) { _thd.dirty &= ~2; diff --git a/src/statusbar_gui.cpp b/src/statusbar_gui.cpp index 55bcac49aa..6eac3ab33d 100644 --- a/src/statusbar_gui.cpp +++ b/src/statusbar_gui.cpp @@ -26,6 +26,7 @@ #include "statusbar_gui.h" #include "toolbar_gui.h" #include "core/geometry_func.hpp" +#include "guitimer_func.h" #include "widgets/statusbar_widget.h" @@ -79,17 +80,19 @@ static bool DrawScrollingStatusText(const NewsItem *ni, int scroll_pos, int left struct StatusBarWindow : Window { bool saving; int ticker_scroll; - int reminder_timeout; + GUITimer ticker_timer; + GUITimer reminder_timeout; static const int TICKER_STOP = 1640; ///< scrolling is finished when counter reaches this value - static const int REMINDER_START = 91; ///< initial value of the reminder counter (right dot on the right) + static const int REMINDER_START = 1350; ///< time in ms for reminder notification (red dot on the right) to stay static const int REMINDER_STOP = 0; ///< reminder disappears when counter reaches this value static const int COUNTER_STEP = 2; ///< this is subtracted from active counters every tick StatusBarWindow(WindowDesc *desc) : Window(desc) { - this->ticker_scroll = TICKER_STOP; - this->reminder_timeout = REMINDER_STOP; + this->ticker_scroll = TICKER_STOP; + this->ticker_timer.SetInterval(15); + this->reminder_timeout.SetInterval(REMINDER_STOP); this->InitNested(); CLRBITS(this->flags, WF_WHITE_BORDER); @@ -180,7 +183,7 @@ struct StatusBarWindow : Window { } } - if (this->reminder_timeout > 0) { + if (!this->reminder_timeout.HasElapsed()) { Dimension icon_size = GetSpriteSize(SPR_UNREAD_NEWS); DrawSprite(SPR_UNREAD_NEWS, PAL_NONE, r.right - WD_FRAMERECT_RIGHT - icon_size.width, r.top + WD_FRAMERECT_TOP + (int)(FONT_HEIGHT_NORMAL - icon_size.height) / 2); } @@ -201,10 +204,10 @@ struct StatusBarWindow : Window { case SBI_SAVELOAD_START: this->saving = true; break; case SBI_SAVELOAD_FINISH: this->saving = false; break; case SBI_SHOW_TICKER: this->ticker_scroll = 0; break; - case SBI_SHOW_REMINDER: this->reminder_timeout = REMINDER_START; break; + case SBI_SHOW_REMINDER: this->reminder_timeout.SetInterval(REMINDER_START); break; case SBI_NEWS_DELETED: this->ticker_scroll = TICKER_STOP; // reset ticker ... - this->reminder_timeout = REMINDER_STOP; // ... and reminder + this->reminder_timeout.SetInterval(REMINDER_STOP); // ... and reminder break; } } @@ -218,7 +221,7 @@ struct StatusBarWindow : Window { } } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { if (_pause_mode != PM_UNPAUSED) return; @@ -227,14 +230,15 @@ struct StatusBarWindow : Window { } if (this->ticker_scroll < TICKER_STOP) { // Scrolling text - this->ticker_scroll += COUNTER_STEP; - this->SetWidgetDirty(WID_S_MIDDLE); + uint count = this->ticker_timer.CountElapsed(delta_ms); + if (count > 0) { + this->ticker_scroll += count; + this->SetWidgetDirty(WID_S_MIDDLE); + } } - if (this->reminder_timeout > REMINDER_STOP) { // Red blot to show there are new unread newsmessages - this->reminder_timeout -= COUNTER_STEP; - } else if (this->reminder_timeout < REMINDER_STOP) { - this->reminder_timeout = REMINDER_STOP; + // Red blot to show there are new unread newsmessages + if (this->reminder_timeout.Elapsed(delta_ms)) { this->SetWidgetDirty(WID_S_MIDDLE); } } diff --git a/src/table/settings.ini b/src/table/settings.ini index c290da0fd2..7e08a8b1de 100644 --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -3447,6 +3447,18 @@ strhelp = STR_CONFIG_SETTING_LIVERIES_HELPTEXT strval = STR_CONFIG_SETTING_LIVERIES_NONE proc = InvalidateCompanyLiveryWindow +[SDTC_VAR] +var = gui.starting_colour +type = SLE_UINT8 +flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC +guiflags = SGF_MULTISTRING +def = COLOUR_END +min = 0 +max = COLOUR_END +str = STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR +strhelp = STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_HELPTEXT +strval = STR_COLOUR_DARK_BLUE + [SDTC_BOOL] var = gui.prefer_teamchat flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC diff --git a/src/table/townname.h b/src/table/townname.h index d14999340c..e4674f7530 100644 --- a/src/table/townname.h +++ b/src/table/townname.h @@ -643,7 +643,7 @@ static const char * const _name_spanish_real[] = { "Barcelona", "Barinas", "San Crist\xC3\xB3""bal", - "San Fransisco", + "San Francisco", "San Mart\xC3\xADn", "Guayana", "San Carlos", @@ -654,19 +654,19 @@ static const char * const _name_spanish_real[] = { "Elorza", "Arismendi", "Trujillo", - "Carupano", + "Car\xC3\xBApano", "Anaco", "Lima", "Cuzco", "Iquitos", "Callao", "Huacho", - "Camana", + "Caman\xC3\xA1", "Puerto Chala", "Santa Cruz", "Quito", "Cuenca", - "Huacho", + "Medell\xC3\xADn", "Tulc\xC3\xA1n", "Esmeraldas", "Ibarra", @@ -688,12 +688,12 @@ static const char * const _name_spanish_real[] = { "Potos\xC3\xAD", "Tupiza", "La Quiaca", - "Yacuiba", + "Yacu\xC3\xAD""ba", "San Borja", - "Fuerte Olimpio", + "Fuerte Olimpo", "Fort\xC3\xADn Esteros", "Campo Grande", - "Bogota", + "Bogot\xC3\xA1", "El Banco", "Zaragoza", "Neiva", diff --git a/src/texteff.cpp b/src/texteff.cpp index cdb8b8ce6a..ee5ce592b4 100644 --- a/src/texteff.cpp +++ b/src/texteff.cpp @@ -16,6 +16,7 @@ #include "core/smallvec_type.hpp" #include "viewport_func.h" #include "settings_type.h" +#include "guitimer_func.h" #include "safeguards.h" @@ -82,20 +83,25 @@ void RemoveTextEffect(TextEffectID te_id) _text_effects[te_id].Reset(); } -void MoveAllTextEffects() +void MoveAllTextEffects(uint delta_ms) { + static GUITimer texteffecttimer = GUITimer(MILLISECONDS_PER_TICK); + uint count = texteffecttimer.CountElapsed(delta_ms); + if (count == 0) return; + const TextEffect *end = _text_effects.End(); for (TextEffect *te = _text_effects.Begin(); te != end; te++) { if (te->string_id == INVALID_STRING_ID) continue; if (te->mode != TE_RISING) continue; - if (te->duration-- == 0) { + if (te->duration < count) { te->Reset(); continue; } te->MarkDirty(ZOOM_LVL_OUT_8X); - te->top -= ZOOM_LVL_BASE; + te->duration -= count; + te->top -= count * ZOOM_LVL_BASE; te->MarkDirty(ZOOM_LVL_OUT_8X); } } diff --git a/src/texteff.hpp b/src/texteff.hpp index 9ef74c1714..114cebed02 100644 --- a/src/texteff.hpp +++ b/src/texteff.hpp @@ -28,7 +28,7 @@ enum TextEffectMode { typedef uint16 TextEffectID; -void MoveAllTextEffects(); +void MoveAllTextEffects(uint delta_ms); TextEffectID AddTextEffect(StringID msg, int x, int y, uint8 duration, TextEffectMode mode); void InitTextEffects(); void DrawTextEffects(DrawPixelInfo *dpi); diff --git a/src/tile_map.h b/src/tile_map.h index 372909a93d..19fda350fc 100644 --- a/src/tile_map.h +++ b/src/tile_map.h @@ -132,9 +132,9 @@ static inline void SetTileType(TileIndex tile, TileType type) } /** - * Checks if a tile is a give tiletype. + * Checks if a tile is a given tiletype. * - * This function checks if a tile got the given tiletype. + * This function checks if a tile has the given tiletype. * * @param tile The tile to check * @param type The type to check against diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index 78381b2164..18653d017c 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -50,6 +50,7 @@ #include "toolbar_gui.h" #include "framerate_type.h" #include "zoning.h" +#include "guitimer_func.h" #include "widgets/toolbar_widget.h" @@ -1992,6 +1993,8 @@ enum MainToolbarHotkeys { /** Main toolbar. */ struct MainToolbarWindow : Window { + GUITimer timer; + MainToolbarWindow(WindowDesc *desc) : Window(desc) { this->InitNested(0); @@ -2002,6 +2005,8 @@ struct MainToolbarWindow : Window { this->SetWidgetDisabledState(WID_TN_FAST_FORWARD, _networking); // if networking, disable fast-forward button PositionMainToolbar(this); DoZoomInOutWindow(ZOOM_NONE, this); + + this->timer.SetInterval(MILLISECONDS_PER_TICK); } virtual void FindWindowPlacementAndResize(int def_width, int def_height) @@ -2107,8 +2112,11 @@ struct MainToolbarWindow : Window { _last_started_action = CBF_NONE; } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { + if (!this->timer.Elapsed(delta_ms)) return; + this->timer.SetInterval(MILLISECONDS_PER_TICK); + if (this->IsWidgetLowered(WID_TN_PAUSE) != !!_pause_mode) { this->ToggleWidgetLoweredState(WID_TN_PAUSE); this->SetWidgetDirty(WID_TN_PAUSE); @@ -2326,6 +2334,8 @@ enum MainToolbarEditorHotkeys { }; struct ScenarioEditorToolbarWindow : Window { + GUITimer timer; + ScenarioEditorToolbarWindow(WindowDesc *desc) : Window(desc) { this->InitNested(0); @@ -2334,6 +2344,8 @@ struct ScenarioEditorToolbarWindow : Window { CLRBITS(this->flags, WF_WHITE_BORDER); PositionMainToolbar(this); DoZoomInOutWindow(ZOOM_NONE, this); + + this->timer.SetInterval(MILLISECONDS_PER_TICK); } virtual void FindWindowPlacementAndResize(int def_width, int def_height) @@ -2461,8 +2473,11 @@ struct ScenarioEditorToolbarWindow : Window { this->SetWidgetDirty(WID_TE_DATE_FORWARD); } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { + if (!this->timer.Elapsed(delta_ms)) return; + this->timer.SetInterval(MILLISECONDS_PER_TICK); + if (this->IsWidgetLowered(WID_TE_PAUSE) != !!_pause_mode) { this->ToggleWidgetLoweredState(WID_TE_PAUSE); this->SetDirty(); diff --git a/src/town.h b/src/town.h index 7a411b391d..c98d6daf41 100644 --- a/src/town.h +++ b/src/town.h @@ -34,7 +34,7 @@ typedef TileMatrix AcceptanceMatrix; static const uint CUSTOM_TOWN_NUMBER_DIFFICULTY = 4; ///< value for custom town number in difficulty settings static const uint CUSTOM_TOWN_MAX_NUMBER = 5000; ///< this is the maximum number of towns a user can specify in customisation -static const uint INVALID_TOWN = 0xFFFF; +static const TownID INVALID_TOWN = 0xFFFF; static const uint TOWN_GROWTH_WINTER = 0xFFFFFFFE; ///< The town only needs this cargo in the winter (any amount) static const uint TOWN_GROWTH_DESERT = 0xFFFFFFFF; ///< The town needs the cargo for growth when on desert (any amount) diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 2f766224fe..28a9fb8371 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -3622,7 +3622,7 @@ Town *ClosestTownFromTile(TileIndex tile, uint threshold) if (!HasTownOwnedRoad(tile)) { TownID tid = GetTownIndex(tile); - if (tid == (TownID)INVALID_TOWN) { + if (tid == INVALID_TOWN) { /* in the case we are generating "many random towns", this value may be INVALID_TOWN */ if (_generating_world) return CalcClosestTownFromTile(tile, threshold); assert(Town::GetNumItems() == 0); diff --git a/src/town_type.h b/src/town_type.h index f95a5d0f74..132e9bf7a4 100644 --- a/src/town_type.h +++ b/src/town_type.h @@ -57,7 +57,7 @@ enum Ratings { RATING_GROWTH_UP_STEP = 5, ///< when a town grows, all companies have rating increased a bit ... RATING_GROWTH_MAXIMUM = RATING_MEDIOCRE, ///< ... up to RATING_MEDIOCRE RATING_STATION_UP_STEP = 12, ///< when a town grows, company gains reputation for all well serviced stations ... - RATING_STATION_DOWN_STEP = -15, ///< ... but loses for bad serviced stations + RATING_STATION_DOWN_STEP = -15, ///< ... but loses for badly serviced stations RATING_TUNNEL_BRIDGE_DOWN_STEP = -250, ///< penalty for removing town owned tunnel or bridge RATING_TUNNEL_BRIDGE_MINIMUM = 0, ///< minimum rating after removing tunnel or bridge diff --git a/src/townname.cpp b/src/townname.cpp index 2067fa1bb3..b6d55f1ef4 100644 --- a/src/townname.cpp +++ b/src/townname.cpp @@ -121,17 +121,17 @@ bool VerifyTownName(uint32 r, const TownNameParams *par, TownNames *town_names) */ bool GenerateTownName(uint32 *townnameparts, TownNames *town_names) { - /* Do not set too low tries, since when we run out of names, we loop - * for #tries only one time anyway - then we stop generating more - * towns. Do not show it too high neither, since looping through all - * the other towns may take considerable amount of time (10000 is - * too much). */ TownNameParams par(_settings_game.game_creation.town_name); /* This function is called very often without entering the gameloop * inbetween. So reset layout cache to prevent it from growing too big. */ Layouter::ReduceLineCache(); + /* Do not set i too low, since when we run out of names, we loop + * for #tries only one time anyway - then we stop generating more + * towns. Do not set it too high either, since looping through all + * the other towns may take considerable amount of time (10000 is + * too much). */ for (int i = 1000; i != 0; i--) { uint32 r = _generating_world ? Random() : InteractiveRandom(); if (!VerifyTownName(r, &par, town_names)) continue; @@ -1045,7 +1045,7 @@ static const TownNameGeneratorParams _town_name_generators[] = { /** - * Generates town name from given seed. a language. + * Generates town name from given seed. * @param buf output buffer * @param last end of buffer * @param lang town name language diff --git a/src/townname_type.h b/src/townname_type.h index 0177294d99..ba8f926861 100644 --- a/src/townname_type.h +++ b/src/townname_type.h @@ -23,7 +23,7 @@ typedef std::set TownNames; /** - * Struct holding a parameters used to generate town name. + * Struct holding parameters used to generate town name. * Speeds things up a bit because these values are computed only once per name generation. */ struct TownNameParams { diff --git a/src/tracerestrict_gui.cpp b/src/tracerestrict_gui.cpp index 0aee615711..b11b7031e3 100644 --- a/src/tracerestrict_gui.cpp +++ b/src/tracerestrict_gui.cpp @@ -3302,9 +3302,8 @@ public: this->SetDirty(); } - virtual void OnTick() + virtual void OnGameTick() override { - if (_pause_mode != PM_UNPAUSED) return; if (this->slots.NeedResort() || this->vehicles.NeedResort()) { this->SetDirty(); } diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 3ad9f4a649..ff536deb1f 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -2512,12 +2512,10 @@ static bool CheckTrainStayInDepot(Train *v) seg_state = _settings_game.pf.reserve_paths ? SIGSEG_PBS : UpdateSignalsOnSegment(v->tile, INVALID_DIAGDIR, v->owner); } - /* We are leaving a depot, but have to go to the exact same one; re-enter */ + /* We are leaving a depot, but have to go to the exact same one; re-enter. */ if (v->current_order.IsType(OT_GOTO_DEPOT) && v->tile == v->dest_tile) { - /* We need to have a reservation for this to work. */ - if (HasDepotReservation(v->tile)) return true; - SetDepotReservation(v->tile, true); - VehicleEnterDepot(v); + /* Service when depot has no reservation. */ + if (!HasDepotReservation(v->tile)) VehicleEnterDepot(v); return true; } @@ -3973,12 +3971,12 @@ bool TrainController(Train *v, Vehicle *nomove, bool reverse) if (!HasSignalOnTrackdir(gp.new_tile, ReverseTrackdir(i))) { v->cur_speed = 0; v->subspeed = 0; - v->progress = 255 - 100; + v->progress = 255; // make sure that every bit of acceleration will hit the signal again, so speed stays 0. if (!_settings_game.pf.reverse_at_signals || ++v->wait_counter < _settings_game.pf.wait_oneway_signal * 20) return false; } else if (HasSignalOnTrackdir(gp.new_tile, i)) { v->cur_speed = 0; v->subspeed = 0; - v->progress = 255 - 10; + v->progress = 255; // make sure that every bit of acceleration will hit the signal again, so speed stays 0. if (!_settings_game.pf.reverse_at_signals || ++v->wait_counter < _settings_game.pf.wait_twoway_signal * 73) { DiagDirection exitdir = TrackdirToExitdir(i); TileIndex o_tile = TileAddByDiagDir(gp.new_tile, exitdir); diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 4750200be6..a73721bf31 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2157,9 +2157,8 @@ public: } } - virtual void OnTick() + virtual void OnGameTick() { - if (_pause_mode != PM_UNPAUSED) return; if (this->vehicles.NeedResort()) { StationID station = (this->vli.type == VL_STATION_LIST) ? this->vli.index : INVALID_STATION; @@ -3555,7 +3554,7 @@ public: } } - virtual void OnTick() + virtual void OnGameTick() { const Vehicle *v = Vehicle::Get(this->window_number); bool veh_stopped = v->IsStoppedInDepot(); diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index 014cbdf180..648d78736c 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -14,6 +14,7 @@ #include "../string_func.h" #include "../strings_func.h" #include "../window_func.h" +#include "../guitimer_func.h" #include "dropdown_type.h" #include "dropdown_widget.h" @@ -97,6 +98,7 @@ struct DropdownWindow : Window { bool drag_mode; bool instant_close; ///< Close the window when the mouse button is raised. int scrolling; ///< If non-zero, auto-scroll the item list (one time). + GUITimer scrolling_timer; ///< Timer for auto-scroll of the item list. Point position; ///< Position of the topleft corner of the window. Scrollbar *vscroll; DropDownSyncFocus sync_parent_focus; ///< Call parent window's OnFocus[Lost](). @@ -157,6 +159,7 @@ struct DropdownWindow : Window { this->click_delay = 0; this->drag_mode = true; this->instant_close = instant_close; + this->scrolling_timer = GUITimer(MILLISECONDS_PER_TICK); } ~DropdownWindow() @@ -259,8 +262,11 @@ struct DropdownWindow : Window { } } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { + if (!this->scrolling_timer.Elapsed(delta_ms)) return; + this->scrolling_timer.SetInterval(MILLISECONDS_PER_TICK); + if (this->scrolling != 0) { int pos = this->vscroll->GetPosition(); diff --git a/src/window.cpp b/src/window.cpp index e3bfc7b069..c73000d039 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -37,6 +37,8 @@ #include "game/game.hpp" #include "video/video_driver.hpp" #include "framerate_type.h" +#include "network/network_func.h" +#include "guitimer_func.h" #include "safeguards.h" @@ -1926,6 +1928,8 @@ void ResetWindowSystem() static void DecreaseWindowCounters() { + if (_scroller_click_timeout != 0) _scroller_click_timeout--; + Window *w; FOR_ALL_WINDOWS_FROM_FRONT(w) { if (_scroller_click_timeout == 0) { @@ -3080,7 +3084,6 @@ void InputLoop() assert(HasModalProgress() || IsLocalCompany()); CheckSoftLimit(); - HandleKeyScrolling(); /* Do the actual free of the deleted windows. */ for (WindowBase *v = _z_front_window; v != NULL; /* nothing */) { @@ -3093,9 +3096,6 @@ void InputLoop() free(w); } - if (_scroller_click_timeout != 0) _scroller_click_timeout--; - DecreaseWindowCounters(); - if (_input_events_this_tick != 0) { /* The input loop is called only once per GameLoop() - so we can clear the counter here */ _input_events_this_tick = 0; @@ -3105,7 +3105,17 @@ void InputLoop() /* HandleMouseEvents was already called for this tick */ HandleMouseEvents(); - HandleAutoscroll(); +} + +/** + * Dispatch OnRealtimeTick event over all windows + */ +void CallWindowRealtimeTickEvent(uint delta_ms) +{ + Window *w; + FOR_ALL_WINDOWS_FROM_FRONT(w) { + w->OnRealtimeTick(delta_ms); + } } /** @@ -3113,19 +3123,50 @@ void InputLoop() */ void UpdateWindows() { + static uint32 last_realtime_tick = _realtime_tick; + uint delta_ms = _realtime_tick - last_realtime_tick; + last_realtime_tick = _realtime_tick; + + if (delta_ms == 0) return; + PerformanceMeasurer framerate(PFE_DRAWING); PerformanceAccumulator::Reset(PFE_DRAWWORLD); + CallWindowRealtimeTickEvent(delta_ms); + +#ifdef ENABLE_NETWORKING + static GUITimer network_message_timer = GUITimer(1); + if (network_message_timer.Elapsed(delta_ms)) { + network_message_timer.SetInterval(1000); + NetworkChatMessageLoop(); + } +#endif + Window *w; _window_update_number++; - static int highlight_timer = 1; - if (--highlight_timer == 0) { - highlight_timer = 15; + static GUITimer window_timer = GUITimer(1); + if (window_timer.Elapsed(delta_ms)) { + if (_network_dedicated) window_timer.SetInterval(MILLISECONDS_PER_TICK); + + extern int _caret_timer; + _caret_timer += 3; + CursorTick(); + + HandleKeyScrolling(); + HandleAutoscroll(); + DecreaseWindowCounters(); + } + + static GUITimer highlight_timer = GUITimer(1); + if (highlight_timer.Elapsed(delta_ms)) { + highlight_timer.SetInterval(450); _window_highlight_colour = !_window_highlight_colour; } + if (!_pause_mode || _game_mode == GM_EDITOR || _settings_game.construction.command_pause_level > CMDPL_NO_CONSTRUCTION) MoveAllTextEffects(delta_ms); + FOR_ALL_WINDOWS_FROM_FRONT(w) { w->ProcessScheduledInvalidations(); w->ProcessHighlightedInvalidations(); @@ -3135,21 +3176,23 @@ void UpdateWindows() * But still empty the invalidation queues above. */ if (_network_dedicated) return; - static int we4_timer = 0; - int t = we4_timer + 1; + static GUITimer hundredth_timer = GUITimer(1); + if (hundredth_timer.Elapsed(delta_ms)) { + hundredth_timer.SetInterval(3000); // Historical reason: 100 * MILLISECONDS_PER_TICK - if (t >= 100) { FOR_ALL_WINDOWS_FROM_FRONT(w) { w->OnHundredthTick(); } - t = 0; } - we4_timer = t; - FOR_ALL_WINDOWS_FROM_FRONT(w) { - if ((w->flags & WF_WHITE_BORDER) && --w->white_border_timer == 0) { - CLRBITS(w->flags, WF_WHITE_BORDER); - w->SetDirty(); + if (window_timer.HasElapsed()) { + window_timer.SetInterval(MILLISECONDS_PER_TICK); + + FOR_ALL_WINDOWS_FROM_FRONT(w) { + if ((w->flags & WF_WHITE_BORDER) && --w->white_border_timer == 0) { + CLRBITS(w->flags, WF_WHITE_BORDER); + w->SetDirty(); + } } } @@ -3301,13 +3344,13 @@ void InvalidateWindowClassesData(WindowClass cls, int data, bool gui_scope) } /** - * Dispatch WE_TICK event over all windows + * Dispatch OnGameTick event over all windows */ -void CallWindowTickEvent() +void CallWindowGameTickEvent() { Window *w; FOR_ALL_WINDOWS_FROM_FRONT(w) { - w->OnTick(); + w->OnGameTick(); } } diff --git a/src/window_gui.h b/src/window_gui.h index a12fbfd012..af044171ea 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -726,13 +726,18 @@ public: /** * Called once per (game) tick. */ - virtual void OnTick() {} + virtual void OnGameTick() {} /** * Called once every 100 (game) ticks. */ virtual void OnHundredthTick() {} + /** + * Called periodically. + */ + virtual void OnRealtimeTick(uint delta_ms) {} + /** * Called when this window's timeout has been reached. */