Merge branch 'develop'

This commit is contained in:
Michał Janiszewski committed 2023-09-03 17:05:43 +02:00
commit bcf7701fec
538 files changed
+17690 -23148

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
BODY: ${{ github.event.issue.body }}
id: fix
run: |
changed_body=$(echo "$BODY" | sed '/<strong>commit<\/strong>/,/<\/li>/ s/<code>\([0-9a-f]\{7,\}\)<\/code>/\1/')
changed_body=$(echo "$BODY" | sed '/<strong>commit<\/strong>/,/<\/ul>/ s/<code>\([0-9a-f]\{7,\}\)<\/code>/\1/g')
if [[ "$changed_body" == "$BODY" ]]; then
echo "Unable to match the Backtrace report format."
exit 1
+1 -1
View File
@@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'OpenRCT2/OpenRCT2'
steps:
- uses: actions/stale@v7
- uses: actions/stale@v8
with:
days-before-issue-stale: 60
days-before-issue-close: 1
+3 -1
View File
@@ -8,8 +8,10 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'OpenRCT2/OpenRCT2'
steps:
- uses: actions/stale@v7
- uses: actions/stale@v8
with:
exempt-all-pr-assignees: true
exempt-all-pr-milestones: true
days-before-issue-stale: -1
days-before-issue-close: -1
days-before-pr-stale: 31
+8 -13
View File
@@ -60,9 +60,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}")
set(TITLE_SEQUENCE_VERSION "0.4.0")
set(TITLE_SEQUENCE_VERSION "0.4.6")
set(TITLE_SEQUENCE_URL "https://github.com/OpenRCT2/title-sequences/releases/download/v${TITLE_SEQUENCE_VERSION}/title-sequences.zip")
set(TITLE_SEQUENCE_SHA1 "4ab0065e5a4d9f9c77d94718bbdfcfcd5a389da0")
set(TITLE_SEQUENCE_SHA1 "80fefc6ebbabc42a6f4703412daa5c62f661420d")
set(OBJECTS_VERSION "1.3.11")
set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip")
@@ -72,9 +72,9 @@ set(OPENSFX_VERSION "1.0.3")
set(OPENSFX_URL "https://github.com/OpenRCT2/OpenSoundEffects/releases/download/v${OPENSFX_VERSION}/opensound.zip")
set(OPENSFX_SHA1 "ffec5a97bd5035860c4c9a43fe32cf51886478e3")
set(OPENMSX_VERSION "1.3.0")
set(OPENMSX_VERSION "1.3.1")
set(OPENMSX_URL "https://github.com/OpenRCT2/OpenMusic/releases/download/v${OPENMSX_VERSION}/openmusic.zip")
set(OPENMSX_SHA1 "b0cec998a3679f1cde17d91f2508ec4923c1a25c")
set(OPENMSX_SHA1 "cb7b05af97aaf7949fb509063d45df6613f20521")
set(REPLAYS_VERSION "0.0.78")
set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip")
@@ -86,8 +86,8 @@ option(PORTABLE "Create a portable build (-rpath=$ORIGIN)" OFF)
option(APPIMAGE "Create an appimage build (-rpath=$ORIGIN/../lib)" OFF)
option(DOWNLOAD_TITLE_SEQUENCES "Download title sequences during installation." ON)
option(DOWNLOAD_OBJECTS "Download objects during installation." ON)
option(DOWNLOAD_OPENSFX "Download OpenSoundEffects during installation." OFF)
option(DOWNLOAD_OPENMSX "Download OpenMusic during installation." OFF)
option(DOWNLOAD_OPENSFX "Download OpenSoundEffects during installation." ON)
option(DOWNLOAD_OPENMSX "Download OpenMusic during installation." ON)
CMAKE_DEPENDENT_OPTION(DOWNLOAD_REPLAYS "Download replays during installation." ON
"WITH_TESTS" OFF)
CMAKE_DEPENDENT_OPTION(MACOS_USE_DEPENDENCIES "Use OpenRCT2 dependencies instead of system libraries" ON
@@ -100,7 +100,8 @@ option(STATIC "Create a static build.")
option(USE_MMAP "Use mmap to try loading rct2's data segment into memory.")
option(DISABLE_DISCORD_RPC "Disable Discord-RPC support." OFF)
option(DISABLE_GOOGLE_BENCHMARK "Disable Google Benchmarks support." OFF)
# Currently unused, disable by default.
option(DISABLE_GOOGLE_BENCHMARK "Disable Google Benchmarks support." ON)
option(DISABLE_HTTP "Disable HTTP support.")
option(DISABLE_NETWORK "Disable multiplayer functionality. Mainly for testing.")
option(DISABLE_TTF "Disable support for TTF provided by freetype2.")
@@ -160,12 +161,6 @@ if (MACOS_USE_DEPENDENCIES)
endif ()
endif ()
# If OS is Linux, import OpenSoundEffects and OpenMusic
if(UNIX AND NOT APPLE)
set(DOWNLOAD_OPENMSX ON)
set(DOWNLOAD_OPENSFX ON)
endif()
# LIST of supported flags, use SET_CHECK_CXX_FLAGS() to apply to target.
# Use ADD_CHECK_CXX_COMPILER_FLAG() to add to list.
set(SUPPORTED_CHECK_CXX_COMPILER_FLAGS "")
+13 -3
View File
@@ -8,7 +8,6 @@ Includes all git commit authors. Aliases are GitHub user names.
* Hielke Morsink (Broxzier)
* Tulio Paschoalin Leao (tupaschoal)
* Olivier Wervers (Oli414)
* Rik Smeets (rik-smeets)
* Matthias Moninger (ZehMatt)
## Former development team members
@@ -18,6 +17,7 @@ Includes all git commit authors. Aliases are GitHub user names.
* Richard Jenkins (rwjuk)
* Aaron van Geffen (AaronVanGeffen)
* Michael Steenbeek (Gymnasiast)
* Rik Smeets (rik-smeets)
## Long term contributors
The following people are not part of the development team, but have been contributing for a long time.
@@ -108,6 +108,7 @@ The following people are not part of the development team, but have been contrib
* Phumdol Lookthipnapha (beam41) - Misc.
* Nikolas Parshook (nparshook) - Misc.
* Wenzhao Qiu (qwzhaox) - Misc.
* Tiago Reul (reul) - Misc.
## Bug fixes
* (KirilAngelov)
@@ -213,13 +214,15 @@ The following people are not part of the development team, but have been contrib
* Conrad Cash (HouseholdVTuber)
* Michael Bickerton (mdbckrtn)
* Nehemiah Negussie (nehemiah-negussie)
* (zzril)
* Severin Paul Höfer (zzril)
* Ernest Elgin (eaeiv)
* Ernest Wong (ErnWong)
* Joel H. (HtotheTML)
* John Mulcahy (jayjay300)
* Chase Percy (Chase-Percy)
* Wenzhao Qiu (qwzhaox)
* Michael Bernardi (mrmbernardi)
* Aram Kazorian (aramk-hub)
## Toolchain
* (Balletie) - macOS
@@ -259,7 +262,7 @@ The following people are not part of the development team, but have been contrib
* Esperanto - (tellovishous), Raymond Zhao (rzhao271)
* Finnish - (DJHasis), (Zode), (TheWing)
* French - (fbourigault), Joël Troch (JoelTroch), Michael Steenbeek (Gymnasiast), Romain Vigier (rmnvgr), (AziasYur), Hugo Courtial (s0r00t), David Delobel (incyclum), Nicolas Hawrysh (xp4xbox)
* German - (danidoedel), (atmaxinger), (Yepoleb), Daniel Kessel (dkessel), Leon (AllGoodNamesAreTaken), (raidcookie)
* German - (danidoedel), (atmaxinger), (Yepoleb), Daniel Kessel (dkessel), Leon (AllGoodNamesAreTaken), (raidcookie), Gilian Rehm (gr33ndev)
* Italian - Luca Andrea Rossi (LucaRed), Precious Ugo Abara (48cfu)
* Japanese - Aaron van Geffen (AaronVanGeffen), Haruna Chinzei, Nick Hall (nickhall), (jhako), Harry Lam (daihakken)
* Korean - Willem J. Lee (telk5093), (NeverDruid); small fixes: (kexplo)
@@ -277,6 +280,13 @@ The following people are not part of the development team, but have been contrib
## Music
* Karst "Jalmaan" van Galen Last (AuraSpecs)
* (Flyxxpy)
* Jan Büchner (Greyfade)
* Allister Brimble
* Herman Riddering
## Sound Effects
* Karst van Galen Last (AuraSpecs)
* (ThatGuyYouKnow)
## RollerCoaster Tycoon 2 credits
Design and programming by Chris Sawyer
+7
View File
@@ -3692,6 +3692,13 @@ STR_6582 :Obre la finestra de dreceres de teclat
STR_6583 :{WINDOW_COLOUR_2}Inverteix el sentit
STR_6584 :Trieu-ho per a invertir el sentit de moviment dels cotxes
STR_6585 :Els canvis no es poden fer…
STR_6586 :OpenRCT2
STR_6587 :El tema principal de l’OpenRCT2 és obra de l’Allister Brimble,{NEWLINE}amb llicència CC BY-SA 4.0.
STR_6588 :Gràcies al Herman Riddering per permetre’ns gravar el 35er Voigt.
STR_6589 :Mostra els botons de les finestres a l’esquerra
STR_6590 :Mostra els botons de les finestres (com ara el de tancar la finestra) a l’esquerra en lloc de mostrar-los a la dreta.
STR_6591 :L’empleat ara mateix arregla una atracció i no se’l pot acomiadar.
STR_6592 :L’empleat ara mateix fa una inspecció i no se’l pot acomidiar.
#############
# Scenarios #
+7
View File
@@ -3684,6 +3684,13 @@ STR_6582 :Tastenkürzelfenster öffnen
STR_6583 :{WINDOW_COLOUR_2}Umgekehrte Züge
STR_6584 :Auswählen, um Züge rückwärts fahren zu lassen
STR_6585 :Änderungen können nicht ausgeführt werden …
STR_6586 :OpenRCT2
STR_6587 :Das OpenRCT2-Titelthema ist ein Werk von Allister Brimble, {NEWLINE}lizenziert unter CC BY-SA 4.0.
STR_6588 :Vielen Dank an Herman Riddering für die Erlaubnis, den 35er Voigt aufzunehmen.
STR_6589 :Schaltflächen auf der linken Seite anzeigen
STR_6590 :Schaltflächen (z.B. zum Schließen des Fensters) auf der linken anstatt auf der rechten Seite der Titelleiste anzeigen.
STR_6591 :Der Mitarbeiter repariert gerade ein Fahrgeschäft und kann deshalb nicht entlassen werden.
STR_6592 :Der Mitarbeiter inspiziert gerade ein Fahrgeschäft und kann deshalb nicht entlassen werden.
#############
# Scenarios #
+7 -13
View File
@@ -3682,14 +3682,19 @@ STR_6576 :Adds special colours to colour dropdown
STR_6577 :Block brake speed
STR_6578 :Set speed limit for block brakes. In block section mode, adjacent brakes with a slower speed are linked to the block brake.
STR_6579 :Block brakes will be set to default speed when saved as track design
STR_6580 :Reset
STR_6581 :Are you sure you want to reset all shortcut keys on this tab?
STR_6582 :Open keyboard shortcuts window
STR_6583 :{WINDOW_COLOUR_2}Reversed Trains
STR_6584 :Select to run trains backwards
STR_6585 :Can’t make changes…
STR_6586 :OpenRCT2
STR_6587 :The OpenRCT2 Title Theme is a work of Allister Brimble,{NEWLINE}licensed CC BY-SA 4.0.
STR_6588 :Thanks to Herman Riddering for allowing us to record the 35er Voigt.
STR_6589 :Show window buttons on the left
STR_6590 :Show the window buttons (e.g. to close the window) on the left of the title bar instead of on the right.
STR_6591 :Staff member is currently fixing a ride and can’t be fired.
STR_6592 :Staff member is currently inspecting a ride and can’t be fired.
#############
# Scenarios #
@@ -4133,17 +4138,6 @@ STR_SCNR :Fort Anachronism
STR_PARK :Fort Anachronism
STR_DTLS :
###########
# Scenery #
###########
## Start OpenRCT2 Official
[TTPIRF05]
STR_NAME :Roof
## End OpenRCT2 Official
###############################################################################
## RCT2 Scenarios
###############################################################################
+7
View File
@@ -3687,6 +3687,13 @@ STR_6582 :Malfermi klavarokomandoj-fenestron
STR_6583 :{WINDOW_COLOUR_2}Inversaj Trajnoj
STR_6584 :Elektu por funkciigi trajnojn inverse
STR_6585 :Ne eblas ŝanĝi tion…
STR_6586 :OpenRCT2
STR_6587 :La Titolomuziko de OpenRCT2 estas verko de Allister Brimble,{NEWLINE}rajtigita CC BY-SA 4.0.
STR_6588 :Dank' al Herman Riddering pro permesi al ni registri la 35er Voigt.
STR_6589 :Montri fenestro-butonojn maldekstre
STR_6590 :Montri la fenestro-butonojn (ekz. fermi la fenestron) maldekstre de la titola breto anstataŭ dekstre.
STR_6591 :Dungito nune estas riparanta atrakcion kaj ne povas esti maldungita.
STR_6592 :Dungito nune estas inspektanta atrakcion kaj ne povas esti maldungita.
#############
# Scenarios #
+7
View File
@@ -3691,6 +3691,13 @@ STR_6582 :Abrir ventana de atajos de teclado
STR_6583 :{WINDOW_COLOUR_2}Trenes Invertidos
STR_6584 :Selecciona para que los trenes viajen marcha atrás
STR_6585 :No se puede realizar cambios…
STR_6586 :OpenRCT2
STR_6587 :El tema principal de OpenRTC es una obra de Allister Brimble,{NEWLINE}licenciada bajo CC BY-SA 4.0.
STR_6588 :Gracias a Herman Riddering por permitirnos grabar el 35er Voigt.
STR_6589 :Mostrar botones de ventana a la izquierda
STR_6590 :Mostrar los botones de ventana (como el de cerrar la ventana) a la izquierda de la barra de título en lugar de a la derecha.
STR_6591 :El empleado está reparando una atracción y no puede ser despedido.
STR_6592 :El empleado está inspeccionando una atracción y no puede ser despedido.
##############
# Escenarios #
+10
View File
@@ -3693,6 +3693,16 @@ STR_6579 :La vitesse des freins de bloc sera changée à la valeur par défau
STR_6580 :Réinitialiser
STR_6581 :Voulez-vous vraiment réinitialiser tous les raccourcis claviers de cet onglet ?
STR_6582 :Ouvrir la fenêtre des raccourcis clavier
STR_6583 :{WINDOW_COLOUR_2}Trains inversés
STR_6584 :Fait rouler les trains à l’envers
STR_6585 :Impossible d’effectuer les changements…
STR_6586 :OpenRCT2
STR_6587 :Le thème principal d’OpenRCT2 est une création d’Allister Brimble,{NEWLINE}sous licence CC BY-SA 4.0.
STR_6588 :Merci à Herman Riddering pour nous avoir permis d’enregistrer le 35er Voigt.
STR_6589 :Placer les boutons de fenêtre à gauche
STR_6590 :Place les boutons de fenêtre (par exemple pour fermer la fenêtre) sur la gauche de la barre de titre au lieu de la droite
STR_6591 :L’employé est en train de réparer une attraction et ne peut pas être licencié.
STR_6592 :L’employé est en train d’inspecter une attraction et ne peut pas être licencié.
#############
# Scenarios #
+45 -1
View File
@@ -2087,7 +2087,7 @@ STR_3008 :{PEARLAQUA}ABC
STR_3009 :{PALESILVER}ABC
STR_3010 :A fájl betöltése sikertelen…
STR_3011 :A fájl érvénytelen adatod tartalmaz
STR_3012 :Dodzsem beat stílus
STR_3012 :Dodzsem stílus
STR_3013 :Vásári orgona stílus
STR_3014 :Római harsona stílus
STR_3015 :Keleti stílus
@@ -3629,6 +3629,50 @@ STR_6545 :RCT1 kamatszámítás használata
STR_6546 :A RollerCoaster Tycoon 1 kamatszámítási algoritmusának használata, amely egy rögzített százalékot használ, ami körülbelül 1,33%.
STR_6547 :Minden díszlet
STR_6548 :Korlátok megjelenítése csomópontoknál
STR_6549 :A kompatibilitási objektumok nem választhatóak ki!
STR_6550 :Ez az elem visszafelé kompatibilitási céllal szerepel, régi vagy sérült objektumokhoz. Nem lehet kiválasztani, csak eltávolítani.
STR_6551 :Katonaszín
STR_6552 :Dinnyesárga
STR_6553 :Cser
STR_6554 :Marrone
STR_6555 :Korallrózsaszín
STR_6556 :Erdőzöld
STR_6557 :Chartreuse-szín
STR_6558 :Vadászzöld
STR_6559 :Szeladon
STR_6560 :Limezöld
STR_6561 :Szépia
STR_6562 :Barack
STR_6563 :Periwinkle
STR_6564 :Viridián
STR_6565 :Tengerzöld
STR_6566 :Ibolya
STR_6567 :Levendula
STR_6568 :Pasztellnarancs
STR_6569 :Mélyvíz
STR_6570 :Pasztellrózsaszín
STR_6571 :Umbra
STR_6572 :Bézs
STR_6573 :Láthatatlan
STR_6574 :Üresség
STR_6575 :Speciális színsémák engedélyezése
STR_6576 :Speciális színek hozzáadása a színkiválasztó listához
STR_6577 :Blokkfék sebessége
STR_6578 :A blokkfékek sebességkorlátjának beállítása. A blokkszakasz üzemmódban a lassabb sebességű szomszédos fékek a blokkfékhez kapcsolódnak.
STR_6579 :A blokkfékek alapértelmezett sebességre lesznek beállítva, amikor pályatervként elmentésre kerül
STR_6580 :Visszaállítás
STR_6581 :Biztosan vissza szeretnéd állítani az összes gyorsbillentyűt ezen a fülön?
STR_6582 :Gyorsbillentyűk ablak megnyitása
STR_6583 :{WINDOW_COLOUR_2}Fordított vonatok
STR_6584 :Válassza ki, hogy a vonatok fordítva közlekedjenek
STR_6585 :Nem lehet a változtatásokat végrehajtani…
STR_6586 :OpenRCT2
STR_6587 :Az OpenRCT2 főcímzenéje Allister Brimble műve,{NEWLINE}CC BY-SA 4.0 licenccel.
STR_6588 :Köszönet Herman Ridderingnek, hogy lehetővé tette számunkra a 35er Voigt rögzítését.
STR_6589 :Ablak gombok mutatása a bal oldalon
STR_6590 :Az ablak gombok (pl. az ablak bezárása) mutatása az ablak címsorának bal oldalán, ahelyett hogy a jobb oldalon lennének.
STR_6591 :Az alkalmazott jelenleg egy játékot javít, és nem lehet kirúgni.
STR_6592 :Az alkalmazott jelenleg egy játékot ellenőriz, és nem lehet kirúgni.
#############
# Scenarios #
+181 -9
View File
@@ -2997,7 +2997,7 @@ STR_5832 :Mostra l’altezza in unità generiche invece del formato impostato
STR_5833 :Cambia il formato della data utilizzato
STR_5834 :Seleziona il dispositivo audio utilizzato da OpenRCT2
STR_5835 :Disattiva l’audio del gioco se la finestra perde il focus
STR_5836 :Imposta la musica da utilizzare nel menu principale.{NEWLINE}Selezionando RCT1 sarà necessario copiare il file “data/css17.dat” dalla cartella di RCT1 a “data/css50.dat” nella cartella di RCT2, oppure impostare il percorso di RCT1 nella scheda “Altro”.
STR_5836 :Seleziona la musica da utilizzare nel menu principale.{NEWLINE}Per selezionare il tema di RCT1 è necessario impostare il percorso di RCT1 nella scheda Avanzate.
STR_5837 :Crea e gestisci i temi dell’interfaccia
STR_5838 :Mostra un pulsante differente per le finanze nella barra degli strumenti
STR_5839 :Mostra un pulsante differente per le ricerche e sviluppo nella barra degli strumenti
@@ -3286,8 +3286,8 @@ STR_6133 :Permette di accedere ad attrazioni e scenari non ancora inventati
STR_6134 :Rimuovi scenario
STR_6135 :Il client ha inviato una richiesta non valida
STR_6136 :Il server ha inviato una richiesta non valida
STR_6137 :OpenRCT2, un clone libero e open-source di Roller Coaster Tycoon 2.
STR_6138 :OpenRCT2 è frutto del lavoro di molti autori, una lista completa si può trovare nel file “contributors.md”. Per ulteriori informazioni, visitare http://github.com/OpenRCT2/OpenRCT2
STR_6137 :OpenRCT2, un remake con aggiunte gratuito e open-source di Roller Coaster Tycoon 2.
STR_6138 :OpenRCT2 è frutto del lavoro di molti autori, una lista completa si può trovare cliccando il pulsante “Collaboratori”. Per ulteriori informazioni, visitare http://github.com/OpenRCT2/OpenRCT2
STR_6139 :Tutti i nomi di prodotti e aziende appartengono ai rispettivi proprietari. Il loro uso non implica alcuna affiliazione o approvazione da parte di essi.
STR_6140 :Storico delle modifiche…
STR_6141 :Barra degli strumenti inferiore alla RCT1
@@ -3431,7 +3431,7 @@ STR_6318 :Network desync rilevato.{NEWLINE}File log: {STRING}
STR_6319 :Blocco freno chiuso
STR_6320 :Indistruttibile
STR_6321 :L’aggiunta è rotta
STR_6322 :{WINDOW_COLOUR_2}Sprite Id: {BLACK}{INT32}
STR_6322 :{WINDOW_COLOUR_2}Id entità: {BLACK}{INT32}
STR_6323 :Simulazione
STR_6324 :Simula
STR_6325 :Simula attrazione
@@ -3598,9 +3598,9 @@ STR_6487 :Mostra/nascondi personale
STR_6488 :{RED}I visitatori si lamentano per la lunghezza delle code nel tuo parco.{NEWLINE}Prendi in considerazione di accorciare quelle problematiche o di aumentare il flusso di visitatori delle attrazioni.
STR_6489 :Errore: versione parco non compatibile
STR_6490 :Avviso: versione parco semi-compatibile
STR_6491 :Questo parco è stato salvato in una versione più recente di OpenRCT2. Il parco è v{INT32} e richiede almeno v{INT32}.
STR_6491 :Questo parco è stato salvato in una versione più recente di OpenRCT2. Il parco è stato salvato nella v{INT32} e richiede almeno v{INT32}. Si sta usando la v{INT32}.
STR_6492 :Questo parco è stato salvato in una versione più vecchia di OpenRCT2 e non può essere aperto con questa versione. Il parco è v{INT32}.
STR_6493 :Questo parco è stato salvato in una versione più recente di OpenRCT2, alcuni dati potrebbero essere persi. Il parco è v{INT32} e richiede almeno v{INT32}.
STR_6493 :Questo parco è stato salvato in una versione più recente di OpenRCT2, alcuni dati potrebbero essere persi. Il parco è stato salvato nella v{INT32}. Si sta usando la v{INT32}.
STR_6494 :Raggruppa per tipo attrazione
STR_6495 :Raggruppa le attrazioni in base al loro tipo anziché mostrare ogni veicolo separatamente.
STR_6496 :{WINDOW_COLOUR_2}{STRINGID}
@@ -3622,11 +3622,84 @@ STR_6511 :Zero G Roll (Dx)
STR_6512 :Zero G Roll Grande (Sx)
STR_6513 :Zero G Roll Grande (Dx)
STR_6514 :Altezza non valida!
STR_6515 :{BLACK}RCT1 non collegato - saranno usate immagini di ripiego.
STR_6516 :Uno o più oggetti aggiunti necessitano che RCT1 sia collegato per una corretta visualizzazione. Saranno usate immagini di ripiego.
STR_6517 :Uno o più oggetti di questo parco necessitano che RCT1 sia collegato per una corretta visualizzazione. Saranno usate immagini di ripiego.
STR_6515 :{BLACK}RollerCoaster Tycoon 1 non collegato - saranno usate immagini di ripiego.
STR_6516 :Uno o più oggetti aggiunti necessitano che RollerCoaster Tycoon 1 sia collegato per una corretta visualizzazione. Saranno usate immagini di ripiego.
STR_6517 :Uno o più oggetti di questo parco necessitano che RollerCoaster Tycoon 1 sia collegato per una corretta visualizzazione. Saranno usate immagini di ripiego.
STR_6518 :{BLACK}Passa il cursore sopra a uno scenario per visualizzare la sua descrizione e il suo obiettivo. Fai clic per iniziare a giocare.
STR_6519 :Extra
STR_6520 :Pacchetti di risorse
STR_6521 :Bassa priorità
STR_6522 :Alta priorità
STR_6523 :Abbassa la priorità del pacchetto di risorse selezionato.
STR_6524 :Aumenta la priorità del pacchetto di risorse selezionato.
STR_6525 :Ricarica tutte le risorse nel gioco con i pacchetti di risorse attivi.
STR_6526 :(grafica, musica ed effetti sonori di base)
STR_6527 :Competizioni
STR_6528 :Parametri del tracciato non validi!
STR_6529 :Parametro dello schema colore non valido!
STR_6530 :User Created Expansion Set
STR_6531 :The Time Machine
STR_6532 :Katy’s Dreamworld
STR_6533 :{WINDOW_COLOUR_2}Fattore di divertimento: {BLACK}-{COMMA16}%
STR_6534 :{WINDOW_COLOUR_2}Fattore d’intensità: {BLACK}-{COMMA16}%
STR_6535 :{WINDOW_COLOUR_2}Fattore di nausea: {BLACK}-{COMMA16}%
STR_6536 :Questo parco è stato salvato in una versione più recente di OpenRCT2. il parco è stato salvato nella v{INT32}, si sta usando la v{INT32}.
STR_6537 :Permette di usare percorsi regolari come code
STR_6538 :Mostra i percorsi regolari nel menu a cascata della finestra dei Sentieri.
STR_6539 :Freno chiuso
STR_6540 :{WINDOW_COLOUR_2}Un ringraziamento speciale alle seguenti aziende per aver concesso l'utilizzo della loro immagine:
STR_6541 :{WINDOW_COLOUR_2}Rocky Mountain Construction Group, Josef Wiegand GmbH & Co. KG
STR_6542 :Collaboratori
STR_6543 :Collaboratori…
STR_6544 :I prestiti non posso essere negativi!
STR_6545 :Usa il calcolo dell’intersse di RCT1
STR_6546 :Usa l’algoritmo di calcolo dell’interesse di RollerCoaster Tycoon 1, che usa una percentuale fissa del circa 1.33%.
STR_6547 :Tutto lo scenario
STR_6548 :Mostra le ringhiere agli incroci
STR_6549 :Gli oggetti per la compatibilità non possono essere selezionati!
STR_6550 :Questa voce è inclusa per retrocompatibilità con oggetti vecchi o danneggiati. Non può essere selezionata, solo deselezionata.
STR_6551 :Verde militare
STR_6552 :Verde pallido
STR_6553 :Tanno
STR_6554 :Marrone
STR_6555 :Rosa corallo
STR_6556 :Verde foresta
STR_6557 :Chartreuse
STR_6558 :Verde cacciatore
STR_6559 :Celadon
STR_6560 :Verde lime
STR_6561 :Seppia
STR_6562 :Pesca
STR_6563 :Pervinca
STR_6564 :Verde viridiano
STR_6565 :Verde schiuma marina
STR_6566 :Violetto
STR_6567 :Lavanda
STR_6568 :Arancio pastello
STR_6569 :Acqua Profonda
STR_6570 :Rosa pastello
STR_6571 :Terra d’ombra
STR_6572 :Beige
STR_6573 :Invisibile
STR_6574 :Oblio
STR_6575 :Peremtti combinazioni di colori speciali
STR_6576 :Aggiunge i colori speciali al menu a cascata dei colori
STR_6577 :Velocità freni di blocco
STR_6578 :Fissa un limite di velocità per i freni di blocco. In modalità sezione a blocchi, freni adiacenti con una velocità inferiore sono collegati con i freni di blocco.
STR_6579 :I freni di blocco saranno impostati alla velocità predefinita quando salvati come progetto di percorso
STR_6580 :Ripristina
STR_6581 :Si è sicuri di voler ripristinare tutte le scorciatorie di questa scheda?
STR_6582 :Finestra delle scorciatoie da tastiera
STR_6583 :{WINDOW_COLOUR_2}Treni invertiti
STR_6584 :Selezionare per far andare i treni al contrario
STR_6585 :Impossibile effettuare modifiche…
STR_6586 :OpenRCT2
STR_6587 :Il tema principale di OpenRCT2 è un lavoro di Allister Brimble,{NEWLINE}con licensa CC BY-SA 4.0.
STR_6588 :Si ringrazia Herman Riddering per averci permesso di registrare il 35er Voigt.
STR_6589 :Mostra i pulsanti di controllo della finestra a sinistra
STR_6590 :Mostra i pulsanti di controllo della finestra a sinistra della barra del titolo invece che a destra.
STR_6591 :Il dipendente sta riparando un’attrazione e non può essere licenziato.
STR_6592 :Il dipendente sta ispezionando un’attrazione e non può essere licenziato.
#############
@@ -4383,3 +4456,102 @@ STR_DTLS :Questo vecchio parco a tema ha vissuto tempi migliori. Aiuta il pro
STR_SCNR :Il Mondo dei Panda
STR_PARK :Il Mondo dei Panda
STR_DTLS :Aggiungi più attrazioni per attirare più visitatori in questo parco a tema sui panda.
###
<UCES Halloween>
STR_SCNR :Cemetery Ridge
STR_PARK :Cemetery Ridge
STR_DTLS :Questo è Halloween, l’Halloween di UCES, le zucche urlano nel bel mezzo della notte! Questo cimitero è in grossi guai e tocca a te salvarlo, lasciando però i morti riposare in pace! Sarai in grado di tenere i fantasmi all’interno delle loro tombe e far rabbrividire i tuoi visitatori?{NEWLINE}Autore: Squid
###############################################################################
## UCES: The Time Machine (2003)
###############################################################################
<Lighthouse of Alexandria by Katatude for UCES>
STR_SCNR :The Lighthouse of Alexandria
STR_PARK :The Lighthouse of Alexandria
STR_DTLS :Alessandro costruì la città; i greci, i romani e gli egiziani lasciarono le loro tracce. Ma il più grande regalo è una delle Meraviglie del Mondo Antico, il Faro. Visitalo e creaci un parco!{NEWLINE}Autore: Katatude
<Cleveland's Luna Park>
STR_SCNR :Luna Park, Cleveland
STR_PARK :Luna Park
STR_DTLS :Proprio com’era il giorno della sua apertura, il 18 maggio 1905.{NEWLINE}Autore: Aetherwave
<Mount Vesuvius 1700 A.D. by Katatude for UCES>
STR_SCNR :Mount Vesuvius
STR_PARK :Mount Vesuvius
STR_DTLS :Pompei ed Ercolano furono ricoperte dal Vesuvio nel 79 a.C. Visita gli scavi e costruiscici un parco!{NEWLINE}Autore: Katatude
<The Sandbox by Katatude for UCES>
STR_SCNR :The Sandbox
STR_PARK :The Sandbox
STR_DTLS :Quello che tutti desiderano - una sandbox! Quindi prendi secchio e pala e costruisci un parco!{NEWLINE}Autore: Katatude
<Niagara Falls & Gorge by Katatude for UCES>
STR_SCNR :Niagara Falls & Gorge
STR_PARK :Niagara Falls
STR_DTLS :Le American Falls, le Bridal Falls e le Canadian Horseshoe Falls sul confine del Niagara, 1850.{NEWLINE}Autore: Katatude
<Rocky Mountain Miners>
STR_SCNR :Rocky Mountain Miners
STR_PARK :Rocky Mountain Miners
STR_DTLS :Una frana ha danneggiato la tua ferrovia. I tuoi lavoratori sono andati a scavare, ci sarà dell’oro nelle montagne russe?{NEWLINE}Autori: Squid, Buckone, Fossil
<The Time Machine by Katatude for UCES>
STR_SCNR :The Time Machine
STR_PARK :The Time Machine
STR_DTLS :La macchina del tempo. Costruisci e viaggia, dove vuoi, quando vuoi. L’eternità ti aspetta. È tutto relativo.{NEWLINE}Autore: Katatude
<Tower of Babel>
STR_SCNR :Tower of Babel
STR_PARK :Tower of Babel
STR_DTLS :Ehii! Guarda dove ci ha portato adesso la macchina del tempo! Dove sono finiti tutti?{NEWLINE}Autore: Fossil
<Transformation>
STR_SCNR :Transformation
STR_PARK :Transformation
STR_DTLS :Ti stavamo aspettando…{NEWLINE}Autore: Fossil
<Urbis Incognitus>
STR_SCNR :Urbis Incognitus
STR_PARK :Urbis Incognitus
STR_DTLS :I romani sono stanchi delle lotte noiose tra gladiatori. Dagli qualcosa di più eccitante, trasforma la città romana nel più grande parco divertimenti della storia!{NEWLINE}Autore: Kaffe
###############################################################################
## UCES: Katy’s Dreamworld (2003)
###############################################################################
<Beneath the Christmas Tree by Katatude for UCES>
STR_SCNR :Beneath the Christmas Tree
STR_PARK :Winter Wonderland
STR_DTLS :La mamma ha costruito questa scena sotto al nostro albero. Ora vuole che ci costruiamo un parco! Puoi aiutarci?{NEWLINE}Autore: Katatude
<Bigrock Blast>
STR_SCNR :Bigrock Blast
STR_PARK :Bigrock Blast
STR_DTLS :Dopo un’esplosione alle Miniere Pietragrossa S.p.A., agli abitanti di Pietragrossa tocca costruire un parco divertimenti per mantenere la loro città viva.{NEWLINE}Autori: rbarclay & buckone
<Camp Mockingbird for UCES by Katatude>
STR_SCNR :Camp Mockingbird
STR_PARK :Camp Mockingbird
STR_DTLS :Solo 500 dollari a settimana per questo campo estivo! Spacca il salvadanaio e divertiti a costruire un parco.{NEWLINE}Autore: Katatude
<Choo Choo Town>
STR_SCNR :Choo-Choo Town
STR_PARK :Choo-Choo Town
STR_DTLS :Mamma! Papà! Voglio andare a Choo-Choo Town!{NEWLINE}Autore: Fossil
<Dragon Islands>
STR_SCNR :Dragon Islands
STR_PARK :Dragon Islands
STR_DTLS :L’isola dei dragoni? Non sono sicuro di volerci andare…{NEWLINE}Autore: Fossil
<Kiddy Karnival II>
STR_SCNR :Kiddie Karnival II
STR_PARK :Kiddie Karnival
STR_DTLS :Ehi bambini! Divertiamoci!{NEWLINE}Autori: Piehead & Fossil
<Sand Dune>
STR_SCNR :Sand Dune
STR_PARK :Sand Dune
STR_DTLS :In veste di proprietario di un piccolo parco, hai acquistato un ampio terreno lungo la costa per espanderti e portare più visitatori tra le dune di sabbia, ma stai attento: non puoi disturbare queste dune così ecologicamente fragili!{NEWLINE}Autore: rbarclay
+7 -1
View File
@@ -3690,7 +3690,13 @@ STR_6582 :키보드 단축키 창 열기
STR_6583 :{WINDOW_COLOUR_2}역방향 차량
STR_6584 :차량을 뒤집어서 운행하려면 체크하세요
STR_6585 :변경할 수 없습니다…
STR_6586 :OpenRCT2
STR_6587 :Allister Brimble이 제작한 OpenRCT2 타이틀 테마 음악{NEWLINE}저작권: CC BY-SA 4.0.
STR_6588 :35er Voigt 녹음을 허락해주신 Herman Riddering에게 감사드립니다.
STR_6589 :창 버튼을 왼쪽에 표시
STR_6590 :창 버튼(e.g. 창 닫기 버튼)을 타이틀 바의 오른쪽 대신 왼쪽에 표시합니다.
STR_6591 :직원이 지금 놀이기구를 수리하고 있어서 해고할 수 없습니다.
STR_6592 :직원이 지금 놀이기구를 점검하고 있어서 해고할 수 없습니다.
#############
# Scenarios #
+7
View File
@@ -3686,6 +3686,13 @@ STR_6582 :Sneltoetsen openen
STR_6583 :{WINDOW_COLOUR_2}Achterstevoren
STR_6584 :Keert de trein om, zodat hij achterstevoren over de baan rijdt.
STR_6585 :Kan dit niet wijzigen…
STR_6586 :OpenRCT2
STR_6587 :De titelmuziek van OpenRCT2 Title Theme is gemaakt door Allister Brimble,{NEWLINE}en beschikbaar gemaakt onder de CC BY-SA 4.0-licentie.
STR_6588 :Met dank aan Herman Riddering, die ons toestemming gaf om zijn 35er Voigt op te nemen.
STR_6589 :Vensterknoppen aan de linkerkant
STR_6590 :Verplaatst de vensterknoppen (o.a. voor het sluiten van het venster), die normaal gesproken rechts staan, naar de linkerkant van de titelbalk.
STR_6591 :Deze werknemer is momenteel bezig met het repareren van een attractie en kan daarom niet worden ontslagen.
STR_6592 :Deze werknemer is momenteel bezig met het inspecteren van een attractie en kan daarom niet worden ontslagen.
#############
# Scenarios #
+1 -1
View File
@@ -970,7 +970,7 @@ STR_1581 :
STR_1582 :
STR_1583 :
STR_1584 :“To zdjęcie z przejażdżki na {STRINGID} było naprawdę opłacalne”
STR_1585 :“To zdjęcie z przejażdżki na {STRINGID} było naprawdę opłacalneENDQUOTES}
STR_1585 :“To zdjęcie z przejażdżki na {STRINGID} było naprawdę opłacalne”
STR_1586 :“To zdjęcie z przejażdżki na {STRINGID} było naprawdę opłacalne”
STR_1587 :“Ten precel z {STRINGID} był naprawdę opłacalny”
STR_1588 :“Ta gorąca czekolada z {STRINGID} była naprawdę opłacalna”
+7
View File
@@ -3687,6 +3687,13 @@ STR_6582 :Abrir janela de atalhos do teclado
STR_6583 :{WINDOW_COLOUR_2}Trens Invertidos
STR_6584 :Selecione para que os trens operem de costas
STR_6585 :Não é possível fazer alterações…
STR_6586 :OpenRCT2
STR_6587 :A música tema do OpenRCT2 é uma criação de Allister Brimble,{NEWLINE}licenciada com CC BY-SA 4.0.
STR_6588 :Agradecemos a Herman Riddering por nos deixar gravar a 35er Voigt.
STR_6589 :Mostrar botões de janela à esquerda
STR_6590 :Mostra os botões de janela (como o de fechar a janela) à esquerda do topo, em vez de à direita.
STR_6591 :O funcionário está atualmente consertando uma atração e não pode ser demitido.
STR_6592 :O funcionário está atualmente inspecionando uma atração e não pode ser demitido.
#############
# Scenarios #
+7
View File
@@ -3687,6 +3687,13 @@ STR_6582 :打开快捷键窗口
STR_6583 :{WINDOW_COLOUR_2}反向列车
STR_6584 :选择反向运行列车
STR_6585 :无法做出更改……
STR_6586 :OpenRCT2
STR_6587 :OpenRCT2的标题样式由Allister Brimble设计,{NEWLINE}许可证类型 CC BY-SA 4.0.
STR_6588 :感谢Herman Riddering允许我们录制“35er Voigt”。
STR_6589 :在左侧显示窗口按钮
STR_6590 :在左侧显示窗口按钮(例如关闭窗口的按钮)在标题栏左侧而不是右侧。
STR_6591 :维修人员目前正在修理游乐设施,不能被开除。
STR_6592 :维修人员目前正在检查游乐设施,不能被开除。
#############
# Scenarios #
+50 -2
View File
@@ -1,12 +1,59 @@
0.4.6 (in development)
------------------------------------------------------------------------
- Feature: [#15660] Ability to show window buttons on the left.
- Feature: [#20680] New title sequences (https://github.com/OpenRCT2/title-sequences/releases/tag/v0.4.6).
- Feature: [OpenMusic#41] Official Title Theme by Allister Brimble.
- Improved: [#20119, #20243] Add new colour presets to several roller coasters (using the new colours).
- Improved: [#20393, #20410] Add Cyrillic characters Ґґ, Ѕѕ, Єє, Іі, Її, and Јј to the sprite font.
- Change: [#19785] OpenMusic is now selected by default when opening SC4/SC6 - or creating new - scenarios.
- Change: [#20110] Fix a few RCT1 build height parity discrepancies.
- Change: [#20550] Change SEK conversion rate from 1 GBP to 0.1 GBP.
- Fix: [#6152] Camera and UI are no longer locked at 40 Hz, providing a smoother experience.
- Fix: [#9534] Screams no longer cut-off on steep diagonal drops.
- Fix: [#17666] Using the mountain tool near the edge of the map with clearance checks disabled causes visual glitches.
- Fix: [#19450] The correct element is now auto-suggested when building a Medium Half Loop backwards.
- Fix: [#19735] Server unable to advertise to master server after a connection loss.
- Fix: [#19822] Tile inspector does not deep copy banners.
- Fix: [#19823] Parkobj: disallow overriding objects of different object types.
- Fix: [#19878] Unresearched scenery can be placed via prebuilt rides.
- Fix: [#20083] Cannot use terrain surfaces with ID > 32 and terrain edges with ID > 16.
- Fix: [#20089] Potential crash when a window is closed from another window.
- Fix: [#20103] [Plugin] Crash when custom plugin actions fail due to immutable state.
- Fix: [#20111] All coaster types can access the new diagonal slope pieces.
- Fix: [#20155] Fairground organ style 2 shows up as regular music, rather than for the merry-go-round.
- Fix: [#20260] Ride locks up when inspecting/fixing staff member is fired.
- Fix: [#20262] Title screen music missing when “random” title music is selected and RCT1 is no longer linked.
- Fix: [#20310] Map animations are not created on the title screen.
- Fix: [#20342] Large Half Loop (left) now only appears once in the special elements dropdown.
- Fix: [#20361] Crash when using random map generation.
- Fix: [#20364] Adding too much money with cheats causes an overflow.
- Fix: [#20365] Money cheat input does not support negative values.
- Fix: [#20389] Reversed vehicles are now correctly banked on diagonal slopes.
- Fix: [#20413] Crash when attempting to navigate an empty console history.
- Fix: [#20417] Plugin/custom windows are missing the left border in the title bar.
- Fix: [#20429] Error window tooltip not closing after 8 seconds.
- Fix: [#20456] Downward large half loops on flying coasters (fly-to-lie) are now correctly named.
- Fix: [#20484] Console caret not properly updated when using command history.
- Fix: [#20496] Ride rating requirements for compact inverted coasters is no longer relaxed.
- Fix: [#20543] Crash using show segments height from debug paint options.
- Fix: [#20607] Infinite loop when renaming rides with default names longer than 32 bytes.
- Fix: [#20642] Track list is sometimes empty due to uninitialized data for the filter string.
- Fix: [#20659] Phantom rides remain when closing construction window while paused.
- Fix: [#20672] Maze ghost elements incorrectly displayed.
- Fix: [#20684] Footpath additions getting removed by Miniature railway ghost elements.
- Fix: [#20693] Incorrect information shown when hovering over station when another station before it was removed.
- Fix: [#20739] Build version info on title screen leaving stray pixels when the camera is moved.
0.4.5 (2023-05-08)
------------------------------------------------------------------------
- Feature: [#18713] Block brakes have speed control and brakes slower than adjacent block brakes copy block brake speed when block brake open.
- Feature: [#18713] Block brakes have speed control and brakes slower than adjacent block brakes copy block brake speed when the block brake is open.
- Feature: [#19276] Add Powered Lifthill to Giga Coaster.
- Feature: [#19305] Add new Reversed Trains ride setting to run trains backwards, granting a bonus to ride ratings.
- Feature: [#19305] [Plugin] Add “Car.isReversed” to allow individual ride vehicles to run backwards.
- Feature: [#19446] Add new color options to color dropdown.
- Feature: [#19446] Add new colour options to colour dropdown.
- Feature: [#19547] Add large sloped turns to hybrid coaster and single rail coaster.
- Feature: [#19930] Add plugin APIs for research.
- Feature: [#19979] Add plugin API for scenery groups.
- Feature: [OpenMusic#25] Added Prehistoric ride music style.
- Feature: [OpenMusic#26] Fairground Organ style 2 with new recordings from Herman's 35er Voigt (Previously known as Bressingham Voigt).
- Feature: [OpenMusic#28] Add Ragtime style 2 ride music.
@@ -33,6 +80,7 @@
- Fix: [#19767] No message when path is not connected to ride exit and is therefore unreachable for mechanics.
- Fix: [#19800] Crash when displaying station stats with more than 62 stations.
- Fix: [#19801] The in-game load/save window cannot be resized anymore.
- Fix: [#19832] Some scenery group items missing from all scenery tab.
- Fix: [#19854] Looping Coaster trains clipping through steep quarter turns down.
- Fix: [#19858] Issue drawing simulate flag icon on alternate colour palettes.
- Fix: [#19901] Random shop colours never assigning last colour.
+221 -14
View File
@@ -41,6 +41,10 @@ declare global {
var climate: Climate;
/** APIs for performance profiling. */
var profiler: Profiler;
/**
* APIs for getting, loading, and unloading objects.
*/
var objectManager: ObjectManager;
/**
* APIs for creating and editing title sequences.
* These will only be available to clients that are not running headless mode.
@@ -217,19 +221,40 @@ declare global {
captureImage(options: CaptureOptions): void;
/**
* Gets the loaded object at the given index.
* @param type The object type.
* @param index The index.
* @deprecated Use {@link ObjectManager.getObject} instead.
*/
getObject(type: ObjectType, index: number): LoadedImageObject;
getObject(type: "music", index: number): LoadedObject;
/**
* @deprecated Use {@link ObjectManager.getObject} instead.
*/
getObject(type: "ride", index: number): RideObject;
/**
* @deprecated Use {@link ObjectManager.getObject} instead.
*/
getObject(type: "small_scenery", index: number): SmallSceneryObject;
/**
* @deprecated Use {@link ObjectManager.getObject} instead.
*/
getObject(type: "music", index: number): LoadedObject;
/**
* @deprecated Use {@link ObjectManager.getAllObjects} instead.
*/
getAllObjects(type: ObjectType): LoadedImageObject[];
getAllObjects(type: "music"): LoadedObject[];
/**
* @deprecated Use {@link ObjectManager.getAllObjects} instead.
*/
getAllObjects(type: "ride"): RideObject[];
/**
* @deprecated Use {@link ObjectManager.getAllObjects} instead.
*/
getAllObjects(type: "music"): LoadedObject[];
/**
* Gets the {@link TrackSegment} for the given type.
* @param type The track segment type.
@@ -1586,10 +1611,80 @@ declare global {
removeElement(index: number): void;
}
type ObjectSourceGame =
"rct1" |
"added_attractions" |
"loopy_landscapes" |
"rct2" |
"wacky_worlds" |
"time_twister" |
"custom" |
"openrct2_official";
type ObjectGeneration = "dat" | "json";
/**
* Represents an installed OpenRCT2 object which may or may not be currently loaded into the park.
*/
interface InstalledObject {
/**
* The full path of the object file.
*/
readonly path: string;
/**
* Whether the object is an original .DAT file, or a .parkobj / .json file.
*/
readonly generation: ObjectGeneration;
/**
* The object type.
*/
readonly type: ObjectType;
/**
* The original game or expansion pack this object first appeared in.
*/
readonly sourceGames: ObjectSourceGame[];
/**
* The unique identifier of the object, e.g. "rct2.burgb".
* For legacy DAT objects, the identifier will be in a format similar to "09F55405|DirtGras|B9B19A7F".
*/
readonly identifier: string;
/**
* The original unique identifier of the object, e.g. "BURGB ".
* This may have trailing spaces if the name is shorter than 8 characters.
* Only .DAT objects or JSON objects based on .DAT objects will have legacy identifiers.
*/
readonly legacyIdentifier: string | null;
/**
* The object version, e.g. "1.5.2-pre".
*/
readonly version: string;
/**
* Gets the list of authors for the object.
*/
readonly authors: string[];
/**
* The name in the user's current language.
*/
readonly name: string;
}
/**
* Represents the definition of a loaded object (.DAT or .json) such as ride type or scenery item.
*/
interface LoadedObject {
/**
* Gets a reference to the installed object.
*/
readonly installedObject: InstalledObject;
/**
* The object type.
*/
@@ -1602,7 +1697,7 @@ declare global {
/**
* The unique identifier of the object, e.g. "rct2.burgb".
* Only JSON objects will have an identifier.
* For legacy DAT objects, the identifier will be in a format similar to "09F55405|DirtGras|B9B19A7F".
*/
readonly identifier: string;
@@ -1752,10 +1847,19 @@ declare global {
readonly numVerticalFramesOverride: number;
}
interface SceneryObject extends LoadedImageObject {
/**
* A list of scenery groups this object belongs to. This may not contain any
* scenery groups that contain this object by default. This is typically
* used for custom objects to be part of existing scenery groups.
*/
readonly sceneryGroups: string[];
}
/**
* Represents the object definition of a small scenery item such a tree.
*/
interface SmallSceneryObject extends LoadedImageObject {
interface SmallSceneryObject extends SceneryObject {
/**
* Raw bit flags that describe characteristics of the scenery item.
*/
@@ -1777,6 +1881,32 @@ declare global {
readonly removalPrice: number;
}
interface LargeSceneryObject extends SceneryObject {
}
interface WallObject extends SceneryObject {
}
interface FootpathAdditionObject extends SceneryObject {
}
interface BannerObject extends SceneryObject {
}
/**
* Represents the object definition of a scenery group.
*/
interface SceneryGroupObject extends LoadedImageObject {
/**
* The scenery items that belong to this scenery group.
*/
readonly items: string[];
}
/**
* Represents a ride or stall within the park.
*/
@@ -2337,11 +2467,11 @@ declare global {
* The current tilt of the car in the X/Y axis.
*/
bankRotation: number;
/**
* Whether the car sprite is reversed or not.
*/
isReversed: boolean;
/**
* Whether the car sprite is reversed or not.
*/
isReversed: boolean;
/**
* The colour of the car.
@@ -3443,7 +3573,7 @@ declare global {
/**
* The objective type.
*/
type: ScenarioObjective;
type: ScenarioObjectiveType;
/**
* The required number of guests.
@@ -3869,7 +3999,7 @@ declare global {
"map_north_pressed" | "map_south" | "map_south_pressed" | "map_west" | "map_west_pressed" |
"mountain_tool_even" | "mountain_tool_odd" | "multiplayer" | "multiplayer_desync" | "multiplayer_sync" |
"multiplayer_toolbar" | "multiplayer_toolbar_pressed" | "mute" | "mute_pressed" | "news_messages" |
"normal_selection_6x6" | "paste" | "path_railings" | "path_surfaces" | "paths" | "placeholder" |
"normal_selection_6x6" | "palette_invisible" | "palette_invisible_pressed" | "paste" | "path_railings" | "path_surfaces" | "paths" | "placeholder" |
"rct1_close_off" | "rct1_close_off_pressed" | "rct1_close_on" | "rct1_close_on_pressed" | "rct1_open_off" |
"rct1_open_off_pressed" | "rct1_open_on" | "rct1_open_on_pressed" | "rct1_simulate_off" |
"rct1_simulate_off_pressed" | "rct1_simulate_on" | "rct1_simulate_on_pressed" | "rct1_test_off" |
@@ -4588,4 +4718,81 @@ declare global {
readonly parents: number[];
readonly children: number[];
}
interface ObjectManager {
/**
* Gets all the objects that are installed and can be loaded into the park.
*/
readonly installedObjects: InstalledObject[];
/**
* Gets the installed object with the given identifier, or null
* if the object was not found.
* @param identifier The object identifier.
*/
getInstalledObject(identifier: string): InstalledObject | null;
/**
* Attempt to load the object into the current park at the given index for the object type.
* If an object already exists at the given index, that object will be unloaded and this object
* will replace it, providing the object type is the same.
* @param identifier The object identifier.
* @param index The index to load the object to. If not provided, an empty slot will be used.
* @returns The index of the loaded object.
*/
load(identifier: string, index?: number): LoadedObject | null;
/**
* Attempt to load the given objects into the current park, given they are not already loaded.
*/
load(identifiers: string[]): (LoadedObject | null)[];
/**
* Unloads the object, if loaded.
* @param identifier The object identifier to unload.
*/
unload(identifier: string): void;
/**
* Unloads the specified objects, if loaded.
* @param identifiers The object identifiers to unload.
*/
unload(identifiers: string[]): void;
/**
* Unloads the specified object, if loaded.
* @param type The object type.
* @param index The index of the slot to unload for the given type.
*/
unload(type: ObjectType, index: number): void;
/**
* Gets the loaded object at the given index.
* @param type The object type.
* @param index The index.
*/
getObject(type: ObjectType, index: number): LoadedObject;
getObject(type: "ride", index: number): RideObject;
getObject(type: "small_scenery", index: number): SmallSceneryObject;
getObject(type: "large_scenery", index: number): LargeSceneryObject;
getObject(type: "wall", index: number): WallObject;
getObject(type: "footpath_addition", index: number): FootpathAdditionObject;
getObject(type: "banner", index: number): BannerObject;
getObject(type: "scenery_group", index: number): SceneryGroupObject;
getObject(type: "music", index: number): LoadedObject;
/**
* Gets all the currently loaded objects for a given object type.
* @param type The object type.
*/
getAllObjects(type: ObjectType): LoadedObject[];
getAllObjects(type: "ride"): RideObject[];
getAllObjects(type: "small_scenery"): SmallSceneryObject[];
getAllObjects(type: "large_scenery"): LargeSceneryObject[];
getAllObjects(type: "wall"): WallObject[];
getAllObjects(type: "footpath_addition"): FootpathAdditionObject[];
getAllObjects(type: "banner"): BannerObject[];
getAllObjects(type: "scenery_group"): SceneryGroupObject[];
getAllObjects(type: "music"): LoadedObject[];
}
}
+3 -3
View File
@@ -58,7 +58,7 @@
C4549: 'operator': operator before comma has no effect; did you intend 'operator'?
C4555: expression has no effect; expected expression with side-effect
-->
<PreprocessorDefinitions>BENCHMARK_STATIC_DEFINE;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;NOMINMAX;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;NOMINMAX;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Platform)'=='Win32' or '$(Platform)'=='x64'">__AVX2__;__SSE4_1__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ENABLE_SCRIPTING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary Condition="'$(UseSharedLibs)'!='true'">MultiThreaded</RuntimeLibrary>
@@ -86,7 +86,7 @@
</ClCompile>
<Link>
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
<AdditionalDependencies>benchmark.lib;brotlicommon-static.lib;brotlidec-static.lib;brotlienc-static.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>brotlicommon-static.lib;brotlidec-static.lib;brotlienc-static.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Breakpad)'=='true' and ('$(Platform)'=='Win32' or '$(Platform)'=='x64')">libbreakpadd.lib;libbreakpad_clientd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>bz2d.lib;discord-rpc.lib;flac.lib;freetyped.lib;libpng16d.lib;ogg.lib;speexdsp.lib;SDL2-staticd.lib;vorbis.lib;vorbisfile.lib;zip.lib;zlibd.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
@@ -107,7 +107,7 @@
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>benchmark.lib;brotlicommon-static.lib;brotlidec-static.lib;brotlienc-static.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>brotlicommon-static.lib;brotlidec-static.lib;brotlienc-static.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Breakpad)'=='true' and ('$(Platform)'=='Win32' or '$(Platform)'=='x64')">libbreakpad.lib;libbreakpad_client.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>bz2.lib;discord-rpc.lib;flac.lib;freetype.lib;libpng16.lib;ogg.lib;speexdsp.lib;SDL2-static.lib;vorbis.lib;vorbisfile.lib;zip.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
+4 -4
View File
@@ -43,14 +43,14 @@
<LibsSha1 Condition="'$(Platform)'=='x64'">930df83ef49d91b1ef886f5dbf0a9cb61d704a50</LibsSha1>
<LibsUrl Condition="'$(Platform)'=='ARM64'">https://github.com/OpenRCT2/Dependencies/releases/download/v34/openrct2-libs-v34-arm64-windows-static.zip</LibsUrl>
<LibsSha1 Condition="'$(Platform)'=='ARM64'">bd338aa3da9a357fb996dcaa6cea02c4f906718c</LibsSha1>
<TitleSequencesUrl>https://github.com/OpenRCT2/title-sequences/releases/download/v0.4.0/title-sequences.zip</TitleSequencesUrl>
<TitleSequencesSha1>4ab0065e5a4d9f9c77d94718bbdfcfcd5a389da0</TitleSequencesSha1>
<TitleSequencesUrl>https://github.com/OpenRCT2/title-sequences/releases/download/v0.4.6/title-sequences.zip</TitleSequencesUrl>
<TitleSequencesSha1>80fefc6ebbabc42a6f4703412daa5c62f661420d</TitleSequencesSha1>
<ObjectsUrl>https://github.com/OpenRCT2/objects/releases/download/v1.3.11/objects.zip</ObjectsUrl>
<ObjectsSha1>02ddf6c685a2da8bac98a57b34be95d63192443d</ObjectsSha1>
<OpenSFXUrl>https://github.com/OpenRCT2/OpenSoundEffects/releases/download/v1.0.3/opensound.zip</OpenSFXUrl>
<OpenSFXSha1>ffec5a97bd5035860c4c9a43fe32cf51886478e3</OpenSFXSha1>
<OpenMSXUrl>https://github.com/OpenRCT2/OpenMusic/releases/download/v1.3.0/openmusic.zip</OpenMSXUrl>
<OpenMSXSha1>b0cec998a3679f1cde17d91f2508ec4923c1a25c</OpenMSXSha1>
<OpenMSXUrl>https://github.com/OpenRCT2/OpenMusic/releases/download/v1.3.1/openmusic.zip</OpenMSXUrl>
<OpenMSXSha1>cb7b05af97aaf7949fb509063d45df6613f20521</OpenMSXSha1>
<ReplaysUrl>https://github.com/OpenRCT2/replays/releases/download/v0.0.78/replays.zip</ReplaysUrl>
<ReplaysSha1>31C5D07EED8481D5C6D57F9E4FE9443AAEDE7739</ReplaysSha1>
</PropertyGroup>
Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

+314 -247
View File
@@ -305,6 +305,252 @@
"x_offset": 2,
"y_offset": 2
},
{
"path": "icons/colour_invisible.png"
},
{
"path": "icons/colour_invisible_pressed.png"
},
{
"path": "palette_map/palette_map_dark_olive_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_dark_olive_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_saturated_brown_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_bordeaux_red_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_bordeaux_red_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_grass_green_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_grass_green_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_olive_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_olive_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_saturated_green_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_tan_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_tan_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_dull_purple_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_dull_green_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_dull_green_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_saturated_purple_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_saturated_purple_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_orange_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_aqua_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_magenta_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_dull_brown_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_dull_brown_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_invisible.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_void.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_dark_olive_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_dark_olive_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_saturated_brown_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_bordeaux_red_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_bordeaux_red_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_grass_green_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_grass_green_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_olive_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_olive_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_saturated_green_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_tan_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_tan_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_dull_purple_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_dull_green_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_dull_green_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_saturated_purple_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_saturated_purple_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_orange_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_aqua_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_magenta_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_dull_brown_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_dull_brown_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_invisible.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_void.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "surface/glassy_recolourable.png",
"x_offset": -32,
@@ -356,6 +602,11 @@
"palette": "keep",
"forceBmp": true
},
{
"path": "font/cyrillic/U1028-small.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "font/cyrillic/U1041-small.png",
"palette": "keep",
@@ -583,6 +834,23 @@
"palette": "keep",
"forceBmp": true
},
{
"path": "font/cyrillic/U1108-small.png",
"y_offset": 2,
"palette": "keep",
"forceBmp": true
},
{
"path": "font/cyrillic/U1168-small.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "font/cyrillic/U1169-small.png",
"y_offset": 1,
"palette": "keep",
"forceBmp": true
},
{
"path": "font/german-openquotes-small.png",
"y_offset": 6,
@@ -985,6 +1253,11 @@
"palette": "keep",
"forceBmp": true
},
{
"path": "font/cyrillic/U1028-bold.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "font/cyrillic/U1041-bold.png",
"palette": "keep",
@@ -1212,6 +1485,23 @@
"palette": "keep",
"forceBmp": true
},
{
"path": "font/cyrillic/U1108-bold.png",
"y_offset": 2,
"palette": "keep",
"forceBmp": true
},
{
"path": "font/cyrillic/U1168-bold.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "font/cyrillic/U1169-bold.png",
"y_offset": 1,
"palette": "keep",
"forceBmp": true
},
{
"path": "font/german-openquotes-bold.png",
"y_offset": 5,
@@ -1613,6 +1903,11 @@
"palette": "keep",
"forceBmp": true
},
{
"path": "font/cyrillic/U1028-tiny.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "font/cyrillic/U1041-tiny.png",
"palette": "keep",
@@ -1730,6 +2025,7 @@
},
{
"path": "font/cyrillic/U1075-tiny.png",
"y_offset": 1,
"palette": "keep",
"forceBmp": true
},
@@ -1850,6 +2146,23 @@
"palette": "keep",
"forceBmp": true
},
{
"path": "font/cyrillic/U1108-tiny.png",
"y_offset": 1,
"palette": "keep",
"forceBmp": true
},
{
"path": "font/cyrillic/U1168-tiny.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "font/cyrillic/U1169-tiny.png",
"y_offset": 1,
"palette": "keep",
"forceBmp": true
},
{
"path": "font/german-openquotes-tiny.png",
"y_offset": 4,
@@ -2317,7 +2630,7 @@
"path": "track/intamin/liftbooster_0.png",
"x_offset": -21,
"y_offset": -20,
"palette": "keep"
"palette": "keep"
},
{
"path": "track/intamin/liftbooster_1.png",
@@ -20612,251 +20925,5 @@
"x_offset": -5,
"y_offset": -20,
"palette": "keep"
},
{
"path": "icons/colour_invisible.png"
},
{
"path": "icons/colour_invisible_pressed.png"
},
{
"path": "palette_map/palette_map_dark_olive_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_dark_olive_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_saturated_brown_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_bordeaux_red_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_bordeaux_red_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_grass_green_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_grass_green_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_olive_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_olive_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_saturated_green_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_tan_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_tan_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_dull_purple_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_dull_green_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_dull_green_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_saturated_purple_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_saturated_purple_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_orange_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_aqua_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_magenta_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_dull_brown_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_dull_brown_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_invisible.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_void.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_dark_olive_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_dark_olive_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_saturated_brown_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_bordeaux_red_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_bordeaux_red_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_grass_green_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_grass_green_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_olive_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_olive_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_saturated_green_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_tan_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_tan_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_dull_purple_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_dull_green_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_dull_green_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_saturated_purple_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_saturated_purple_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_orange_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_aqua_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_magenta_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_dull_brown_dark.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_dull_brown_light.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_invisible.png",
"palette": "keep",
"forceBmp": true
},
{
"path": "palette_map/palette_map_glass_void.png",
"palette": "keep",
"forceBmp": true
}
]
-1
View File
@@ -21,7 +21,6 @@ int main(int argc, const char** argv)
{
int32_t rc = EXIT_SUCCESS;
int runGame = CommandLineRun(argv, argc);
Platform::CoreInit();
if (runGame == EXITCODE_CONTINUE)
{
gOpenRCT2Headless = true;
+1 -1
View File
@@ -202,7 +202,7 @@ if(MACOS_BUNDLE)
endif()
if(${OPENRCT2_BRANCH} EQUAL master)
if(OPENRCT2_BRANCH EQUAL master)
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${OPENRCT2_VERSION_TAG}")
else()
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${OPENRCT2_VERSION_TAG} ${OPENRCT2_BRANCH}")
+25 -25
View File
@@ -14,12 +14,12 @@
namespace OpenRCT2::Ui
{
// clang-format off
static constexpr const CursorData BlankCursorData =
static constexpr CursorData BlankCursorData =
{
{ 0, 0 }, { 0 }, { 0 }
};
static constexpr const CursorData UpArrowCursorData =
static constexpr CursorData UpArrowCursorData =
{
{ 15, 0 },
{
@@ -44,7 +44,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData UpDownArrowCursorData =
static constexpr CursorData UpDownArrowCursorData =
{
{ 17, 15 },
{
@@ -69,7 +69,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData ZZZCursorData =
static constexpr CursorData ZZZCursorData =
{
{ 0, 0 },
{
@@ -94,7 +94,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData DiagonalArrowCursorData =
static constexpr CursorData DiagonalArrowCursorData =
{
{ 0, 0 },
{
@@ -119,7 +119,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData PickerArrowCursorData =
static constexpr CursorData PickerArrowCursorData =
{
{ 15, 31 },
{
@@ -144,7 +144,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData TreeDownCursorData =
static constexpr CursorData TreeDownCursorData =
{
{ 7, 31 },
{
@@ -169,7 +169,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData FountainDownCursorData =
static constexpr CursorData FountainDownCursorData =
{
{ 7, 31 },
{
@@ -194,7 +194,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData StatueDownCursorData =
static constexpr CursorData StatueDownCursorData =
{
{ 7, 31 },
{
@@ -219,7 +219,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData BenchDownCursorData =
static constexpr CursorData BenchDownCursorData =
{
{ 7, 31 },
{
@@ -244,7 +244,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData CrossHairCursorData =
static constexpr CursorData CrossHairCursorData =
{
{ 15, 15 },
{
@@ -269,7 +269,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData BinDownCursorData =
static constexpr CursorData BinDownCursorData =
{
{ 7, 31 },
{
@@ -294,7 +294,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData LampPostDownCursorData =
static constexpr CursorData LampPostDownCursorData =
{
{ 7, 31 },
{
@@ -319,7 +319,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData FenceDownCursorData =
static constexpr CursorData FenceDownCursorData =
{
{ 7, 31 },
{
@@ -344,7 +344,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData FlowerDownCursorData =
static constexpr CursorData FlowerDownCursorData =
{
{ 7, 31 },
{
@@ -369,7 +369,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData FootpathDownCursorData =
static constexpr CursorData FootpathDownCursorData =
{
{ 7, 31 },
{
@@ -394,7 +394,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData DigDownCursorData =
static constexpr CursorData DigDownCursorData =
{
{ 7, 31 },
{
@@ -419,7 +419,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData WaterDownCursorData =
static constexpr CursorData WaterDownCursorData =
{
{ 7, 31 },
{
@@ -444,7 +444,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData HouseDownCursorData =
static constexpr CursorData HouseDownCursorData =
{
{ 7, 31 },
{
@@ -469,7 +469,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData VolcanoDownCursorData =
static constexpr CursorData VolcanoDownCursorData =
{
{ 7, 31 },
{
@@ -494,7 +494,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData WalkDownCursorData =
static constexpr CursorData WalkDownCursorData =
{
{ 7, 31 },
{
@@ -519,7 +519,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData PaintDownCursorData =
static constexpr CursorData PaintDownCursorData =
{
{ 8, 30 },
{
@@ -544,7 +544,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData EntranceDownCursorData =
static constexpr CursorData EntranceDownCursorData =
{
{ 7, 31 },
{
@@ -569,7 +569,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData HandOpenDownCursorData =
static constexpr CursorData HandOpenDownCursorData =
{
{ 14, 15 },
{
@@ -594,7 +594,7 @@ namespace OpenRCT2::Ui
}
};
static constexpr const CursorData HandClosedDownCursorData =
static constexpr CursorData HandClosedDownCursorData =
{
{ 14, 15 },
{
-1
View File
@@ -44,7 +44,6 @@ int main(int argc, const char** argv)
std::unique_ptr<IContext> context;
int32_t rc = EXIT_SUCCESS;
int runGame = CommandLineRun(argv, argc);
Platform::CoreInit();
RegisterBitmapReader();
if (runGame == EXITCODE_CONTINUE)
{
+3 -3
View File
@@ -60,7 +60,7 @@ namespace OpenRCT2::Ui
std::string ShowFileDialog(SDL_Window* window, const FileDialogDesc& desc) override
{
STUB();
LOG_WARNING("Function %s at %s:%d is a stub.", __PRETTY_FUNCTION__, __FILE__, __LINE__);
return nullptr;
}
@@ -68,7 +68,7 @@ namespace OpenRCT2::Ui
std::string ShowDirectoryDialog(SDL_Window* window, const std::string& title) override
{
LOG_INFO(title.c_str());
STUB();
LOG_WARNING("Function %s at %s:%d is a stub.", __PRETTY_FUNCTION__, __FILE__, __LINE__);
return "/sdcard/rct2";
}
@@ -79,7 +79,7 @@ namespace OpenRCT2::Ui
void OpenURL(const std::string& url) override
{
STUB();
LOG_WARNING("Function %s at %s:%d is a stub.", __PRETTY_FUNCTION__, __FILE__, __LINE__);
}
bool HasFilePicker() const override
+1
View File
@@ -22,6 +22,7 @@
# include <openrct2/ui/UiContext.h>
# include <sstream>
# include <stdexcept>
# include <unistd.h>
namespace OpenRCT2::Ui
{
+1 -1
View File
@@ -172,7 +172,7 @@ public:
void SetFullscreenMode(FULLSCREEN_MODE mode) override
{
static constexpr const int32_t _sdlFullscreenFlags[] = {
static constexpr int32_t _sdlFullscreenFlags[] = {
0,
SDL_WINDOW_FULLSCREEN,
SDL_WINDOW_FULLSCREEN_DESKTOP,
+1 -1
View File
@@ -49,7 +49,7 @@ namespace OpenRCT2::Ui
bool IsSteamOverlayAttached() override
{
STUB();
LOG_WARNING("Function %s at %s:%d is a stub.", __PRETTY_FUNCTION__, __FILE__, __LINE__);
return false;
}
+13 -24
View File
@@ -285,7 +285,7 @@ public:
}
case WindowClass::ScenarioSelect:
return WindowScenarioselectOpen(
reinterpret_cast<scenarioselect_callback>(intent->GetPointerExtra(INTENT_EXTRA_CALLBACK)), false);
reinterpret_cast<scenarioselect_callback>(intent->GetPointerExtra(INTENT_EXTRA_CALLBACK)));
case WindowClass::Null:
// Intent does not hold a window class
@@ -455,34 +455,17 @@ public:
case INTENT_ACTION_INVALIDATE_VEHICLE_WINDOW:
{
auto vehicle = static_cast<Vehicle*>(intent.GetPointerExtra(INTENT_EXTRA_VEHICLE));
auto* w = WindowFindByNumber(WindowClass::Ride, vehicle->ride.ToUnderlying());
if (w == nullptr)
return;
auto ride = vehicle->GetRide();
auto viewVehicleIndex = w->ride.view - 1;
if (ride == nullptr || viewVehicleIndex < 0 || viewVehicleIndex >= ride->NumTrains)
return;
if (vehicle->Id != ride->vehicles[viewVehicleIndex])
return;
w->Invalidate();
if (vehicle != nullptr)
{
WindowRideInvalidateVehicle(*vehicle);
}
break;
}
case INTENT_ACTION_RIDE_PAINT_RESET_VEHICLE:
{
auto rideIndex = intent.GetUIntExtra(INTENT_EXTRA_RIDE_ID);
auto w = WindowFindByNumber(WindowClass::Ride, rideIndex);
if (w != nullptr)
{
if (w->page == 4) // WINDOW_RIDE_PAGE_COLOUR
{
w->vehicleIndex = 0;
}
w->Invalidate();
}
WindowRidePaintResetVehicle(RideId::FromUnderlying(rideIndex));
break;
}
@@ -514,7 +497,7 @@ public:
case INTENT_ACTION_UPDATE_BANNER:
{
uint8_t bannerIndex = static_cast<uint8_t>(intent.GetUIntExtra(INTENT_EXTRA_BANNER_INDEX));
rct_windownumber bannerIndex = static_cast<rct_windownumber>(intent.GetUIntExtra(INTENT_EXTRA_BANNER_INDEX));
WindowBase* w = WindowFindByNumber(WindowClass::Banner, bannerIndex);
if (w != nullptr)
@@ -546,6 +529,12 @@ public:
break;
}
case INTENT_ACTION_TILE_MODIFY:
{
WindowInvalidateByClass(WindowClass::TileInspector);
break;
}
default:
break;
}
@@ -27,7 +27,7 @@ constexpr VDStruct VertexData[4] = {
{ 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f },
};
constexpr const size_t InitialInstancesBufferSize = 32768;
constexpr size_t InitialInstancesBufferSize = 32768;
DrawRectShader::DrawRectShader()
: OpenGLShaderProgram("drawrect")
+46 -30
View File
@@ -32,6 +32,7 @@
#include <openrct2/world/Banner.h>
#include <openrct2/world/Map.h>
#include <openrct2/world/Scenery.h>
#include <optional>
struct RCTMouseData
{
@@ -44,7 +45,7 @@ static RCTMouseData _mouseInputQueue[64];
static uint8_t _mouseInputQueueReadIndex = 0;
static uint8_t _mouseInputQueueWriteIndex = 0;
static uint32_t _ticksSinceDragStart;
static std::optional<uint32_t> _ticksSinceDragStart;
static WidgetRef _dragWidget;
static uint8_t _dragScrollIndex;
static int32_t _originalWindowWidth;
@@ -55,11 +56,11 @@ static uint8_t _currentScrollArea;
ScreenCoordsXY gInputDragLast;
uint16_t gTooltipTimeout;
uint32_t gTooltipCloseTimeout;
WidgetRef gTooltipWidget;
ScreenCoordsXY gTooltipCursor;
static int16_t _clickRepeatTicks;
static std::optional<uint32_t> _clickRepeatTicks;
static MouseState GameGetNextInput(ScreenCoordsXY& screenCoords);
static void InputWidgetOver(const ScreenCoordsXY& screenCoords, WindowBase* w, WidgetIndex widgetIndex);
@@ -103,8 +104,6 @@ static void InputUpdateTooltip(WindowBase* w, WidgetIndex widgetIndex, const Scr
*/
void GameHandleInput()
{
WindowVisitEach([](WindowBase* w) { WindowEventPeriodicUpdateCall(w); });
InvalidateAllWindowsAfterInput();
MouseState state;
@@ -178,7 +177,7 @@ static void InputScrollDragBegin(const ScreenCoordsXY& screenCoords, WindowBase*
_dragWidget.window_classification = w->classification;
_dragWidget.window_number = w->number;
_dragWidget.widget_index = widgetIndex;
_ticksSinceDragStart = 0;
_ticksSinceDragStart = gCurrentRealTimeTicks;
_dragScrollIndex = WindowGetScrollDataIndex(*w, widgetIndex);
ContextHideCursor();
@@ -197,6 +196,8 @@ static void InputScrollDragContinue(const ScreenCoordsXY& screenCoords, WindowBa
auto& scroll = w->scrolls[scrollIndex];
ScreenCoordsXY differentialCoords = screenCoords - gInputDragLast;
if (differentialCoords.x == 0 && differentialCoords.y == 0)
return;
if (scroll.flags & HSCROLLBAR_VISIBLE)
{
@@ -242,10 +243,9 @@ static void InputScrollRight(const ScreenCoordsXY& screenCoords, MouseState stat
switch (state)
{
case MouseState::Released:
_ticksSinceDragStart += gCurrentDeltaTime;
if (screenCoords.x != 0 || screenCoords.y != 0)
{
_ticksSinceDragStart = 1000;
_ticksSinceDragStart = std::nullopt;
InputScrollDragContinue(screenCoords, w);
}
break;
@@ -348,7 +348,7 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState
else if (state == MouseState::RightRelease)
{
InputViewportDragEnd();
if (_ticksSinceDragStart < 500)
if (_ticksSinceDragStart.has_value() && gCurrentRealTimeTicks - _ticksSinceDragStart.value() < 500)
{
// If the user pressed the right mouse button for less than 500 ticks, interpret as right click
ViewportInteractionRightClick(screenCoords);
@@ -480,7 +480,7 @@ static void InputWindowPositionContinue(
static void InputWindowPositionEnd(WindowBase& w, const ScreenCoordsXY& screenCoords)
{
_inputState = InputState::Normal;
gTooltipTimeout = 0;
gTooltipCloseTimeout = 0;
gTooltipWidget = _dragWidget;
WindowEventMovedCall(&w, screenCoords);
}
@@ -511,7 +511,7 @@ static void InputWindowResizeContinue(WindowBase& w, const ScreenCoordsXY& scree
static void InputWindowResizeEnd()
{
_inputState = InputState::Normal;
gTooltipTimeout = 0;
gTooltipCloseTimeout = 0;
gTooltipWidget = _dragWidget;
}
@@ -525,7 +525,7 @@ static void InputViewportDragBegin(WindowBase& w)
_inputState = InputState::ViewportRight;
_dragWidget.window_classification = w.classification;
_dragWidget.window_number = w.number;
_ticksSinceDragStart = 0;
_ticksSinceDragStart = gCurrentRealTimeTicks;
auto cursorPosition = ContextGetCursorPosition();
gInputDragLast = cursorPosition;
if (!gConfigGeneral.InvertViewportDrag)
@@ -543,9 +543,11 @@ static void InputViewportDragContinue()
Viewport* viewport;
auto newDragCoords = ContextGetCursorPosition();
const CursorState* cursorState = ContextGetCursorState();
auto differentialCoords = newDragCoords - gInputDragLast;
if (differentialCoords.x == 0 && differentialCoords.y == 0)
return;
w = WindowFindByNumber(_dragWidget.window_classification, _dragWidget.window_number);
// #3294: Window can be closed during a drag session, so just finish
@@ -557,7 +559,6 @@ static void InputViewportDragContinue()
}
viewport = w->viewport;
_ticksSinceDragStart += gCurrentDeltaTime;
if (viewport == nullptr)
{
ContextShowCursor();
@@ -571,7 +572,7 @@ static void InputViewportDragContinue()
// If the drag time is less than 500 the "drag" is usually interpreted as a right click.
// As the user moved the mouse, don't interpret it as right click in any case.
_ticksSinceDragStart = 1000;
_ticksSinceDragStart = std::nullopt;
differentialCoords.x = (viewport->zoom + 1).ApplyTo(differentialCoords.x);
differentialCoords.y = (viewport->zoom + 1).ApplyTo(differentialCoords.y);
@@ -586,6 +587,7 @@ static void InputViewportDragContinue()
}
}
const CursorState* cursorState = ContextGetCursorState();
if (cursorState->touch || gConfigGeneral.InvertViewportDrag)
{
gInputDragLast = newDragCoords;
@@ -983,7 +985,7 @@ static void InputWidgetOverFlatbuttonInvalidate()
WindowBase* w = WindowFindByNumber(gHoverWidget.window_classification, gHoverWidget.window_number);
if (w != nullptr)
{
WindowEventInvalidateCall(w);
WindowEventOnPrepareDrawCall(w);
if (w->widgets[gHoverWidget.widget_index].type == WindowWidgetType::FlatBtn)
{
WidgetInvalidateByNumber(gHoverWidget.window_classification, gHoverWidget.window_number, gHoverWidget.widget_index);
@@ -1086,7 +1088,7 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, WindowBase* w, W
gPressedWidget.widget_index = widgetIndex;
_inputFlags |= INPUT_FLAG_WIDGET_PRESSED;
_inputState = InputState::WidgetPressed;
_clickRepeatTicks = 1;
_clickRepeatTicks = gCurrentRealTimeTicks;
WidgetInvalidateByNumber(windowClass, windowNumber, widgetIndex);
WindowEventMouseDownCall(w, widgetIndex);
@@ -1304,17 +1306,28 @@ void InputStateWidgetPressed(
if (WidgetIsDisabled(*w, widgetIndex))
break;
if (_clickRepeatTicks != 0)
// If this variable is non-zero then its the last tick the mouse down event was fired.
if (_clickRepeatTicks.has_value())
{
_clickRepeatTicks++;
// The initial amount of time in ticks to wait until the first click repeat.
constexpr auto ticksUntilRepeats = 16U;
// Handle click repeat
if (_clickRepeatTicks >= 16 && (_clickRepeatTicks & 3) == 0)
// The amount of ticks between each click repeat.
constexpr auto eventDelayInTicks = 3U;
// The amount of ticks since the last click repeat.
const auto clickRepeatsDelta = gCurrentRealTimeTicks - _clickRepeatTicks.value();
// Handle click repeat, only start this when at least 16 ticks elapsed.
if (clickRepeatsDelta >= ticksUntilRepeats && (clickRepeatsDelta & eventDelayInTicks) == 0)
{
if (WidgetIsHoldable(*w, widgetIndex))
{
WindowEventMouseDownCall(w, widgetIndex);
}
// Subtract initial delay from here on we want the event each third tick.
_clickRepeatTicks = gCurrentRealTimeTicks - ticksUntilRepeats;
}
}
@@ -1388,7 +1401,7 @@ void InputStateWidgetPressed(
}
_inputState = InputState::Normal;
gTooltipTimeout = 0;
gTooltipCloseTimeout = 0;
gTooltipWidget.widget_index = cursor_widgetIndex;
gTooltipWidget.window_classification = cursor_w_class;
gTooltipWidget.window_number = cursor_w_number;
@@ -1412,7 +1425,7 @@ void InputStateWidgetPressed(
return;
}
gTooltipTimeout = 0;
gTooltipCloseTimeout = 0;
gTooltipWidget.widget_index = cursor_widgetIndex;
if (w == nullptr)
@@ -1439,7 +1452,7 @@ void InputStateWidgetPressed(
return;
}
_clickRepeatTicks = 0;
_clickRepeatTicks = std::nullopt;
if (_inputState != InputState::DropdownActive)
{
// Hold down widget and drag outside of area??
@@ -1500,19 +1513,23 @@ static void InputUpdateTooltip(WindowBase* w, WidgetIndex widgetIndex, const Scr
{
if (gTooltipCursor == screenCoords)
{
_tooltipNotShownTicks++;
if (_tooltipNotShownTicks > 50 && w != nullptr && WidgetIsVisible(*w, widgetIndex))
if (gCurrentRealTimeTicks >= _tooltipNotShownTimeout && w != nullptr && WidgetIsVisible(*w, widgetIndex))
{
gTooltipTimeout = 0;
gTooltipCloseTimeout = gCurrentRealTimeTicks + 8000;
WindowTooltipOpen(w, widgetIndex, screenCoords);
}
}
else
{
ResetTooltipNotShown();
}
gTooltipTimeout = 0;
gTooltipCloseTimeout = gCurrentRealTimeTicks + 8000;
gTooltipCursor = screenCoords;
}
else
{
gTooltipCursor = screenCoords;
ResetTooltipNotShown();
if (w == nullptr || gTooltipWidget.window_classification != w->classification
@@ -1522,8 +1539,7 @@ static void InputUpdateTooltip(WindowBase* w, WidgetIndex widgetIndex, const Scr
WindowTooltipClose();
}
gTooltipTimeout += gCurrentDeltaTime;
if (gTooltipTimeout >= 8000)
if (gCurrentRealTimeTicks >= gTooltipCloseTimeout)
{
WindowCloseByClass(WindowClass::Tooltip);
}
+14 -14
View File
@@ -23,51 +23,51 @@ constexpr uint32_t UsefulModifiers = KMOD_SHIFT | KMOD_CTRL | KMOD_ALT | KMOD_GU
static uint32_t ParseModifier(std::string_view text)
{
if (String::Equals(text, "CTRL", true))
if (String::IEquals(text, "CTRL"))
{
return KMOD_CTRL;
}
if (String::Equals(text, "LCTRL", true))
if (String::IEquals(text, "LCTRL"))
{
return KMOD_LCTRL;
}
if (String::Equals(text, "RCTRL", true))
if (String::IEquals(text, "RCTRL"))
{
return KMOD_RCTRL;
}
if (String::Equals(text, "SHIFT", true))
if (String::IEquals(text, "SHIFT"))
{
return KMOD_SHIFT;
}
if (String::Equals(text, "LSHIFT", true))
if (String::IEquals(text, "LSHIFT"))
{
return KMOD_LSHIFT;
}
if (String::Equals(text, "RSHIFT", true))
if (String::IEquals(text, "RSHIFT"))
{
return KMOD_RSHIFT;
}
if (String::Equals(text, "ALT", true))
if (String::IEquals(text, "ALT"))
{
return KMOD_ALT;
}
if (String::Equals(text, "LALT", true))
if (String::IEquals(text, "LALT"))
{
return KMOD_LALT;
}
if (String::Equals(text, "RALT", true))
if (String::IEquals(text, "RALT"))
{
return KMOD_RALT;
}
if (String::Equals(text, "GUI", true))
if (String::IEquals(text, "GUI"))
{
return KMOD_GUI;
}
if (String::Equals(text, "LCTRL", true))
if (String::IEquals(text, "LCTRL"))
{
return KMOD_LGUI;
}
if (String::Equals(text, "RGUI", true))
if (String::IEquals(text, "RGUI"))
{
return KMOD_RGUI;
}
@@ -167,13 +167,13 @@ ShortcutInput::ShortcutInput(std::string_view value)
Button = *number - 1;
}
}
else if (String::Equals(rem, "LMB", true))
else if (String::IEquals(rem, "LMB"))
{
Kind = InputDeviceKind::Mouse;
Modifiers = modifiers;
Button = 0;
}
else if (String::Equals(rem, "RMB", true))
else if (String::IEquals(rem, "RMB"))
{
Kind = InputDeviceKind::Mouse;
Modifiers = modifiers;
+7 -7
View File
@@ -149,10 +149,10 @@ static void ShortcutRemoveTopBottomToolbarToggle()
{
if (WindowFindByClass(WindowClass::TitleLogo) != nullptr)
{
WindowClose(*WindowFindByClass(WindowClass::TitleLogo));
WindowClose(*WindowFindByClass(WindowClass::TitleOptions));
WindowClose(*WindowFindByClass(WindowClass::TitleMenu));
WindowClose(*WindowFindByClass(WindowClass::TitleExit));
WindowCloseByClass(WindowClass::TitleLogo);
WindowCloseByClass(WindowClass::TitleOptions);
WindowCloseByClass(WindowClass::TitleMenu);
WindowCloseByClass(WindowClass::TitleExit);
TitleSetHideVersionInfo(true);
}
else
@@ -164,9 +164,9 @@ static void ShortcutRemoveTopBottomToolbarToggle()
{
if (WindowFindByClass(WindowClass::TopToolbar) != nullptr)
{
WindowClose(*WindowFindByClass(WindowClass::Dropdown));
WindowClose(*WindowFindByClass(WindowClass::TopToolbar));
WindowClose(*WindowFindByClass(WindowClass::BottomToolbar));
WindowCloseByClass(WindowClass::Dropdown);
WindowCloseByClass(WindowClass::TopToolbar);
WindowCloseByClass(WindowClass::BottomToolbar);
}
else
{
+4 -4
View File
@@ -19,10 +19,10 @@ namespace Dropdown
{
struct Item;
constexpr const StringId SeparatorString = 0;
constexpr const StringId FormatColourPicker = 0xFFFE;
constexpr const StringId FormatLandPicker = 0xFFFF;
constexpr const int32_t ItemsMaxSize = 512;
constexpr StringId SeparatorString = 0;
constexpr StringId FormatColourPicker = 0xFFFE;
constexpr StringId FormatLandPicker = 0xFFFF;
constexpr int32_t ItemsMaxSize = 512;
enum Flag
{
+3 -1
View File
@@ -80,9 +80,10 @@ void InGameConsole::Input(ConsoleInput input)
}
_consoleTextInputSession->Length = UTF8Length(_consoleCurrentLine.c_str());
_consoleTextInputSession->SelectionStart = _consoleCurrentLine.size();
RefreshCaret(_consoleTextInputSession->SelectionStart);
break;
case ConsoleInput::HistoryNext:
if (_consoleHistoryIndex < _consoleHistory.size() - 1)
if (_consoleHistoryIndex + 1 < _consoleHistory.size())
{
_consoleHistoryIndex++;
_consoleCurrentLine = _consoleHistory[_consoleHistoryIndex];
@@ -94,6 +95,7 @@ void InGameConsole::Input(ConsoleInput input)
_consoleHistoryIndex = _consoleHistory.size();
ClearInput();
}
RefreshCaret(_consoleTextInputSession->SelectionStart);
break;
case ConsoleInput::ScrollPrevious:
{
+8 -8
View File
@@ -115,7 +115,7 @@ struct WindowThemeDesc
#define TWINDOW(window_class, window_name, window_string_id, theme) { window_class, window_name, window_string_id, theme }
static constexpr const WindowThemeDesc WindowThemeDescriptors[] =
static constexpr WindowThemeDesc WindowThemeDescriptors[] =
{
// WindowClass WindowClassSZ WindowName NumColours, DefaultTheme
{ WindowClass::TopToolbar, "WC_TOP_TOOLBAR", STR_THEMES_WINDOW_TOP_TOOLBAR, COLOURS_4(COLOUR_LIGHT_BLUE, COLOUR_DARK_GREEN, COLOUR_DARK_BROWN, COLOUR_GREY ) },
@@ -191,7 +191,7 @@ static constexpr const WindowThemeDesc WindowThemeDescriptors[] =
#define COLOURS_RCT1(c0, c1, c2, c3, c4, c5) { { (c0), (c1), (c2), (c3), (c4), (c5) } }
static constexpr const UIThemeWindowEntry PredefinedThemeRCT1_Entries[] =
static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] =
{
{ WindowClass::TopToolbar, COLOURS_RCT1(COLOUR_GREY, COLOUR_GREY, COLOUR_GREY, COLOUR_GREY, COLOUR_BLACK, COLOUR_BLACK) },
{ WindowClass::BottomToolbar, COLOURS_RCT1(TRANSLUCENT(COLOUR_GREY), TRANSLUCENT(COLOUR_GREY), COLOUR_BLACK, COLOUR_YELLOW, COLOUR_BLACK, COLOUR_BLACK) },
@@ -219,7 +219,7 @@ static constexpr const UIThemeWindowEntry PredefinedThemeRCT1_Entries[] =
};
// clang-format on
static constexpr const UIThemeWindowEntry PredefinedThemeRCT2_Entries[] = {
static constexpr UIThemeWindowEntry PredefinedThemeRCT2_Entries[] = {
THEME_DEF_END,
};
@@ -236,7 +236,7 @@ struct PredefinedTheme
StringId Name;
};
static constexpr const PredefinedTheme PredefinedThemes[] = {
static constexpr PredefinedTheme PredefinedThemes[] = {
{ &PredefinedThemeRCT1, STR_TITLE_SEQUENCE_RCT1 },
{ &PredefinedThemeRCT2, STR_TITLE_SEQUENCE_RCT2 },
};
@@ -537,12 +537,12 @@ namespace ThemeManager
auto scanner = Path::ScanDirectory(themesPattern, true);
while (scanner->Next())
{
auto fileInfo = scanner->GetFileInfo();
auto name = Path::GetFileNameWithoutExtension(std::string(fileInfo->Name));
const auto& fileInfo = scanner->GetFileInfo();
auto name = Path::GetFileNameWithoutExtension(fileInfo.Name);
AvailableTheme theme{};
theme.Name = name;
theme.Path = GetThemeFileName(theme.Name);
theme.Path = GetThemeFileName(name);
outThemes->push_back(std::move(theme));
if (Path::Equals(CurrentThemePath, scanner->GetPath()))
@@ -721,7 +721,7 @@ size_t ThemeGetIndexForName(const utf8* name)
for (size_t i = 0; i < count; i++)
{
const utf8* tn = ThemeManagerGetAvailableThemeName(i);
if (String::Equals(tn, name, true))
if (String::IEquals(tn, name))
{
return i;
}
@@ -32,9 +32,9 @@
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/object/BannerSceneryEntry.h>
#include <openrct2/object/FootpathItemEntry.h>
#include <openrct2/object/LargeSceneryEntry.h>
#include <openrct2/object/ObjectEntryManager.h>
#include <openrct2/object/PathAdditionEntry.h>
#include <openrct2/object/SmallSceneryEntry.h>
#include <openrct2/object/WallSceneryEntry.h>
#include <openrct2/ride/Ride.h>
@@ -52,12 +52,12 @@
#include <openrct2/world/Surface.h>
#include <openrct2/world/Wall.h>
static void ViewportInteractionRemoveScenery(TileElement* tileElement, const CoordsXY& mapCoords);
static void ViewportInteractionRemoveFootpath(TileElement* tileElement, const CoordsXY& mapCoords);
static void ViewportInteractionRemoveFootpathItem(TileElement* tileElement, const CoordsXY& mapCoords);
static void ViewportInteractionRemoveParkWall(TileElement* tileElement, const CoordsXY& mapCoords);
static void ViewportInteractionRemoveLargeScenery(TileElement* tileElement, const CoordsXY& mapCoords);
static void ViewportInteractionRemoveParkEntrance(TileElement* tileElement, CoordsXY mapCoords);
static void ViewportInteractionRemoveScenery(const SmallSceneryElement& smallSceneryElement, const CoordsXY& mapCoords);
static void ViewportInteractionRemoveFootpath(const PathElement& pathElement, const CoordsXY& mapCoords);
static void ViewportInteractionRemovePathAddition(const PathElement& pathElement, const CoordsXY& mapCoords);
static void ViewportInteractionRemoveParkWall(const WallElement& wallElement, const CoordsXY& mapCoords);
static void ViewportInteractionRemoveLargeScenery(const LargeSceneryElement& largeSceneryElement, const CoordsXY& mapCoords);
static void ViewportInteractionRemoveParkEntrance(const EntranceElement& entranceElement, CoordsXY mapCoords);
static Peep* ViewportInteractionGetClosestPeep(ScreenCoordsXY screenCoords, int32_t maxDistance);
/**
@@ -126,7 +126,8 @@ InteractionInfo ViewportInteractionGetItemLeft(const ScreenCoordsXY& screenCoord
}
break;
case ViewportInteractionItem::Ride:
RideSetMapTooltip(tileElement);
Guard::ArgumentNotNull(tileElement);
RideSetMapTooltip(*tileElement);
break;
case ViewportInteractionItem::ParkEntrance:
{
@@ -478,7 +479,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor
SetMapTooltip(ft);
return info;
case ViewportInteractionItem::FootpathItem:
case ViewportInteractionItem::PathAddition:
{
auto* pathAddEntry = tileElement->AsPath()->GetAdditionEntry();
ft.Add<StringId>(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE);
@@ -573,22 +574,22 @@ bool ViewportInteractionRightClick(const ScreenCoordsXY& screenCoords)
RideModify(tileElement);
break;
case ViewportInteractionItem::Scenery:
ViewportInteractionRemoveScenery(info.Element, info.Loc);
ViewportInteractionRemoveScenery(*info.Element->AsSmallScenery(), info.Loc);
break;
case ViewportInteractionItem::Footpath:
ViewportInteractionRemoveFootpath(info.Element, info.Loc);
ViewportInteractionRemoveFootpath(*info.Element->AsPath(), info.Loc);
break;
case ViewportInteractionItem::FootpathItem:
ViewportInteractionRemoveFootpathItem(info.Element, info.Loc);
case ViewportInteractionItem::PathAddition:
ViewportInteractionRemovePathAddition(*info.Element->AsPath(), info.Loc);
break;
case ViewportInteractionItem::ParkEntrance:
ViewportInteractionRemoveParkEntrance(info.Element, info.Loc);
ViewportInteractionRemoveParkEntrance(*info.Element->AsEntrance(), info.Loc);
break;
case ViewportInteractionItem::Wall:
ViewportInteractionRemoveParkWall(info.Element, info.Loc);
ViewportInteractionRemoveParkWall(*info.Element->AsWall(), info.Loc);
break;
case ViewportInteractionItem::LargeScenery:
ViewportInteractionRemoveLargeScenery(info.Element, info.Loc);
ViewportInteractionRemoveLargeScenery(*info.Element->AsLargeScenery(), info.Loc);
break;
case ViewportInteractionItem::Banner:
ContextOpenDetailWindow(WD_BANNER, info.Element->AsBanner()->GetIndex().ToUnderlying());
@@ -602,11 +603,11 @@ bool ViewportInteractionRightClick(const ScreenCoordsXY& screenCoords)
*
* rct2: 0x006E08D2
*/
static void ViewportInteractionRemoveScenery(TileElement* tileElement, const CoordsXY& mapCoords)
static void ViewportInteractionRemoveScenery(const SmallSceneryElement& smallSceneryElement, const CoordsXY& mapCoords)
{
auto removeSceneryAction = SmallSceneryRemoveAction(
{ mapCoords.x, mapCoords.y, tileElement->GetBaseZ() }, tileElement->AsSmallScenery()->GetSceneryQuadrant(),
tileElement->AsSmallScenery()->GetEntryIndex());
{ mapCoords.x, mapCoords.y, smallSceneryElement.GetBaseZ() }, smallSceneryElement.GetSceneryQuadrant(),
smallSceneryElement.GetEntryIndex());
GameActions::Execute(&removeSceneryAction);
}
@@ -615,20 +616,17 @@ static void ViewportInteractionRemoveScenery(TileElement* tileElement, const Coo
*
* rct2: 0x006A614A
*/
static void ViewportInteractionRemoveFootpath(TileElement* tileElement, const CoordsXY& mapCoords)
static void ViewportInteractionRemoveFootpath(const PathElement& pathElement, const CoordsXY& mapCoords)
{
WindowBase* w;
TileElement* tileElement2;
auto z = tileElement->GetBaseZ();
w = WindowFindByClass(WindowClass::Footpath);
WindowBase* w = WindowFindByClass(WindowClass::Footpath);
if (w != nullptr)
FootpathProvisionalUpdate();
tileElement2 = MapGetFirstElementAt(mapCoords);
TileElement* tileElement2 = MapGetFirstElementAt(mapCoords);
if (tileElement2 == nullptr)
return;
auto z = pathElement.GetBaseZ();
do
{
if (tileElement2->GetType() == TileElementType::Path && tileElement2->GetBaseZ() == z)
@@ -644,9 +642,9 @@ static void ViewportInteractionRemoveFootpath(TileElement* tileElement, const Co
*
* rct2: 0x006A61AB
*/
static void ViewportInteractionRemoveFootpathItem(TileElement* tileElement, const CoordsXY& mapCoords)
static void ViewportInteractionRemovePathAddition(const PathElement& pathElement, const CoordsXY& mapCoords)
{
auto footpathAdditionRemoveAction = FootpathAdditionRemoveAction({ mapCoords.x, mapCoords.y, tileElement->GetBaseZ() });
auto footpathAdditionRemoveAction = FootpathAdditionRemoveAction({ mapCoords.x, mapCoords.y, pathElement.GetBaseZ() });
GameActions::Execute(&footpathAdditionRemoveAction);
}
@@ -654,10 +652,10 @@ static void ViewportInteractionRemoveFootpathItem(TileElement* tileElement, cons
*
* rct2: 0x00666C0E
*/
void ViewportInteractionRemoveParkEntrance(TileElement* tileElement, CoordsXY mapCoords)
void ViewportInteractionRemoveParkEntrance(const EntranceElement& entranceElement, CoordsXY mapCoords)
{
int32_t rotation = tileElement->GetDirectionWithOffset(1);
switch (tileElement->AsEntrance()->GetSequenceIndex())
int32_t rotation = entranceElement.GetDirectionWithOffset(1);
switch (entranceElement.GetSequenceIndex())
{
case 1:
mapCoords += CoordsDirectionDelta[rotation];
@@ -666,7 +664,7 @@ void ViewportInteractionRemoveParkEntrance(TileElement* tileElement, CoordsXY ma
mapCoords -= CoordsDirectionDelta[rotation];
break;
}
auto parkEntranceRemoveAction = ParkEntranceRemoveAction({ mapCoords.x, mapCoords.y, tileElement->GetBaseZ() });
auto parkEntranceRemoveAction = ParkEntranceRemoveAction({ mapCoords.x, mapCoords.y, entranceElement.GetBaseZ() });
GameActions::Execute(&parkEntranceRemoveAction);
}
@@ -674,16 +672,16 @@ void ViewportInteractionRemoveParkEntrance(TileElement* tileElement, CoordsXY ma
*
* rct2: 0x006E57A9
*/
static void ViewportInteractionRemoveParkWall(TileElement* tileElement, const CoordsXY& mapCoords)
static void ViewportInteractionRemoveParkWall(const WallElement& wallElement, const CoordsXY& mapCoords)
{
auto* wallEntry = tileElement->AsWall()->GetEntry();
auto* wallEntry = wallElement.GetEntry();
if (wallEntry->scrolling_mode != SCROLLING_MODE_NONE)
{
ContextOpenDetailWindow(WD_SIGN_SMALL, tileElement->AsWall()->GetBannerIndex().ToUnderlying());
ContextOpenDetailWindow(WD_SIGN_SMALL, wallElement.GetBannerIndex().ToUnderlying());
}
else
{
CoordsXYZD wallLocation = { mapCoords.x, mapCoords.y, tileElement->GetBaseZ(), tileElement->GetDirection() };
CoordsXYZD wallLocation = { mapCoords.x, mapCoords.y, wallElement.GetBaseZ(), wallElement.GetDirection() };
auto wallRemoveAction = WallRemoveAction(wallLocation);
GameActions::Execute(&wallRemoveAction);
}
@@ -693,20 +691,20 @@ static void ViewportInteractionRemoveParkWall(TileElement* tileElement, const Co
*
* rct2: 0x006B88DC
*/
static void ViewportInteractionRemoveLargeScenery(TileElement* tileElement, const CoordsXY& mapCoords)
static void ViewportInteractionRemoveLargeScenery(const LargeSceneryElement& largeSceneryElement, const CoordsXY& mapCoords)
{
auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry();
auto* sceneryEntry = largeSceneryElement.GetEntry();
if (sceneryEntry->scrolling_mode != SCROLLING_MODE_NONE)
{
auto bannerIndex = tileElement->AsLargeScenery()->GetBannerIndex();
auto bannerIndex = largeSceneryElement.GetBannerIndex();
ContextOpenDetailWindow(WD_SIGN, bannerIndex.ToUnderlying());
}
else
{
auto removeSceneryAction = LargeSceneryRemoveAction(
{ mapCoords.x, mapCoords.y, tileElement->GetBaseZ(), tileElement->GetDirection() },
tileElement->AsLargeScenery()->GetSequenceIndex());
{ mapCoords.x, mapCoords.y, largeSceneryElement.GetBaseZ(), largeSceneryElement.GetDirection() },
largeSceneryElement.GetSequenceIndex());
GameActions::Execute(&removeSceneryAction);
}
}
+7 -3
View File
@@ -15,6 +15,7 @@
#include <cmath>
#include <openrct2/Context.h>
#include <openrct2/Input.h>
#include <openrct2/config/Config.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/Formatting.h>
@@ -565,11 +566,14 @@ static void WidgetCaptionDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex wid
int32_t width = widget->width() - 4;
if ((widget + 1)->type == WindowWidgetType::CloseBox)
{
width -= 10;
width -= CloseButtonWidth;
if ((widget + 2)->type == WindowWidgetType::CloseBox)
width -= 10;
width -= CloseButtonWidth;
}
topLeft.x += width / 2;
if (gConfigInterface.WindowButtonsOnTheLeft)
topLeft.x += CloseButtonWidth;
DrawTextEllipsised(
dpi, topLeft, width, widget->text, Formatter::Common(),
{ COLOUR_WHITE | static_cast<uint8_t>(COLOUR_FLAG_OUTLINE), TextAlignment::CENTRE });
@@ -722,7 +726,7 @@ static void WidgetScrollDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex widg
// Draw the scroll contents
if (scroll_dpi.width > 0 && scroll_dpi.height > 0)
WindowEventScrollPaintCall(&w, scroll_dpi, scrollIndex);
WindowEventScrollDrawCall(&w, scroll_dpi, scrollIndex);
}
static void WidgetHScrollbarDraw(
+36 -24
View File
@@ -38,6 +38,8 @@ static bool WindowFitsBetweenOthers(const ScreenCoordsXY& loc, int32_t width, in
{
for (auto& w : g_window_list)
{
if (w->flags & WF_DEAD)
continue;
if (w->flags & WF_STICK_TO_BACK)
continue;
@@ -131,6 +133,8 @@ static ScreenCoordsXY GetAutoPositionForNewWindow(int32_t width, int32_t height)
// Place window next to another
for (auto& w : g_window_list)
{
if (w->flags & WF_DEAD)
continue;
if (w->flags & WF_STICK_TO_BACK)
continue;
@@ -158,6 +162,8 @@ static ScreenCoordsXY GetAutoPositionForNewWindow(int32_t width, int32_t height)
// Overlap
for (auto& w : g_window_list)
{
if (w->flags & WF_DEAD)
continue;
if (w->flags & WF_STICK_TO_BACK)
continue;
@@ -222,6 +228,8 @@ WindowBase* WindowCreate(
// Close least recently used window
for (auto& w : g_window_list)
{
if (w->flags & WF_DEAD)
continue;
if (!(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT | WF_NO_AUTO_CLOSE)))
{
WindowClose(*w.get());
@@ -236,6 +244,8 @@ WindowBase* WindowCreate(
{
for (auto it = g_window_list.begin(); it != g_window_list.end(); it++)
{
if ((*it)->flags & WF_DEAD)
continue;
if (!((*it)->flags & WF_STICK_TO_BACK))
{
itDestPos = it;
@@ -246,6 +256,8 @@ WindowBase* WindowCreate(
{
for (auto it = g_window_list.rbegin(); it != g_window_list.rend(); it++)
{
if ((*it)->flags & WF_DEAD)
continue;
if (!((*it)->flags & WF_STICK_TO_FRONT))
{
itDestPos = it.base();
@@ -277,9 +289,6 @@ WindowBase* WindowCreate(
w->max_height = height;
w->focus = std::nullopt;
w->page = 0;
w->var_48C = 0;
w->var_492 = 0;
ColourSchemeUpdate(w);
w->Invalidate();
@@ -287,26 +296,6 @@ WindowBase* WindowCreate(
return w;
}
WindowBase* WindowCreate(
const ScreenCoordsXY& pos, int32_t width, int32_t height, WindowEventList* event_handlers, WindowClass cls, uint32_t flags)
{
auto w = std::make_unique<WindowBase>();
w->event_handlers = event_handlers;
return WindowCreate(std::move(w), cls, pos, width, height, flags);
}
WindowBase* WindowCreateAutoPos(int32_t width, int32_t height, WindowEventList* event_handlers, WindowClass cls, uint32_t flags)
{
auto pos = GetAutoPositionForNewWindow(width, height);
return WindowCreate(pos, width, height, event_handlers, cls, flags);
}
WindowBase* WindowCreateCentred(int32_t width, int32_t height, WindowEventList* event_handlers, WindowClass cls, uint32_t flags)
{
auto pos = GetCentrePositionForNewWindow(width, height);
return WindowCreate(pos, width, height, event_handlers, cls, flags);
}
static int32_t WindowGetWidgetIndex(const WindowBase& w, Widget* widget)
{
int32_t i = 0;
@@ -748,6 +737,16 @@ void Window::SetWidgetDisabled(WidgetIndex widgetIndex, bool value)
WidgetSetDisabled(*this, widgetIndex, value);
}
void Window::SetWidgetDisabledAndInvalidate(WidgetIndex widgetIndex, bool value)
{
bool oldState = IsWidgetDisabled(widgetIndex);
if (oldState != value)
{
WidgetSetDisabled(*this, widgetIndex, value);
InvalidateWidget(widgetIndex);
}
}
void Window::SetWidgetPressed(WidgetIndex widgetIndex, bool value)
{
WidgetSetPressed(*this, widgetIndex, value);
@@ -819,12 +818,25 @@ void WindowAlignTabs(WindowBase* w, WidgetIndex start_tab_id, WidgetIndex end_ta
for (i = start_tab_id; i <= end_tab_id; i++)
{
auto& widget = w->widgets[i];
if (!WidgetIsDisabled(*w, i))
{
auto& widget = w->widgets[i];
widget.left = x;
widget.right = x + tab_width;
x += tab_width + 1;
}
else
{
// Workaround #20535: Avoid disabled widgets from sharing the same space as active ones, otherwise
// WindowFindWidgetFromPoint could return the disabled one, causing issues.
widget.left = 0;
widget.right = 0;
}
}
}
ScreenCoordsXY WindowGetViewportSoundIconPos(WindowBase& w)
{
const uint8_t buttonOffset = (gConfigInterface.WindowButtonsOnTheLeft) ? CloseButtonWidth + 2 : 0;
return w.windowPos + ScreenCoordsXY{ 2 + buttonOffset, 2 };
}
+2
View File
@@ -24,6 +24,7 @@ struct Window : WindowBase
bool IsWidgetPressed(WidgetIndex widgetIndex) const;
void SetWidgetEnabled(WidgetIndex widgetIndex, bool value);
void SetWidgetDisabled(WidgetIndex widgetIndex, bool value);
void SetWidgetDisabledAndInvalidate(WidgetIndex widgetIndex, bool value);
void SetWidgetPressed(WidgetIndex widgetIndex, bool value);
void SetCheckboxValue(WidgetIndex widgetIndex, bool value);
void DrawWidgets(DrawPixelInfo& dpi);
@@ -39,3 +40,4 @@ struct Window : WindowBase
void WindowAllWheelInput();
void ApplyScreenSaverLockSetting();
void WindowAlignTabs(WindowBase* w, WidgetIndex start_tab_id, WidgetIndex end_tab_id);
ScreenCoordsXY WindowGetViewportSoundIconPos(WindowBase& w);
+3 -3
View File
@@ -127,14 +127,14 @@ constexpr std::array DropdownOrder = {
TrackElemType::RightLargeZeroGRollDown,
TrackElemType::LeftFlyerLargeHalfLoopUninvertedUp,
TrackElemType::LeftFlyerLargeHalfLoopInvertedDown,
TrackElemType::RightFlyerLargeHalfLoopUninvertedUp,
TrackElemType::RightFlyerLargeHalfLoopInvertedDown,
TrackElemType::LeftFlyerLargeHalfLoopInvertedUp,
TrackElemType::LeftFlyerLargeHalfLoopUninvertedDown,
TrackElemType::RightFlyerLargeHalfLoopUninvertedUp,
TrackElemType::RightFlyerLargeHalfLoopInvertedDown,
TrackElemType::RightFlyerLargeHalfLoopInvertedUp,
TrackElemType::RightFlyerLargeHalfLoopUninvertedDown,
};
constexpr const size_t DropdownLength = DropdownOrder.size();
constexpr size_t DropdownLength = DropdownOrder.size();
// Update the magic number with the current number of track elements to silence
static_assert(TrackElemType::Count == 337, "Reminder to add new track element to special dropdown list");
+1 -1
View File
@@ -71,7 +71,7 @@ namespace OpenRCT2::Scripting
{ "water", ViewportInteractionItem::Water },
{ "scenery", ViewportInteractionItem::Scenery },
{ "footpath", ViewportInteractionItem::Footpath },
{ "footpath_item", ViewportInteractionItem::FootpathItem },
{ "footpath_item", ViewportInteractionItem::PathAddition },
{ "park_entrance", ViewportInteractionItem::ParkEntrance },
{ "wall", ViewportInteractionItem::Wall },
{ "large_scenery", ViewportInteractionItem::LargeScenery },
+115 -137
View File
@@ -48,10 +48,8 @@ namespace OpenRCT2::Ui::Windows
};
static Widget CustomDefaultWidgets[] = {
{ WindowWidgetType::Frame, 0, 0, 0, 0, 0, 0xFFFFFFFF, STR_NONE }, // panel / background
{ WindowWidgetType::Caption, 0, 1, 0, 1, 14, STR_STRING, STR_WINDOW_TITLE_TIP }, // title bar
{ WindowWidgetType::CloseBox, 0, 0, 0, 2, 13, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP }, // close x button
{ WindowWidgetType::Resize, 1, 0, 0, 14, 0, 0xFFFFFFFF, STR_NONE }, // content panel
WINDOW_SHIM(STR_STRING, 50, 50),
MakeWidget({ 0, 14 }, { 50, 36 }, WindowWidgetType::Resize, WindowColour::Secondary), // content panel
};
struct CustomWidgetDesc
@@ -377,7 +375,8 @@ namespace OpenRCT2::Ui::Windows
}
};
static CustomWindowInfo& GetInfo(WindowBase* w);
class CustomWindow;
static CustomWindowInfo& GetInfo(CustomWindow* w);
static void InvokeEventHandler(const std::shared_ptr<Plugin>& owner, const DukValue& dukHandler);
static void InvokeEventHandler(
const std::shared_ptr<Plugin>& owner, const DukValue& dukHandler, const std::vector<DukValue>& args);
@@ -386,12 +385,13 @@ namespace OpenRCT2::Ui::Windows
{
private:
static rct_windownumber _nextWindowNumber;
CustomWindowInfo _info;
public:
void Initialise(std::shared_ptr<Plugin> owner, const CustomWindowDesc& desc)
CustomWindow(std::shared_ptr<Plugin> owner, const CustomWindowDesc& desc)
: _info(owner, desc)
{
number = GetNewWindowNumber();
custom_info = new CustomWindowInfo(owner, desc);
// Set window tab
page = desc.TabIndex.value_or(0);
@@ -418,13 +418,7 @@ namespace OpenRCT2::Ui::Windows
void OnClose() override
{
auto info = static_cast<CustomWindowInfo*>(custom_info);
if (info != nullptr)
{
InvokeEventHandler(info->Owner, info->Desc.OnClose);
delete info;
custom_info = nullptr;
}
InvokeEventHandler(_info.Owner, _info.Desc.OnClose);
}
void OnResize() override
@@ -444,10 +438,9 @@ namespace OpenRCT2::Ui::Windows
void OnUpdate() override
{
const auto& info = GetInfo(this);
if (info.Desc.Tabs.size() > static_cast<size_t>(page))
if (_info.Desc.Tabs.size() > static_cast<size_t>(page))
{
const auto& tab = info.Desc.Tabs[page];
const auto& tab = _info.Desc.Tabs[page];
if (tab.imageFrameCount != 0)
{
frame_no++;
@@ -459,7 +452,7 @@ namespace OpenRCT2::Ui::Windows
}
}
InvokeEventHandler(info.Owner, info.Desc.OnUpdate);
InvokeEventHandler(_info.Owner, _info.Desc.OnUpdate);
// Since the plugin may alter widget positions and sizes during an update event,
// we need to force an update for all list view scrollbars
@@ -476,20 +469,15 @@ namespace OpenRCT2::Ui::Windows
void OnPrepareDraw() override
{
widgets[WIDX_BACKGROUND].right = width - 1;
widgets[WIDX_BACKGROUND].bottom = height - 1;
widgets[WIDX_TITLE].right = width - 2;
widgets[WIDX_CLOSE].left = width - 13;
widgets[WIDX_CLOSE].right = width - 3;
widgets[WIDX_CONTENT_PANEL].right = width - 1;
widgets[WIDX_CONTENT_PANEL].bottom = height - 1;
// This has to be called to ensure the window frame is correctly initialised - not doing this will
// cause an assertion to be hit.
ResizeFrameWithPage();
widgets[WIDX_CLOSE].text = (colours[0] & COLOUR_FLAG_TRANSLUCENT) ? STR_CLOSE_X_WHITE : STR_CLOSE_X;
// Having the content panel visible for transparent windows makes the borders darker than they should be
// For now just hide it if there are no tabs and the window is not resizable
auto& info = GetInfo(this);
auto canResize = (flags & WF_RESIZABLE) != 0 && (min_width != max_width || min_height != max_height);
auto numTabs = info.Desc.Tabs.size();
auto numTabs = _info.Desc.Tabs.size();
if (canResize || numTabs != 0)
{
widgets[WIDX_CONTENT_PANEL].flags &= ~WIDGET_FLAGS::IS_HIDDEN;
@@ -501,7 +489,7 @@ namespace OpenRCT2::Ui::Windows
SetPressedTab();
const auto& desc = info.Desc;
const auto& desc = _info.Desc;
auto ft = Formatter::Common();
ft.Add<const char*>(desc.Title.c_str());
@@ -510,7 +498,7 @@ namespace OpenRCT2::Ui::Windows
{
if (widget->type == WindowWidgetType::Scroll)
{
auto& listView = info.ListViews[scrollIndex];
auto& listView = _info.ListViews[scrollIndex];
auto wwidth = widget->width() + 1 - 2;
auto wheight = widget->height() + 1 - 2;
if (listView.GetScrollbars() == ScrollbarType::Horizontal
@@ -545,8 +533,7 @@ namespace OpenRCT2::Ui::Windows
void OnDrawWidget(WidgetIndex widgetIndex, DrawPixelInfo& dpi) override
{
const auto& widget = widgets[widgetIndex];
const auto& info = GetInfo(this);
const auto widgetDesc = info.GetCustomWidgetDesc(this, widgetIndex);
const auto widgetDesc = _info.GetCustomWidgetDesc(this, widgetIndex);
if (widgetDesc != nullptr && widgetDesc->Type == "custom")
{
auto& onDraw = widgetDesc->OnDraw;
@@ -561,7 +548,7 @@ namespace OpenRCT2::Ui::Windows
auto dukWidget = ScWidget::ToDukValue(ctx, this, widgetIndex);
auto dukG = GetObjectAsDukValue(ctx, std::make_shared<ScGraphicsContext>(ctx, widgetDpi));
auto& scriptEngine = GetContext()->GetScriptEngine();
scriptEngine.ExecutePluginCall(info.Owner, widgetDesc->OnDraw, dukWidget, { dukG }, false);
scriptEngine.ExecutePluginCall(_info.Owner, widgetDesc->OnDraw, dukWidget, { dukG }, false);
}
}
}
@@ -580,19 +567,19 @@ namespace OpenRCT2::Ui::Windows
break;
default:
{
const auto& info = GetInfo(this);
if (widgetIndex >= WIDX_TAB_0 && widgetIndex < static_cast<WidgetIndex>(WIDX_TAB_0 + info.Desc.Tabs.size()))
if (widgetIndex >= WIDX_TAB_0
&& widgetIndex < static_cast<WidgetIndex>(WIDX_TAB_0 + _info.Desc.Tabs.size()))
{
ChangeTab(widgetIndex - WIDX_TAB_0);
break;
}
const auto widgetDesc = info.GetCustomWidgetDesc(this, widgetIndex);
const auto widgetDesc = _info.GetCustomWidgetDesc(this, widgetIndex);
if (widgetDesc != nullptr)
{
if (widgetDesc->Type == "button")
{
InvokeEventHandler(info.Owner, widgetDesc->OnClick);
InvokeEventHandler(_info.Owner, widgetDesc->OnClick);
}
else if (widgetDesc->Type == "checkbox")
{
@@ -606,14 +593,14 @@ namespace OpenRCT2::Ui::Windows
auto ctx = widgetDesc->OnChange.context();
duk_push_boolean(ctx, isChecked);
args.push_back(DukValue::take_from_stack(ctx));
InvokeEventHandler(info.Owner, widgetDesc->OnChange, args);
InvokeEventHandler(_info.Owner, widgetDesc->OnChange, args);
}
else if (widgetDesc->Type == "spinner")
{
auto& widget = widgets[widgetIndex];
if (widget.text != STR_NUMERIC_DOWN && widget.text != STR_NUMERIC_UP)
{
InvokeEventHandler(info.Owner, widgetDesc->OnClick);
InvokeEventHandler(_info.Owner, widgetDesc->OnClick);
}
}
}
@@ -625,8 +612,7 @@ namespace OpenRCT2::Ui::Windows
void OnMouseDown(WidgetIndex widgetIndex) override
{
auto* widget = &widgets[widgetIndex];
const auto& info = GetInfo(this);
const auto widgetDesc = info.GetCustomWidgetDesc(this, widgetIndex);
const auto widgetDesc = _info.GetCustomWidgetDesc(this, widgetIndex);
if (widgetDesc != nullptr)
{
if (widgetDesc->Type == "colourpicker")
@@ -654,11 +640,11 @@ namespace OpenRCT2::Ui::Windows
{
if (widget->text == STR_NUMERIC_DOWN)
{
InvokeEventHandler(info.Owner, widgetDesc->OnDecrement);
InvokeEventHandler(_info.Owner, widgetDesc->OnDecrement);
}
else if (widget->text == STR_NUMERIC_UP)
{
InvokeEventHandler(info.Owner, widgetDesc->OnIncrement);
InvokeEventHandler(_info.Owner, widgetDesc->OnIncrement);
}
}
else if (widgetDesc->Type == "textbox")
@@ -674,8 +660,7 @@ namespace OpenRCT2::Ui::Windows
if (dropdownIndex == -1)
return;
auto& info = GetInfo(this);
auto widgetDesc = info.GetCustomWidgetDesc(this, widgetIndex);
auto widgetDesc = _info.GetCustomWidgetDesc(this, widgetIndex);
if (widgetDesc != nullptr)
{
if (widgetDesc->Type == "colourpicker")
@@ -691,8 +676,7 @@ namespace OpenRCT2::Ui::Windows
void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override
{
auto& info = GetInfo(this);
auto widgetDesc = info.GetCustomWidgetDesc(this, widgetIndex);
auto widgetDesc = _info.GetCustomWidgetDesc(this, widgetIndex);
if (widgetDesc != nullptr)
{
if (widgetDesc->Type == "textbox")
@@ -703,17 +687,16 @@ namespace OpenRCT2::Ui::Windows
auto ctx = widgetDesc->OnChange.context();
duk_push_lstring(ctx, text.data(), text.size());
args.push_back(DukValue::take_from_stack(ctx));
InvokeEventHandler(info.Owner, widgetDesc->OnChange, args);
InvokeEventHandler(_info.Owner, widgetDesc->OnChange, args);
}
}
}
ScreenSize OnScrollGetSize(int32_t scrollIndex) override
{
auto& info = GetInfo(this);
if (scrollIndex < static_cast<int32_t>(info.ListViews.size()))
if (scrollIndex < static_cast<int32_t>(_info.ListViews.size()))
{
auto size = info.ListViews[scrollIndex].GetSize();
auto size = _info.ListViews[scrollIndex].GetSize();
return { size.width, size.height };
}
return {};
@@ -721,55 +704,58 @@ namespace OpenRCT2::Ui::Windows
void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
auto& info = GetInfo(this);
if (scrollIndex < static_cast<int32_t>(info.ListViews.size()))
if (scrollIndex < static_cast<int32_t>(_info.ListViews.size()))
{
info.ListViews[scrollIndex].MouseDown(screenCoords);
_info.ListViews[scrollIndex].MouseDown(screenCoords);
}
}
void OnScrollMouseDrag(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
auto& info = GetInfo(this);
if (scrollIndex < static_cast<int32_t>(info.ListViews.size()))
if (scrollIndex < static_cast<int32_t>(_info.ListViews.size()))
{
info.ListViews[scrollIndex].MouseOver(screenCoords, true);
_info.ListViews[scrollIndex].MouseOver(screenCoords, true);
}
}
void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
auto& info = GetInfo(this);
if (scrollIndex < static_cast<int32_t>(info.ListViews.size()))
if (scrollIndex < static_cast<int32_t>(_info.ListViews.size()))
{
info.ListViews[scrollIndex].MouseOver(screenCoords, false);
_info.ListViews[scrollIndex].MouseOver(screenCoords, false);
}
}
void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override
{
const auto& info = GetInfo(this);
if (scrollIndex < static_cast<int32_t>(info.ListViews.size()))
if (scrollIndex < static_cast<int32_t>(_info.ListViews.size()))
{
info.ListViews[scrollIndex].Paint(this, dpi, &scrolls[scrollIndex]);
_info.ListViews[scrollIndex].Paint(this, dpi, &scrolls[scrollIndex]);
}
}
void ChangeTab(size_t tabIndex)
{
const auto& info = GetInfo(this);
page = static_cast<int16_t>(tabIndex);
frame_no = 0;
RefreshWidgets();
Invalidate();
WindowEventResizeCall(this);
WindowEventInvalidateCall(this);
WindowEventOnPrepareDrawCall(this);
WindowInitScrollWidgets(*this);
Invalidate();
InvokeEventHandler(info.Owner, info.Desc.OnTabChange);
InvokeEventHandler(_info.Owner, _info.Desc.OnTabChange);
}
const CustomWindowInfo& GetInfo() const
{
return _info;
}
CustomWindowInfo& GetInfo()
{
return _info;
}
private:
@@ -793,8 +779,7 @@ namespace OpenRCT2::Ui::Windows
if (viewportWidgetIndex)
{
auto viewportWidget = &widgets[*viewportWidgetIndex];
auto& customInfo = GetInfo(this);
auto widgetInfo = customInfo.GetCustomWidgetDesc(this, *viewportWidgetIndex);
auto widgetInfo = _info.GetCustomWidgetDesc(this, *viewportWidgetIndex);
if (widgetInfo != nullptr)
{
auto left = windowPos.x + viewportWidget->left + 1;
@@ -835,8 +820,7 @@ namespace OpenRCT2::Ui::Windows
void SetPressedTab()
{
const auto& info = GetInfo(this);
auto numTabs = info.Desc.Tabs.size();
auto numTabs = _info.Desc.Tabs.size();
if (numTabs != 0)
{
for (size_t i = 0; i < numTabs; i++)
@@ -849,8 +833,7 @@ namespace OpenRCT2::Ui::Windows
void DrawTabImages(DrawPixelInfo& dpi)
{
const auto& customInfo = GetInfo(this);
const auto& tabs = customInfo.Desc.Tabs;
const auto& tabs = _info.Desc.Tabs;
size_t tabIndex = 0;
for (const auto& tab : tabs)
{
@@ -874,26 +857,25 @@ namespace OpenRCT2::Ui::Windows
void RefreshWidgets()
{
auto& info = GetInfo(this);
auto& widgetList = info.Widgets;
auto& widgetList = _info.Widgets;
widgetList.clear();
info.WidgetIndexMap.clear();
info.ListViews.clear();
_info.WidgetIndexMap.clear();
_info.ListViews.clear();
// Add default widgets (window shim)
widgetList.insert(widgetList.begin(), std::begin(CustomDefaultWidgets), std::end(CustomDefaultWidgets));
for (size_t i = 0; i < widgetList.size(); i++)
{
info.WidgetIndexMap.push_back(std::numeric_limits<size_t>::max());
_info.WidgetIndexMap.push_back(std::numeric_limits<size_t>::max());
}
// Add window tabs
if (info.Desc.Tabs.size() != 0)
if (_info.Desc.Tabs.size() != 0)
{
widgetList[WIDX_CONTENT_PANEL].top = 43;
}
for (size_t tabDescIndex = 0; tabDescIndex < info.Desc.Tabs.size(); tabDescIndex++)
for (size_t tabDescIndex = 0; tabDescIndex < _info.Desc.Tabs.size(); tabDescIndex++)
{
Widget widget{};
widget.type = WindowWidgetType::Tab;
@@ -905,33 +887,33 @@ namespace OpenRCT2::Ui::Windows
widget.image = ImageId(SPR_TAB, FilterPaletteID::PaletteNull);
widget.tooltip = STR_NONE;
widgetList.push_back(widget);
info.WidgetIndexMap.push_back(std::numeric_limits<size_t>::max());
_info.WidgetIndexMap.push_back(std::numeric_limits<size_t>::max());
}
// Add custom widgets
auto totalWidgets = info.Desc.Widgets.size();
auto totalWidgets = _info.Desc.Widgets.size();
auto tabWidgetsOffset = totalWidgets;
if (info.Desc.Tabs.size() != 0)
if (_info.Desc.Tabs.size() != 0)
{
totalWidgets += info.Desc.Tabs[page].Widgets.size();
totalWidgets += _info.Desc.Tabs[page].Widgets.size();
}
for (size_t widgetDescIndex = 0; widgetDescIndex < totalWidgets; widgetDescIndex++)
{
const auto& widgetDesc = widgetDescIndex < info.Desc.Widgets.size()
? info.Desc.Widgets[widgetDescIndex]
: info.Desc.Tabs[page].Widgets[widgetDescIndex - tabWidgetsOffset];
const auto& widgetDesc = widgetDescIndex < _info.Desc.Widgets.size()
? _info.Desc.Widgets[widgetDescIndex]
: _info.Desc.Tabs[page].Widgets[widgetDescIndex - tabWidgetsOffset];
auto preWidgetSize = widgetList.size();
CreateWidget(widgetList, widgetDesc);
auto numWidetsAdded = widgetList.size() - preWidgetSize;
for (size_t i = 0; i < numWidetsAdded; i++)
{
info.WidgetIndexMap.push_back(widgetDescIndex);
_info.WidgetIndexMap.push_back(widgetDescIndex);
}
if (widgetDesc.Type == "listview")
{
CustomListView listView(this, info.ListViews.size());
listView.Owner = info.Owner;
CustomListView listView(this, _info.ListViews.size());
listView.Owner = _info.Owner;
listView.SetScrollbars(widgetDesc.Scrollbars, true);
listView.SetColumns(widgetDesc.ListViewColumns, true);
listView.SetItems(widgetDesc.ListViewItems, true);
@@ -941,7 +923,7 @@ namespace OpenRCT2::Ui::Windows
listView.OnClick = widgetDesc.OnClick;
listView.OnHighlight = widgetDesc.OnHighlight;
listView.CanSelect = widgetDesc.CanSelect;
info.ListViews.push_back(std::move(listView));
_info.ListViews.push_back(std::move(listView));
}
}
@@ -1132,22 +1114,18 @@ namespace OpenRCT2::Ui::Windows
if (desc.X && desc.Y)
{
window = WindowCreate<CustomWindow>(
WindowClass::Custom, { *desc.X, *desc.Y }, desc.Width, desc.Height, windowFlags);
WindowClass::Custom, { *desc.X, *desc.Y }, desc.Width, desc.Height, windowFlags, owner, desc);
}
else
{
window = WindowCreate<CustomWindow>(WindowClass::Custom, desc.Width, desc.Height, windowFlags);
}
if (window != nullptr)
{
window->Initialise(owner, desc);
window = WindowCreate<CustomWindow>(WindowClass::Custom, desc.Width, desc.Height, windowFlags, owner, desc);
}
return window;
}
static CustomWindowInfo& GetInfo(WindowBase* w)
static CustomWindowInfo& GetInfo(CustomWindow* w)
{
return *(static_cast<CustomWindowInfo*>(w->custom_info));
return w->GetInfo();
}
static void InvokeEventHandler(const std::shared_ptr<Plugin>& owner, const DukValue& dukHandler)
@@ -1165,9 +1143,9 @@ namespace OpenRCT2::Ui::Windows
std::string GetWindowTitle(WindowBase* w)
{
if (w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
auto& customInfo = GetInfo(w);
auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
return customInfo.Desc.Title;
}
return {};
@@ -1175,18 +1153,18 @@ namespace OpenRCT2::Ui::Windows
void UpdateWindowTitle(WindowBase* w, std::string_view value)
{
if (w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
auto& customInfo = GetInfo(w);
auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
customInfo.Desc.Title = value;
}
}
void UpdateWindowTab(WindowBase* w, int32_t tabIndex)
{
if (w->classification == WindowClass::Custom && w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
auto& customInfo = GetInfo(w);
auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
if (tabIndex >= 0 && tabIndex < static_cast<int32_t>(customInfo.Desc.Tabs.size()))
{
static_cast<CustomWindow*>(w)->ChangeTab(tabIndex);
@@ -1196,9 +1174,9 @@ namespace OpenRCT2::Ui::Windows
void UpdateWidgetText(WindowBase* w, WidgetIndex widgetIndex, std::string_view value)
{
if (w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
auto& customInfo = GetInfo(w);
auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
auto customWidgetInfo = customInfo.GetCustomWidgetDesc(w, widgetIndex);
if (customWidgetInfo != nullptr)
{
@@ -1211,9 +1189,9 @@ namespace OpenRCT2::Ui::Windows
void UpdateWidgetItems(WindowBase* w, WidgetIndex widgetIndex, const std::vector<std::string>& items)
{
if (w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
auto& customInfo = GetInfo(w);
auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
auto customWidgetInfo = customInfo.GetCustomWidgetDesc(w, widgetIndex);
if (customWidgetInfo != nullptr)
{
@@ -1225,9 +1203,9 @@ namespace OpenRCT2::Ui::Windows
void UpdateWidgetColour(WindowBase* w, WidgetIndex widgetIndex, colour_t colour)
{
if (w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
auto& customInfo = GetInfo(w);
auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
auto customWidgetInfo = customInfo.GetCustomWidgetDesc(w, widgetIndex);
if (customWidgetInfo != nullptr)
{
@@ -1252,9 +1230,9 @@ namespace OpenRCT2::Ui::Windows
void UpdateWidgetSelectedIndex(WindowBase* w, WidgetIndex widgetIndex, int32_t selectedIndex)
{
if (w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
auto& customInfo = GetInfo(w);
auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
auto customWidgetInfo = customInfo.GetCustomWidgetDesc(w, widgetIndex);
if (customWidgetInfo != nullptr)
{
@@ -1299,9 +1277,9 @@ namespace OpenRCT2::Ui::Windows
std::vector<std::string> GetWidgetItems(WindowBase* w, WidgetIndex widgetIndex)
{
if (w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
auto& customInfo = GetInfo(w);
auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
auto customWidgetInfo = customInfo.GetCustomWidgetDesc(w, widgetIndex);
if (customWidgetInfo != nullptr)
{
@@ -1313,9 +1291,9 @@ namespace OpenRCT2::Ui::Windows
colour_t GetWidgetColour(WindowBase* w, WidgetIndex widgetIndex)
{
if (w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
auto& customInfo = GetInfo(w);
auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
auto customWidgetInfo = customInfo.GetCustomWidgetDesc(w, widgetIndex);
if (customWidgetInfo != nullptr)
{
@@ -1327,9 +1305,9 @@ namespace OpenRCT2::Ui::Windows
int32_t GetWidgetSelectedIndex(WindowBase* w, WidgetIndex widgetIndex)
{
if (w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
auto& customInfo = GetInfo(w);
auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
auto customWidgetInfo = customInfo.GetCustomWidgetDesc(w, widgetIndex);
if (customWidgetInfo != nullptr)
{
@@ -1345,7 +1323,7 @@ namespace OpenRCT2::Ui::Windows
{
if (w->classification == WindowClass::Custom)
{
const auto& customInfo = GetInfo(w.get());
const auto& customInfo = GetInfo(static_cast<CustomWindow*>(w.get()));
if (customInfo.Desc.Classification == classification)
{
return w.get();
@@ -1357,9 +1335,9 @@ namespace OpenRCT2::Ui::Windows
std::optional<WidgetIndex> FindWidgetIndexByName(WindowBase* w, std::string_view name)
{
if (w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
auto& customInfo = GetInfo(w);
auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
for (size_t i = 0; i < customInfo.Widgets.size(); i++)
{
auto customWidgetInfo = customInfo.GetCustomWidgetDesc(w, i);
@@ -1377,9 +1355,9 @@ namespace OpenRCT2::Ui::Windows
std::string GetWidgetName(WindowBase* w, WidgetIndex widgetIndex)
{
if (w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
const auto& customInfo = GetInfo(w);
const auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
auto customWidgetInfo = customInfo.GetCustomWidgetDesc(w, widgetIndex);
if (customWidgetInfo != nullptr)
{
@@ -1391,9 +1369,9 @@ namespace OpenRCT2::Ui::Windows
void SetWidgetName(WindowBase* w, WidgetIndex widgetIndex, std::string_view name)
{
if (w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
auto& customInfo = GetInfo(w);
auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
auto customWidgetInfo = customInfo.GetCustomWidgetDesc(w, widgetIndex);
if (customWidgetInfo != nullptr)
{
@@ -1404,9 +1382,9 @@ namespace OpenRCT2::Ui::Windows
std::string GetWidgetTooltip(WindowBase* w, WidgetIndex widgetIndex)
{
if (w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
const auto& customInfo = GetInfo(w);
const auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
auto customWidgetInfo = customInfo.GetCustomWidgetDesc(w, widgetIndex);
if (customWidgetInfo != nullptr)
{
@@ -1418,9 +1396,9 @@ namespace OpenRCT2::Ui::Windows
void SetWidgetTooltip(WindowBase* w, WidgetIndex widgetIndex, std::string_view tooltip)
{
if (w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
auto& customInfo = GetInfo(w);
auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
auto customWidgetInfo = customInfo.GetCustomWidgetDesc(w, widgetIndex);
if (customWidgetInfo != nullptr)
{
@@ -1431,9 +1409,9 @@ namespace OpenRCT2::Ui::Windows
CustomListView* GetCustomListView(WindowBase* w, WidgetIndex widgetIndex)
{
if (w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
auto& info = GetInfo(w);
auto& info = GetInfo(static_cast<CustomWindow*>(w));
auto scrollIndex = WindowGetScrollDataIndex(*w, widgetIndex);
if (scrollIndex < static_cast<int32_t>(info.ListViews.size()))
{
@@ -1445,9 +1423,9 @@ namespace OpenRCT2::Ui::Windows
int32_t GetWidgetMaxLength(WindowBase* w, WidgetIndex widgetIndex)
{
if (w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
auto& customInfo = GetInfo(w);
auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
auto customWidgetInfo = customInfo.GetCustomWidgetDesc(w, widgetIndex);
if (customWidgetInfo != nullptr)
{
@@ -1459,9 +1437,9 @@ namespace OpenRCT2::Ui::Windows
void SetWidgetMaxLength(WindowBase* w, WidgetIndex widgetIndex, int32_t value)
{
if (w->custom_info != nullptr)
if (w->classification == WindowClass::Custom)
{
auto& customInfo = GetInfo(w);
auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
auto customWidgetInfo = customInfo.GetCustomWidgetDesc(w, widgetIndex);
if (customWidgetInfo != nullptr)
{
@@ -1479,8 +1457,8 @@ namespace OpenRCT2::Ui::Windows
if (window->classification == WindowClass::Custom)
{
auto customWindow = reinterpret_cast<CustomWindow*>(window.get());
auto customInfo = reinterpret_cast<CustomWindowInfo*>(customWindow->custom_info);
if (customInfo != nullptr && customInfo->Owner == plugin)
auto& customInfo = GetInfo(customWindow);
if (customInfo.Owner == plugin)
{
customWindows.push_back(window);
}
+4 -6
View File
@@ -304,12 +304,10 @@ namespace OpenRCT2::Scripting
auto plugin = _scriptEngine.GetExecInfo().GetCurrentPlugin();
auto callback = desc["callback"];
WindowScenarioselectOpen(
[this, plugin, callback](std::string_view path) {
auto dukValue = GetScenarioFile(path);
_scriptEngine.ExecutePluginCall(plugin, callback, { dukValue }, false);
},
false);
WindowScenarioselectOpen([this, plugin, callback](std::string_view path) {
auto dukValue = GetScenarioFile(path);
_scriptEngine.ExecutePluginCall(plugin, callback, { dukValue }, false);
});
}
void activateTool(const DukValue& desc)
@@ -305,6 +305,7 @@ namespace OpenRCT2::Title
objectManager.LoadObjects(result.RequiredObjects);
parkImporter->Import();
MapAnimationAutoCreate();
}
PrepareParkForPlayback();
success = true;
+13 -6
View File
@@ -21,10 +21,10 @@
using namespace OpenRCT2;
static constexpr const int32_t WW = 400;
static constexpr const int32_t WH = 400;
static constexpr const StringId WINDOW_TITLE = STR_ABOUT;
static constexpr const int32_t TABHEIGHT = 50;
static constexpr int32_t WW = 400;
static constexpr int32_t WH = 400;
static constexpr StringId WINDOW_TITLE = STR_ABOUT;
static constexpr int32_t TABHEIGHT = 50;
// clang-format off
enum
@@ -74,10 +74,12 @@ static Widget _windowAboutOpenRCT2Widgets[] = {
MakeWidget({168, 115 + 40}, {200, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_CHANGELOG_ELLIPSIS), // changelog button
MakeWidget({168, 115 + 60}, {200, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_JOIN_DISCORD ), // "join discord" button
MakeWidget({10, 250}, {WW - 20, 50}, WindowWidgetType::LabelCentred, WindowColour::Secondary, STR_ABOUT_OPENRCT2_DESCRIPTION_2), // More info
MakeWidget({10, 300}, {WW - 20, 50}, WindowWidgetType::LabelCentred, WindowColour::Secondary, STR_ABOUT_OPENRCT2_DESCRIPTION_3), // Copyright
MakeWidget({10, 350}, {WW - 20, 50}, WindowWidgetType::LabelCentred, WindowColour::Secondary, STR_ABOUT_SPECIAL_THANKS_1), // Special Thanks
MakeWidget({10, 280}, {WW - 20, 50}, WindowWidgetType::LabelCentred, WindowColour::Secondary, STR_ABOUT_OPENRCT2_DESCRIPTION_3), // Copyright
MakeWidget({10, 360}, {WW - 20, 50}, WindowWidgetType::LabelCentred, WindowColour::Secondary, STR_ABOUT_SPECIAL_THANKS_1), // Special Thanks
MakeWidget({10, 375}, {WW - 20, 50}, WindowWidgetType::LabelCentred, WindowColour::Secondary, STR_ABOUT_SPECIAL_THANKS_2), // Company names
MakeWidget({168, 115 + 80}, {200, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_CONTRIBUTORS_WINDOW_BUTTON), // "contributors" button
MakeWidget({10, 310}, {WW - 20, 50}, WindowWidgetType::LabelCentred, WindowColour::Secondary, STR_ABOUT_OPENRCT2_TITLE), // Title Theme
MakeWidget({10, 338}, {WW - 20, 50}, WindowWidgetType::LabelCentred, WindowColour::Secondary, STR_ABOUT_FAIRGROUND_ORGAN), // Fairground organ
WIDGETS_END,
};
@@ -259,6 +261,11 @@ private:
// Licence
}
void OnResize() override
{
ResizeFrameWithPage();
}
};
/**
+3 -3
View File
@@ -20,9 +20,9 @@
using namespace OpenRCT2;
static constexpr const StringId WINDOW_TITLE = STR_ASSET_PACKS;
static constexpr const int32_t WW = 400;
static constexpr const int32_t WH = 200;
static constexpr StringId WINDOW_TITLE = STR_ASSET_PACKS;
static constexpr int32_t WW = 400;
static constexpr int32_t WH = 200;
// clang-format off
enum WindowAssetPacksWidgetIdx {
+9 -4
View File
@@ -23,9 +23,9 @@
#include <openrct2/world/Banner.h>
#include <openrct2/world/Scenery.h>
static constexpr const int32_t WW = 113;
static constexpr const int32_t WH = 96;
static constexpr const StringId WINDOW_TITLE = STR_BANNER_WINDOW_TITLE;
static constexpr int32_t WW = 113;
static constexpr int32_t WH = 96;
static constexpr StringId WINDOW_TITLE = STR_BANNER_WINDOW_TITLE;
// clang-format off
enum WindowBannerWidgetIdx {
@@ -41,7 +41,7 @@ enum WindowBannerWidgetIdx {
WIDX_TEXT_COLOUR_DROPDOWN_BUTTON
};
static constexpr const StringId BannerColouredTextFormats[] = {
static constexpr StringId BannerColouredTextFormats[] = {
STR_TEXT_COLOUR_BLACK,
STR_TEXT_COLOUR_GREY,
STR_TEXT_COLOUR_WHITE,
@@ -295,6 +295,11 @@ public:
Widget* dropDownWidget = &window_banner_widgets[WIDX_TEXT_COLOUR_DROPDOWN];
dropDownWidget->text = BannerColouredTextFormats[banner->text_colour];
}
void OnResize() override
{
ResizeFrame();
}
};
/**
+3 -3
View File
@@ -37,9 +37,9 @@ enum {
WIDX_OPEN_URL,
};
static constexpr const int32_t WW = 500;
static constexpr const int32_t WH = 400;
static constexpr const StringId WINDOW_TITLE = STR_CHANGELOG_TITLE;
static constexpr int32_t WW = 500;
static constexpr int32_t WH = 400;
static constexpr StringId WINDOW_TITLE = STR_CHANGELOG_TITLE;
constexpr int32_t MIN_WW = 300;
constexpr int32_t MIN_WH = 250;
+13 -8
View File
@@ -50,7 +50,7 @@ static StringId _staffSpeedNames[] =
STR_FAST,
};
static constexpr const StringId WeatherTypes[] =
static constexpr StringId WeatherTypes[] =
{
STR_SUNNY,
STR_PARTIALLY_CLOUDY,
@@ -180,17 +180,17 @@ enum WindowCheatsWidgetIdx
#pragma region MEASUREMENTS
static constexpr const StringId WINDOW_TITLE = STR_CHEAT_TITLE;
static constexpr const int32_t WW = 249;
static constexpr const int32_t WH = 300;
static constexpr StringId WINDOW_TITLE = STR_CHEAT_TITLE;
static constexpr int32_t WW = 249;
static constexpr int32_t WH = 300;
static constexpr ScreenSize CHEAT_BUTTON = {110, 17};
static constexpr ScreenSize CHEAT_CHECK = {221, 12};
static constexpr ScreenSize CHEAT_SPINNER = {117, 14};
static constexpr ScreenSize MINMAX_BUTTON = {55, 17};
static constexpr const int32_t TAB_WIDTH = 31;
static constexpr const int32_t TAB_START = 3;
static constexpr int32_t TAB_WIDTH = 31;
static constexpr int32_t TAB_START = 3;
#pragma endregion
@@ -641,7 +641,7 @@ private:
void UpdateTabPositions()
{
constexpr const uint16_t tabs[] = {
constexpr uint16_t tabs[] = {
WIDX_TAB_1,
WIDX_TAB_2,
WIDX_TAB_3,
@@ -792,7 +792,7 @@ private:
CheatsSet(CheatType::SetMoney, _moneySpinnerValue);
break;
case WIDX_CLEAR_LOAN:
CheatsSet(CheatType::ClearLoan, CHEATS_MONEY_DEFAULT);
CheatsSet(CheatType::ClearLoan);
break;
}
}
@@ -1121,6 +1121,11 @@ private:
break;
}
}
void OnResize() override
{
ResizeFrameWithPage();
}
};
WindowBase* WindowCheatsOpen()
+8 -3
View File
@@ -30,9 +30,9 @@ enum WindowClearSceneryWidgetIdx
WIDX_FOOTPATH
};
// clang-format on
static constexpr const StringId WINDOW_TITLE = STR_CLEAR_SCENERY;
static constexpr const int32_t WW = 98;
static constexpr const int32_t WH = 94;
static constexpr StringId WINDOW_TITLE = STR_CLEAR_SCENERY;
static constexpr int32_t WW = 98;
static constexpr int32_t WH = 94;
static constexpr ScreenSize CLEAR_SCENERY_BUTTON = { 24, 24 };
@@ -195,6 +195,11 @@ public:
DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE });
}
}
void OnResize() override
{
ResizeFrame();
}
};
WindowBase* WindowClearSceneryOpen()
+8 -3
View File
@@ -18,9 +18,9 @@
#include <openrct2/localisation/Localisation.h>
#include <openrct2/util/Util.h>
static constexpr const StringId WINDOW_TITLE = STR_CUSTOM_CURRENCY_WINDOW_TITLE;
static constexpr const int32_t WH = 100;
static constexpr const int32_t WW = 400;
static constexpr StringId WINDOW_TITLE = STR_CUSTOM_CURRENCY_WINDOW_TITLE;
static constexpr int32_t WH = 100;
static constexpr int32_t WW = 400;
// clang-format off
enum WindowCustomCurrencyWidgetIdx {
@@ -218,6 +218,11 @@ public:
: STR_SUFFIX;
DrawTextBasic(dpi, drawPos, stringId, {}, { colours[1] });
}
void OnResize() override
{
ResizeFrame();
}
};
WindowBase* CustomCurrencyWindowOpen()
@@ -18,8 +18,8 @@
#include <openrct2/windows/Intent.h>
#include <openrct2/world/Park.h>
static constexpr const int32_t WW = 200;
static constexpr const int32_t WH = 100;
static constexpr int32_t WW = 200;
static constexpr int32_t WH = 100;
// clang-format off
enum WindowRideDemolishWidgetIdx
@@ -90,6 +90,11 @@ public:
DrawTextWrapped(dpi, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE });
}
}
void OnResize() override
{
ResizeFrame();
}
};
WindowBase* WindowRideDemolishPromptOpen(const Ride& ride)
+1 -1
View File
@@ -28,7 +28,7 @@ constexpr int32_t DROPDOWN_TEXT_MAX_ROWS = 32;
constexpr int32_t DROPDOWN_ITEM_HEIGHT = 12;
static constexpr const std::array<uint8_t, 57> _appropriateImageDropdownItemsPerRow = {
static constexpr std::array<uint8_t, 57> _appropriateImageDropdownItemsPerRow = {
1, 1, 1, 1, 2, 2, 3, 3, 4, 3, // 10
5, 4, 4, 5, 5, 5, 4, 5, 6, 5, // 20
5, 7, 4, 5, 6, 5, 6, 6, 6, 6, // 30
@@ -49,7 +49,7 @@ class EditorBottomToolbarWindow final : public Window
private:
using FuncPtr = void (EditorBottomToolbarWindow::*)() const;
static constexpr const StringId _editorStepNames[] = {
static constexpr StringId _editorStepNames[] = {
STR_EDITOR_STEP_OBJECT_SELECTION, STR_EDITOR_STEP_LANDSCAPE_EDITOR, STR_EDITOR_STEP_INVENTIONS_LIST_SET_UP,
STR_EDITOR_STEP_OPTIONS_SELECTION, STR_EDITOR_STEP_OBJECTIVE_SELECTION, STR_EDITOR_STEP_SAVE_SCENARIO,
STR_EDITOR_STEP_ROLLERCOASTER_DESIGNER, STR_EDITOR_STEP_TRACK_DESIGNS_MANAGER,
@@ -374,7 +374,7 @@ private:
nullptr,
};
static constexpr const FuncPtr _nextButtonMouseUp[] = {
static constexpr FuncPtr _nextButtonMouseUp[] = {
&EditorBottomToolbarWindow::JumpForwardFromObjectSelection,
&EditorBottomToolbarWindow::JumpForwardToInventionListSetUp,
&EditorBottomToolbarWindow::JumpForwardToOptionsSelection,
@@ -27,9 +27,9 @@
#pragma region Widgets
static constexpr const int32_t WW = 600;
static constexpr const int32_t WH = 400;
static constexpr const StringId WINDOW_TITLE = STR_INVENTION_LIST;
static constexpr int32_t WW = 600;
static constexpr int32_t WH = 400;
static constexpr StringId WINDOW_TITLE = STR_INVENTION_LIST;
// clang-format off
enum {
@@ -115,9 +115,9 @@ static char _filter_string[MAX_PATH];
#define _FILTER_SELECTED (_filter_flags & FILTER_SELECTED)
#define _FILTER_NONSELECTED (_filter_flags & FILTER_NONSELECTED)
static constexpr const StringId WINDOW_TITLE = STR_OBJECT_SELECTION;
static constexpr const int32_t WH = 400;
static constexpr const int32_t WW = 755;
static constexpr StringId WINDOW_TITLE = STR_OBJECT_SELECTION;
static constexpr int32_t WH = 400;
static constexpr int32_t WW = 755;
struct ObjectPageDesc
{
@@ -128,7 +128,7 @@ struct ObjectPageDesc
// clang-format off
// Order of which the object tabs are displayed.
static constexpr const ObjectPageDesc ObjectSelectionPages[] = {
static constexpr ObjectPageDesc ObjectSelectionPages[] = {
{ STR_OBJECT_SELECTION_RIDE_VEHICLES_ATTRACTIONS, SPR_TAB_RIDE_16, false },
{ STR_OBJECT_SELECTION_STATIONS, SPR_G2_RIDE_STATION_TAB, true },
{ STR_OBJECT_SELECTION_MUSIC, SPR_TAB_MUSIC_0, true },
@@ -153,7 +153,7 @@ ObjectType static TabOrder[] = {
ObjectType::Ride, ObjectType::Station, ObjectType::Music,
ObjectType::SceneryGroup, ObjectType::SmallScenery, ObjectType::LargeScenery,
ObjectType::Walls, ObjectType::FootpathSurface, ObjectType::FootpathRailings,
ObjectType::Paths, ObjectType::PathBits, ObjectType::Banners,
ObjectType::Paths, ObjectType::PathAdditions, ObjectType::Banners,
ObjectType::ParkEntrance, ObjectType::TerrainSurface, ObjectType::TerrainEdge,
ObjectType::Water,
};
@@ -221,7 +221,7 @@ static std::vector<Widget> _window_editor_object_selection_widgets = {
#pragma endregion
static constexpr const int32_t window_editor_object_selection_animation_loops[] = {
static constexpr int32_t window_editor_object_selection_animation_loops[] = {
20, // All
32, // Transport
10, // Gentle
@@ -230,7 +230,7 @@ static constexpr const int32_t window_editor_object_selection_animation_loops[]
28, // Water
16, // Stall
};
static constexpr const int32_t window_editor_object_selection_animation_divisor[] = {
static constexpr int32_t window_editor_object_selection_animation_divisor[] = {
4, // All
8, // Transport
2, // Gentle
@@ -29,12 +29,12 @@
#include <openrct2/sprites.h>
#include <openrct2/world/Park.h>
static constexpr const StringId WINDOW_TITLE = STR_OBJECTIVE_SELECTION;
static constexpr const int32_t WH = 229;
static constexpr const int32_t WW = 450;
static constexpr StringId WINDOW_TITLE = STR_OBJECTIVE_SELECTION;
static constexpr int32_t WH = 229;
static constexpr int32_t WW = 450;
// The number has to leave a bit of room for other entities like vehicles, litter and balloons.
static constexpr const uint16_t MaxObjectiveGuests = 50000;
static constexpr uint16_t MaxObjectiveGuests = 50000;
#pragma region Widgets
@@ -45,7 +45,7 @@ enum {
WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_COUNT
};
static constexpr const StringId ObjectiveDropdownOptionNames[] = {
static constexpr StringId ObjectiveDropdownOptionNames[] = {
STR_OBJECTIVE_DROPDOWN_NONE,
STR_OBJECTIVE_DROPDOWN_NUMBER_OF_GUESTS_AT_A_GIVEN_DATE,
STR_OBJECTIVE_DROPDOWN_PARK_VALUE_AT_A_GIVEN_DATE,
@@ -134,6 +134,10 @@ static uint64_t window_editor_objective_options_page_hold_down_widgets[] = {
class EditorObjectiveOptionsWindow final : public Window
{
private:
// Not shops or facilities
std::vector<RideId> _rideableRides;
public:
void OnOpen() override
{
@@ -142,7 +146,6 @@ public:
hold_down_widgets = window_editor_objective_options_page_hold_down_widgets[WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN];
InitScrollWidgets();
selected_tab = WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN;
no_list_items = 0;
selected_list_item = -1;
UpdateDisabledWidgets();
}
@@ -288,8 +291,7 @@ private:
page = newPage;
frame_no = 0;
var_492 = 0;
no_list_items = 0;
_rideableRides.clear();
selected_list_item = -1;
hold_down_widgets = window_editor_objective_options_page_hold_down_widgets[newPage];
widgets = window_editor_objective_options_widgets[newPage];
@@ -1001,19 +1003,18 @@ private:
OnResize();
InvalidateWidget(WIDX_TAB_2);
auto numItems = 0;
const auto oldSize = _rideableRides.size();
_rideableRides.clear();
for (auto& currentRide : GetRideManager())
{
if (currentRide.IsRide())
{
list_item_positions[numItems] = currentRide.id.ToUnderlying();
numItems++;
_rideableRides.push_back(currentRide.id);
}
}
if (no_list_items != numItems)
if (oldSize != _rideableRides.size())
{
no_list_items = numItems;
Invalidate();
}
}
@@ -1025,7 +1026,7 @@ private:
ScreenSize OnScrollGetSizeRides(int32_t scrollIndex)
{
ScreenSize newSize;
newSize.height = no_list_items * 12;
newSize.height = static_cast<int32_t>(_rideableRides.size()) * 10;
return newSize;
}
@@ -1037,11 +1038,10 @@ private:
void OnScrollMouseDownRides(int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
{
auto i = screenCoords.y / 12;
if (i < 0 || i >= no_list_items)
if (i < 0 || i >= static_cast<int32_t>(_rideableRides.size()))
return;
const auto currentRideId = RideId::FromUnderlying(list_item_positions[i]);
auto currentRide = GetRide(currentRideId);
auto* currentRide = GetRide(_rideableRides[i]);
if (currentRide != nullptr)
{
currentRide->lifecycle_flags ^= RIDE_LIFECYCLE_INDESTRUCTIBLE;
@@ -1058,7 +1058,7 @@ private:
int32_t i;
i = screenCoords.y / 12;
if (i < 0 || i >= no_list_items)
if (i < 0 || i >= static_cast<int32_t>(_rideableRides.size()))
return;
if (selected_list_item != i)
@@ -1112,7 +1112,7 @@ private:
int32_t colour = ColourMapA[colours[1]].mid_light;
GfxFillRect(dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, colour);
for (int32_t i = 0; i < no_list_items; i++)
for (int32_t i = 0; i < static_cast<int32_t>(_rideableRides.size()); i++)
{
int32_t y = i * 12;
@@ -1131,8 +1131,7 @@ private:
}
// Checkbox mark
const auto currentRideId = RideId::FromUnderlying(list_item_positions[i]);
auto currentRide = GetRide(currentRideId);
auto* currentRide = GetRide(_rideableRides[i]);
if (currentRide != nullptr)
{
if (currentRide->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE)
@@ -29,14 +29,14 @@
#include <openrct2/world/Climate.h>
#include <openrct2/world/Park.h>
static constexpr const int32_t WW_FINANCIAL = 280;
static constexpr const int32_t WH_FINANCIAL = 149;
static constexpr int32_t WW_FINANCIAL = 280;
static constexpr int32_t WH_FINANCIAL = 149;
static constexpr const int32_t WW_GUESTS = 380;
static constexpr const int32_t WH_GUESTS = 149;
static constexpr int32_t WW_GUESTS = 380;
static constexpr int32_t WH_GUESTS = 149;
static constexpr const int32_t WW_PARK = 400;
static constexpr const int32_t WH_PARK = 200;
static constexpr int32_t WW_PARK = 400;
static constexpr int32_t WH_PARK = 200;
#pragma region Widgets
@@ -48,7 +48,7 @@ enum {
WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_COUNT
};
static constexpr const StringId ClimateNames[] = {
static constexpr StringId ClimateNames[] = {
STR_CLIMATE_COOL_AND_WET,
STR_CLIMATE_WARM,
STR_CLIMATE_HOT_AND_DRY,
@@ -356,7 +356,6 @@ private:
page = newPage;
frame_no = 0;
var_492 = 0;
hold_down_widgets = window_editor_scenario_options_page_hold_down_widgets[page];
widgets = window_editor_scenario_options_widgets[page];
Invalidate();
+6 -4
View File
@@ -34,6 +34,7 @@ class ErrorWindow final : public Window
private:
std::string _text;
uint16_t _numLines;
uint8_t _staleCount;
public:
ErrorWindow(std::string text, uint16_t numLines)
@@ -48,7 +49,7 @@ public:
window_error_widgets[WIDX_BACKGROUND].bottom = height;
widgets = window_error_widgets;
error.var_480 = 0;
_staleCount = 0;
if (!gDisableErrorWindowSound)
{
OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Error, 0, windowPos.x + (width / 2));
@@ -97,10 +98,11 @@ public:
dpi, { leftTop + ScreenCoordsXY{ (width + 1) / 2 - 1, 1 } }, _numLines, _text.data(), FontStyle::Medium);
}
void OnUnknown5() override
void OnPeriodicUpdate() override
{
error.var_480++;
if (error.var_480 >= 8)
// Close the window after 8 seconds of showing
_staleCount++;
if (_staleCount >= 8)
{
Close();
}
+20 -15
View File
@@ -83,16 +83,16 @@ enum
#pragma region Measurements
static constexpr const int32_t WH_SUMMARY = 309;
static constexpr const int32_t WH_RESEARCH = 207;
static constexpr const int32_t WH_OTHER_TABS = 257;
static constexpr const int32_t WW_RESEARCH = 320;
static constexpr const int32_t WW_OTHER_TABS = 530;
static constexpr const int32_t RSH_SUMMARY = 266;
static constexpr const int32_t RSH_RESEARCH = 164;
static constexpr const int32_t RSH_OTHER_TABS = 214;
static constexpr const int32_t RSW_RESEARCH = WW_RESEARCH;
static constexpr const int32_t RSW_OTHER_TABS = WW_OTHER_TABS;
static constexpr int32_t WH_SUMMARY = 309;
static constexpr int32_t WH_RESEARCH = 207;
static constexpr int32_t WH_OTHER_TABS = 257;
static constexpr int32_t WW_RESEARCH = 320;
static constexpr int32_t WW_OTHER_TABS = 530;
static constexpr int32_t RSH_SUMMARY = 266;
static constexpr int32_t RSH_RESEARCH = 164;
static constexpr int32_t RSH_OTHER_TABS = 214;
static constexpr int32_t RSW_RESEARCH = WW_RESEARCH;
static constexpr int32_t RSW_OTHER_TABS = WW_OTHER_TABS;
#pragma endregion
@@ -179,7 +179,7 @@ static_assert(std::size(_windowFinancesPageWidgets) == WINDOW_FINANCES_PAGE_COUN
#pragma endregion
static constexpr const StringId _windowFinancesSummaryRowLabels[static_cast<int32_t>(ExpenditureType::Count)] = {
static constexpr StringId _windowFinancesSummaryRowLabels[static_cast<int32_t>(ExpenditureType::Count)] = {
STR_FINANCES_SUMMARY_RIDE_CONSTRUCTION,
STR_FINANCES_SUMMARY_RIDE_RUNNING_COSTS,
STR_FINANCES_SUMMARY_LAND_PURCHASE,
@@ -196,7 +196,7 @@ static constexpr const StringId _windowFinancesSummaryRowLabels[static_cast<int3
STR_FINANCES_SUMMARY_LOAN_INTEREST,
};
static constexpr const int32_t _windowFinancesTabAnimationFrames[] = {
static constexpr int32_t _windowFinancesTabAnimationFrames[] = {
8, // WINDOW_FINANCES_PAGE_SUMMARY
16, // WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH
16, // WINDOW_FINANCES_PAGE_VALUE_GRAPH
@@ -206,9 +206,9 @@ static constexpr const int32_t _windowFinancesTabAnimationFrames[] = {
};
static_assert(std::size(_windowFinancesTabAnimationFrames) == WINDOW_FINANCES_PAGE_COUNT);
static constexpr const int32_t EXPENDITURE_COLUMN_WIDTH = 80;
static constexpr int32_t EXPENDITURE_COLUMN_WIDTH = 80;
static constexpr const uint32_t _windowFinancesPageHoldDownWidgets[] = {
static constexpr uint32_t _windowFinancesPageHoldDownWidgets[] = {
(1uLL << WIDX_LOAN_INCREASE) | (1uLL << WIDX_LOAN_DECREASE), // WINDOW_FINANCES_PAGE_SUMMARY
0, // WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH
@@ -467,7 +467,7 @@ public:
height = WH_OTHER_TABS;
}
WindowEventResizeCall(this);
WindowEventInvalidateCall(this);
WindowEventOnPrepareDrawCall(this);
WindowInitScrollWidgets(*this);
@@ -937,6 +937,11 @@ public:
DrawTabImage(dpi, WINDOW_FINANCES_PAGE_MARKETING, SPR_TAB_FINANCES_MARKETING_0);
DrawTabImage(dpi, WINDOW_FINANCES_PAGE_RESEARCH, SPR_TAB_FINANCES_RESEARCH_0);
}
void OnResize() override
{
ResizeFrameWithPage();
}
};
static FinancesWindow* FinancesWindowOpen(uint8_t page)
+12 -7
View File
@@ -45,9 +45,9 @@ enum
#pragma region Measurements
static constexpr const StringId WINDOW_TITLE = STR_FOOTPATHS;
static constexpr const int32_t WH_WINDOW = 421;
static constexpr const int32_t WW_WINDOW = 106;
static constexpr StringId WINDOW_TITLE = STR_FOOTPATHS;
static constexpr int32_t WH_WINDOW = 421;
static constexpr int32_t WW_WINDOW = 106;
#pragma endregion
@@ -116,7 +116,7 @@ static Widget window_footpath_widgets[] = {
#pragma endregion
/** rct2: 0x0098D8B4 */
static constexpr const uint8_t DefaultPathSlope[] = {
static constexpr uint8_t DefaultPathSlope[] = {
0,
SLOPE_IS_IRREGULAR_FLAG,
SLOPE_IS_IRREGULAR_FLAG,
@@ -136,7 +136,7 @@ static constexpr const uint8_t DefaultPathSlope[] = {
};
/** rct2: 0x0098D7E0 */
static constexpr const uint8_t ConstructionPreviewImages[][4] = {
static constexpr uint8_t ConstructionPreviewImages[][4] = {
{ 5, 10, 5, 10 }, // Flat
{ 16, 17, 18, 19 }, // Upwards
{ 18, 19, 16, 17 }, // Downwards
@@ -181,7 +181,7 @@ public:
void OnClose() override
{
FootpathProvisionalUpdate();
ViewportSetVisibility(0);
ViewportSetVisibility(ViewportVisibility::Default);
MapInvalidateMapSelectionTiles();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
WindowInvalidateByClass(WindowClass::TopToolbar);
@@ -1048,7 +1048,7 @@ private:
if (gFootpathGroundFlags & ELEMENT_IS_UNDERGROUND)
{
ViewportSetVisibility(1);
ViewportSetVisibility(ViewportVisibility::UndergroundViewOn);
}
gFootpathConstructFromPosition = footpathLoc;
@@ -1399,6 +1399,11 @@ public:
OnMouseUp(WIDX_CONSTRUCT);
}
void OnResize() override
{
ResizeFrame();
}
#pragma endregion
};
@@ -104,13 +104,13 @@ private:
DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE });
}
static constexpr const StringId _guestCountFormats[] = {
static constexpr StringId _guestCountFormats[] = {
STR_BOTTOM_TOOLBAR_NUM_GUESTS_STABLE,
STR_BOTTOM_TOOLBAR_NUM_GUESTS_DECREASE,
STR_BOTTOM_TOOLBAR_NUM_GUESTS_INCREASE,
};
static constexpr const StringId _guestCountFormatsSingular[] = {
static constexpr StringId _guestCountFormatsSingular[] = {
STR_BOTTOM_TOOLBAR_NUM_GUESTS_STABLE_SINGULAR,
STR_BOTTOM_TOOLBAR_NUM_GUESTS_DECREASE_SINGULAR,
STR_BOTTOM_TOOLBAR_NUM_GUESTS_INCREASE_SINGULAR,
@@ -648,13 +648,13 @@ public:
case WIDX_GUESTS:
case WIDX_PARK_RATING:
case WIDX_DATE:
gTooltipTimeout = 2000;
gTooltipCloseTimeout = gCurrentRealTimeTicks + 2000;
break;
}
return cursorId;
}
void OnUnknown5() override
void OnPeriodicUpdate() override
{
InvalidateDirtyWidgets();
}
+25 -30
View File
@@ -36,9 +36,9 @@
#include <openrct2/world/Footpath.h>
#include <openrct2/world/Park.h>
static constexpr const StringId WINDOW_TITLE = STR_STRINGID;
static constexpr const int32_t WH = 157;
static constexpr const int32_t WW = 192;
static constexpr StringId WINDOW_TITLE = STR_STRINGID;
static constexpr int32_t WH = 157;
static constexpr int32_t WW = 192;
enum WindowGuestPage
{
@@ -150,7 +150,7 @@ static constexpr std::array _guestWindowPageWidgets = {
static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT);
// clang-format on
static constexpr const std::array _guestWindowPageSizes = {
static constexpr std::array _guestWindowPageSizes = {
std::array{ ScreenSize{ 192, 159 }, ScreenSize{ 500, 450 } }, // WINDOW_GUEST_OVERVIEW
std::array{ ScreenSize{ 192, 180 }, ScreenSize{ 192, 180 } }, // WINDOW_GUEST_STATS
std::array{ ScreenSize{ 192, 180 }, ScreenSize{ 500, 400 } }, // WINDOW_GUEST_RIDES
@@ -168,6 +168,7 @@ private:
uint16_t _beingWatchedTimer = 0;
uint16_t _guestAnimationFrame = 0;
int16_t _pickedPeepX = LOCATION_NULL; // entity->x gets set to 0x8000 on pickup, this is the old value
std::vector<RideId> _riddenRides;
public:
void OnOpen() override
@@ -181,7 +182,6 @@ public:
min_height = 157;
max_width = 500;
max_height = 450;
no_list_items = 0;
selected_list_item = -1;
}
@@ -493,7 +493,7 @@ private:
page = newPage;
frame_no = 0;
no_list_items = 0;
_riddenRides.clear();
selected_list_item = -1;
RemoveViewport();
@@ -755,7 +755,7 @@ private:
WindowDrawViewport(dpi, *this);
if (viewport->flags & VIEWPORT_FLAG_SOUND_ON)
{
GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), windowPos + ScreenCoordsXY{ 2, 2 });
GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), WindowGetViewportSoundIconPos(*this));
}
}
@@ -850,10 +850,12 @@ private:
void OnUpdateOverview()
{
int32_t newAnimationFrame = _guestAnimationFrame;
newAnimationFrame++;
newAnimationFrame %= 24;
_guestAnimationFrame = newAnimationFrame;
_guestAnimationFrame++;
_guestAnimationFrame %= 24;
// Update pickup animation, can only happen in this tab.
picked_peep_frame++;
picked_peep_frame %= 48;
WidgetInvalidate(*this, WIDX_TAB_1);
WidgetInvalidate(*this, WIDX_TAB_2);
@@ -930,11 +932,6 @@ private:
gPickupPeepX = screenCoords.x - 1;
gPickupPeepY = screenCoords.y + 16;
picked_peep_frame++;
if (picked_peep_frame >= 48)
{
picked_peep_frame = 0;
}
const auto peep = GetGuest();
if (peep == nullptr)
@@ -1187,7 +1184,7 @@ private:
// Nausea tolerance
{
static constexpr const StringId _nauseaTolerances[] = {
static constexpr StringId _nauseaTolerances[] = {
STR_PEEP_STAT_NAUSEA_TOLERANCE_NONE,
STR_PEEP_STAT_NAUSEA_TOLERANCE_LOW,
STR_PEEP_STAT_NAUSEA_TOLERANCE_AVERAGE,
@@ -1240,20 +1237,19 @@ private:
if (!(numTicks & 0x7FF))
Invalidate();
uint8_t currListPosition = 0;
const auto oldSize = _riddenRides.size();
_riddenRides.clear();
for (const auto& r : GetRideManager())
{
if (r.IsRide() && guest->HasRidden(r))
{
list_item_positions[currListPosition] = r.id.ToUnderlying();
currListPosition++;
_riddenRides.push_back(r.id);
}
}
// If there are new items
if (no_list_items != currListPosition)
if (oldSize != _riddenRides.size())
{
no_list_items = currListPosition;
Invalidate();
}
}
@@ -1261,7 +1257,7 @@ private:
ScreenSize OnScrollGetSizeRides(int32_t scrollIndex)
{
ScreenSize newSize;
newSize.height = no_list_items * 10;
newSize.height = static_cast<int32_t>(_riddenRides.size()) * 10;
if (selected_list_item != -1)
{
@@ -1285,18 +1281,18 @@ private:
void OnScrollMouseDownRides(int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
{
auto index = screenCoords.y / 10;
if (index >= no_list_items)
if (index >= static_cast<int32_t>(_riddenRides.size()))
return;
auto intent = Intent(WindowClass::Ride);
intent.PutExtra(INTENT_EXTRA_RIDE_ID, list_item_positions[index]);
intent.PutExtra(INTENT_EXTRA_RIDE_ID, _riddenRides[index]);
ContextOpenIntent(&intent);
}
void OnScrollMouseOverRides(int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
{
auto index = screenCoords.y / 10;
if (index >= no_list_items)
if (index >= static_cast<int32_t>(_riddenRides.size()))
return;
if (index == selected_list_item)
@@ -1356,9 +1352,9 @@ private:
auto colour = ColourMapA[colours[1]].mid_light;
GfxFillRect(dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, colour);
for (int32_t listIndex = 0; listIndex < no_list_items; listIndex++)
for (int32_t listIndex = 0; listIndex < static_cast<int32_t>(_riddenRides.size()); listIndex++)
{
auto y = listIndex * 10;
int32_t y = listIndex * 10;
StringId stringId = STR_BLACK_STRING;
if (listIndex == selected_list_item)
{
@@ -1366,8 +1362,7 @@ private:
stringId = STR_WINDOW_COLOUR_2_STRINGID;
}
const auto rId = RideId::FromUnderlying(list_item_positions[listIndex]);
auto* r = GetRide(rId);
auto* r = GetRide(_riddenRides[listIndex]);
if (r != nullptr)
{
auto ft = Formatter();
+9 -5
View File
@@ -28,9 +28,9 @@
#include <openrct2/world/Park.h>
#include <vector>
static constexpr const StringId WINDOW_TITLE = STR_GUESTS;
static constexpr const int32_t WH = 330;
static constexpr const int32_t WW = 350;
static constexpr StringId WINDOW_TITLE = STR_GUESTS;
static constexpr int32_t WH = 330;
static constexpr int32_t WW = 350;
enum WindowGuestListWidgetIdx
{
@@ -126,8 +126,8 @@ private:
char Name[256];
};
static constexpr const uint8_t SUMMARISED_GUEST_ROW_HEIGHT = SCROLLABLE_ROW_HEIGHT + 11;
static constexpr const auto GUESTS_PER_PAGE = 2000;
static constexpr uint8_t SUMMARISED_GUEST_ROW_HEIGHT = SCROLLABLE_ROW_HEIGHT + 11;
static constexpr auto GUESTS_PER_PAGE = 2000;
static constexpr const auto GUEST_PAGE_HEIGHT = GUESTS_PER_PAGE * SCROLLABLE_ROW_HEIGHT;
static constexpr size_t MaxGroups = 240;
@@ -381,6 +381,10 @@ public:
void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override
{
if (dropdownIndex == -1)
{
return;
}
switch (widgetIndex)
{
case WIDX_PAGE_DROPDOWN_BUTTON:
+9 -6
View File
@@ -19,7 +19,6 @@
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/object/ObjectManager.h>
#include <openrct2/platform/Platform.h>
#include <openrct2/ride/RideConstruction.h>
#include <openrct2/ride/RideData.h>
#include <openrct2/ride/TrackDesign.h>
@@ -41,9 +40,9 @@ enum {
WIDX_CANCEL
};
static constexpr const StringId WINDOW_TITLE = STR_TRACK_DESIGN_INSTALL_WINDOW_TITLE;
static constexpr const int32_t WW = 380;
static constexpr const int32_t WH = 460;
static constexpr StringId WINDOW_TITLE = STR_TRACK_DESIGN_INSTALL_WINDOW_TITLE;
static constexpr int32_t WW = 380;
static constexpr int32_t WH = 460;
constexpr int32_t PREVIEW_BUTTONS_LEFT = WW - 25;
constexpr int32_t ACTION_BUTTONS_LEFT = WW - 100;
@@ -82,7 +81,6 @@ public:
void OnOpen() override
{
widgets = window_install_track_widgets;
track_list.track_list_being_updated = false;
WindowInitScrollWidgets(*this);
WindowPushOthersRight(*this);
@@ -360,6 +358,11 @@ public:
}
}
void OnResize() override
{
ResizeFrame();
}
private:
void UpdatePreview()
{
@@ -370,7 +373,7 @@ private:
{
auto env = OpenRCT2::GetContext()->GetPlatformEnvironment();
auto destPath = env->GetDirectoryPath(OpenRCT2::DIRBASE::USER, OpenRCT2::DIRID::TRACK);
if (!Platform::EnsureDirectoryExists(destPath.c_str()))
if (!Path::CreateDirectory(destPath))
{
LOG_ERROR("Unable to create directory '%s'", destPath.c_str());
ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {});
+8 -3
View File
@@ -21,9 +21,9 @@
using namespace OpenRCT2;
static constexpr const StringId WINDOW_TITLE = STR_LAND;
static constexpr const int32_t WH = 160;
static constexpr const int32_t WW = 98;
static constexpr StringId WINDOW_TITLE = STR_LAND;
static constexpr int32_t WH = 160;
static constexpr int32_t WW = 98;
// clang-format off
enum WindowLandWidgetIdx {
@@ -307,6 +307,11 @@ public:
}
}
void OnResize() override
{
ResizeFrame();
}
private:
void DrawDropdownButtons(DrawPixelInfo& dpi)
{
+8 -3
View File
@@ -22,9 +22,9 @@
#include <openrct2/localisation/Localisation.h>
#include <openrct2/world/Park.h>
static constexpr const StringId WINDOW_TITLE = STR_LAND_RIGHTS;
static constexpr const int32_t WH = 94;
static constexpr const int32_t WW = 98;
static constexpr StringId WINDOW_TITLE = STR_LAND_RIGHTS;
static constexpr int32_t WH = 94;
static constexpr int32_t WW = 98;
// clang-format off
enum WindowLandRightsWidgetIdx {
@@ -377,6 +377,11 @@ public:
}
}
void OnResize() override
{
ResizeFrame();
}
private:
uint8_t _landRightsMode;
money64 _landRightsCost;
+61 -69
View File
@@ -41,9 +41,9 @@
#pragma region Widgets
static constexpr const StringId WINDOW_TITLE = STR_NONE;
static constexpr const int32_t WW = 350;
static constexpr const int32_t WH = 400;
static constexpr StringId WINDOW_TITLE = STR_NONE;
static constexpr int32_t WW = 350;
static constexpr int32_t WH = 400;
static constexpr uint16_t DATE_TIME_GAP = 2;
@@ -82,7 +82,7 @@ static Widget window_loadsave_widgets[] =
#pragma endregion
static WindowBase* WindowOverwritePromptOpen(const char* name, const char* path);
static WindowBase* WindowOverwritePromptOpen(const std::string_view name, const std::string_view path);
enum
{
@@ -221,7 +221,7 @@ static const char* GetFilterPatternByType(const int32_t type, const bool isSave)
return "*.bmp;*.png";
default:
openrct2_assert(true, "Unsupported load/save directory type.");
Guard::Fail("Unsupported load/save directory type.");
}
return "";
@@ -882,7 +882,7 @@ public:
case WIDX_NEW_FOLDER:
{
const u8string path = Path::Combine(_directory, text);
if (!Platform::EnsureDirectoryExists(path))
if (!Path::CreateDirectory(path))
{
ContextShowError(STR_UNABLE_TO_CREATE_FOLDER, STR_NONE, {});
return;
@@ -905,7 +905,7 @@ public:
Path::Combine(_directory, text), RemovePatternWildcard(_extensionPattern));
if (File::Exists(path))
WindowOverwritePromptOpen(std::string(text).c_str(), path.c_str());
WindowOverwritePromptOpen(text, path);
else
Select(path.c_str());
break;
@@ -961,7 +961,7 @@ public:
// TYPE_FILE
// Load or overwrite
if ((_type & 0x01) == LOADSAVETYPE_SAVE)
WindowOverwritePromptOpen(_listItems[selectedItem].name.c_str(), _listItems[selectedItem].path.c_str());
WindowOverwritePromptOpen(_listItems[selectedItem].name, _listItems[selectedItem].path);
else
Select(_listItems[selectedItem].path.c_str());
}
@@ -1077,12 +1077,12 @@ WindowBase* WindowLoadsaveOpen(
break;
case LOADSAVETYPE_HEIGHTMAP:
openrct2_assert(!isSave, "Cannot save images through loadsave window");
Guard::Assert(!isSave, "Cannot save images through loadsave window");
w->widgets[WIDX_TITLE].text = STR_FILE_DIALOG_TITLE_LOAD_HEIGHTMAP;
break;
default:
openrct2_assert(true, "Unsupported load/save type: %d", type & 0x0F);
Guard::Fail("Unsupported load/save type: %d", type & 0x0F);
break;
}
@@ -1111,69 +1111,61 @@ static Widget window_overwrite_prompt_widgets[] = {
WIDGETS_END,
};
static void WindowOverwritePromptMouseup(WindowBase* w, WidgetIndex widgetIndex);
static void WindowOverwritePromptPaint(WindowBase* w, DrawPixelInfo& dpi);
static WindowEventList window_overwrite_prompt_events([](auto& events) {
events.mouse_up = &WindowOverwritePromptMouseup;
events.paint = &WindowOverwritePromptPaint;
});
static char _window_overwrite_prompt_name[256];
static char _window_overwrite_prompt_path[MAX_PATH];
static WindowBase* WindowOverwritePromptOpen(const char* name, const char* path)
class OverwritePromptWindow final : public Window
{
WindowBase* w;
std::string _name;
std::string _path;
public:
OverwritePromptWindow(const std::string_view name, const std::string_view path)
: _name(name)
, _path(path)
{
widgets = window_overwrite_prompt_widgets;
colours[0] = TRANSLUCENT(COLOUR_BORDEAUX_RED);
}
void OnMouseUp(WidgetIndex widgetIndex) override
{
switch (widgetIndex)
{
case WIDX_OVERWRITE_OVERWRITE:
{
Select(_path.c_str());
// As the LoadSaveWindow::Select function can change the order of the
// windows we can't use WindowClose(w).
WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt);
break;
}
case WIDX_OVERWRITE_CANCEL:
case WIDX_OVERWRITE_CLOSE:
Close();
break;
}
}
void OnDraw(DrawPixelInfo& dpi) override
{
DrawWidgets(dpi);
auto ft = Formatter();
ft.Add<StringId>(STR_STRING);
ft.Add<char*>(_name.c_str());
ScreenCoordsXY stringCoords(windowPos.x + width / 2, windowPos.y + (height / 2) - 3);
DrawTextWrapped(dpi, stringCoords, width - 4, STR_FILEBROWSER_OVERWRITE_PROMPT, ft, { TextAlignment::CENTRE });
}
};
static WindowBase* WindowOverwritePromptOpen(const std::string_view name, const std::string_view path)
{
WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt);
w = WindowCreateCentred(
OVERWRITE_WW, OVERWRITE_WH, &window_overwrite_prompt_events, WindowClass::LoadsaveOverwritePrompt, WF_STICK_TO_FRONT);
w->widgets = window_overwrite_prompt_widgets;
WindowInitScrollWidgets(*w);
w->flags |= WF_TRANSPARENT;
w->colours[0] = TRANSLUCENT(COLOUR_BORDEAUX_RED);
SafeStrCpy(_window_overwrite_prompt_name, name, sizeof(_window_overwrite_prompt_name));
SafeStrCpy(_window_overwrite_prompt_path, path, sizeof(_window_overwrite_prompt_path));
return w;
}
static void WindowOverwritePromptMouseup(WindowBase* w, WidgetIndex widgetIndex)
{
switch (widgetIndex)
{
case WIDX_OVERWRITE_OVERWRITE:
{
Select(_window_overwrite_prompt_path);
// As the LoadSaveWindow::Select function can change the order of the
// windows we can't use WindowClose(w).
WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt);
break;
}
case WIDX_OVERWRITE_CANCEL:
case WIDX_OVERWRITE_CLOSE:
WindowClose(*w);
break;
}
}
static void WindowOverwritePromptPaint(WindowBase* w, DrawPixelInfo& dpi)
{
WindowDrawWidgets(*w, dpi);
auto ft = Formatter();
ft.Add<StringId>(STR_STRING);
ft.Add<char*>(_window_overwrite_prompt_name);
ScreenCoordsXY stringCoords(w->windowPos.x + w->width / 2, w->windowPos.y + (w->height / 2) - 3);
DrawTextWrapped(dpi, stringCoords, w->width - 4, STR_FILEBROWSER_OVERWRITE_PROMPT, ft, { TextAlignment::CENTRE });
return WindowCreate<OverwritePromptWindow>(
WindowClass::LoadsaveOverwritePrompt, OVERWRITE_WW, OVERWRITE_WH, WF_TRANSPARENT | WF_STICK_TO_FRONT | WF_CENTRE_SCREEN,
name, path);
}
#pragma endregion
+13 -13
View File
@@ -53,9 +53,9 @@ static constexpr uint16_t MapColourUnowned(uint16_t colour)
constexpr int32_t MAP_WINDOW_MAP_SIZE = MAXIMUM_MAP_SIZE_TECHNICAL * 2;
static constexpr const StringId WINDOW_TITLE = STR_MAP_LABEL;
static constexpr const int32_t WH = 259;
static constexpr const int32_t WW = 245;
static constexpr StringId WINDOW_TITLE = STR_MAP_LABEL;
static constexpr int32_t WH = 259;
static constexpr int32_t WW = 245;
// Some functions manipulate coordinates on the map. These are the coordinates of the pixels in the
// minimap. In order to distinguish those from actual coordinates, we use a separate name.
@@ -126,7 +126,7 @@ static Widget window_map_widgets[] = {
// used in transforming viewport view coordinates to minimap coordinates
// rct2: 0x00981BBC
static constexpr const ScreenCoordsXY MiniMapOffsets[] = {
static constexpr ScreenCoordsXY MiniMapOffsets[] = {
{ MAXIMUM_MAP_SIZE_TECHNICAL - 8, 0 },
{ 2 * MAXIMUM_MAP_SIZE_TECHNICAL - 8, MAXIMUM_MAP_SIZE_TECHNICAL },
{ MAXIMUM_MAP_SIZE_TECHNICAL - 8, 2 * MAXIMUM_MAP_SIZE_TECHNICAL },
@@ -1405,7 +1405,7 @@ private:
Y,
} _resizeDirection{ ResizeDirection::Both };
static constexpr const uint16_t RideKeyColours[] = {
static constexpr uint16_t RideKeyColours[] = {
MapColour(PALETTE_INDEX_61), // COLOUR_KEY_RIDE
MapColour(PALETTE_INDEX_42), // COLOUR_KEY_FOOD
MapColour(PALETTE_INDEX_20), // COLOUR_KEY_DRINK
@@ -1416,15 +1416,15 @@ private:
MapColour(PALETTE_INDEX_161), // COLOUR_KEY_TOILETS
};
static constexpr const uint8_t DefaultPeepMapColour = PALETTE_INDEX_20;
static constexpr const uint8_t GuestMapColour = PALETTE_INDEX_172;
static constexpr const uint8_t GuestMapColourAlternate = PALETTE_INDEX_21;
static constexpr const uint8_t StaffMapColour = PALETTE_INDEX_138;
static constexpr const uint8_t StaffMapColourAlternate = PALETTE_INDEX_10;
static constexpr uint8_t DefaultPeepMapColour = PALETTE_INDEX_20;
static constexpr uint8_t GuestMapColour = PALETTE_INDEX_172;
static constexpr uint8_t GuestMapColourAlternate = PALETTE_INDEX_21;
static constexpr uint8_t StaffMapColour = PALETTE_INDEX_138;
static constexpr uint8_t StaffMapColourAlternate = PALETTE_INDEX_10;
static constexpr const uint16_t WaterColour = MapColour(PALETTE_INDEX_195);
static constexpr uint16_t WaterColour = MapColour(PALETTE_INDEX_195);
static constexpr const uint16_t ElementTypeMaskColour[] = {
static constexpr uint16_t ElementTypeMaskColour[] = {
0xFFFF, // TILE_ELEMENT_TYPE_SURFACE
0x0000, // TILE_ELEMENT_TYPE_PATH
0x00FF, // TILE_ELEMENT_TYPE_TRACK
@@ -1435,7 +1435,7 @@ private:
0xFFFF, // TILE_ELEMENT_TYPE_BANNER
};
static constexpr const uint16_t ElementTypeAddColour[] = {
static constexpr uint16_t ElementTypeAddColour[] = {
MapColour(PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_SURFACE
MapColour(PALETTE_INDEX_17), // TILE_ELEMENT_TYPE_PATH
MapColour2(PALETTE_INDEX_183, PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_TRACK
+11 -6
View File
@@ -119,9 +119,9 @@ enum
#pragma region Widgets
static constexpr const StringId WINDOW_TITLE = STR_MAPGEN_WINDOW_TITLE;
static constexpr const int32_t WW = 250;
static constexpr const int32_t WH = 273;
static constexpr StringId WINDOW_TITLE = STR_MAPGEN_WINDOW_TITLE;
static constexpr int32_t WW = 250;
static constexpr int32_t WH = 273;
// clang-format off
#define SHARED_WIDGETS \
@@ -269,19 +269,19 @@ static uint64_t PressedWidgets[WINDOW_MAPGEN_PAGE_COUNT] = {
#pragma endregion
static constexpr const int32_t TabAnimationDivisor[WINDOW_MAPGEN_PAGE_COUNT] = {
static constexpr int32_t TabAnimationDivisor[WINDOW_MAPGEN_PAGE_COUNT] = {
1,
1,
1,
1,
};
static constexpr const int32_t TabAnimationFrames[WINDOW_MAPGEN_PAGE_COUNT] = {
static constexpr int32_t TabAnimationFrames[WINDOW_MAPGEN_PAGE_COUNT] = {
1,
1,
1,
1,
};
static constexpr const int32_t TabAnimationLoops[WINDOW_MAPGEN_PAGE_COUNT] = {
static constexpr int32_t TabAnimationLoops[WINDOW_MAPGEN_PAGE_COUNT] = {
16,
16,
16,
@@ -1371,6 +1371,11 @@ public:
HeightmapGenerateMap();
}
}
void OnResize() override
{
ResizeFrameWithPage();
}
};
WindowBase* WindowMapgenOpen()
+6 -8
View File
@@ -28,9 +28,9 @@
#pragma region Widgets
static constexpr const StringId WINDOW_TITLE = STR_RIDE_CONSTRUCTION_WINDOW_TITLE;
static constexpr const int32_t WH = 200;
static constexpr const int32_t WW = 166;
static constexpr StringId WINDOW_TITLE = STR_RIDE_CONSTRUCTION_WINDOW_TITLE;
static constexpr int32_t WH = 200;
static constexpr int32_t WW = 166;
// clang-format off
enum {
@@ -107,7 +107,7 @@ public:
void OnClose() override
{
RideConstructionInvalidateCurrentTrack();
ViewportSetVisibility(0);
ViewportSetVisibility(ViewportVisibility::Default);
MapInvalidateMapSelectionTiles();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
@@ -124,12 +124,9 @@ public:
{
if (currentRide->overall_view.IsNull())
{
int32_t savedPausedState = gGamePaused;
gGamePaused = 0;
auto gameAction = RideDemolishAction(currentRide->id, RIDE_MODIFY_DEMOLISH);
gameAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED);
GameActions::Execute(&gameAction);
gGamePaused = savedPausedState;
}
else
{
@@ -162,6 +159,7 @@ public:
void OnResize() override
{
ResizeFrameWithPage();
uint64_t disabledWidgets = 0;
if (_rideConstructionState == RideConstructionState::Place)
{
@@ -366,7 +364,7 @@ private:
if (currentRide != nullptr && RideAreAllPossibleEntrancesAndExitsBuilt(*currentRide).Successful)
{
ToolCancel();
if (currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK))
if (!currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
WindowCloseByClass(WindowClass::RideConstruction);
}
else
+3 -5
View File
@@ -120,13 +120,13 @@ static constexpr StringId WindowMultiplayerPageTitles[] = {
// clang-format on
static constexpr const int32_t window_multiplayer_animation_divisor[] = {
static constexpr int32_t window_multiplayer_animation_divisor[] = {
4,
4,
2,
2,
};
static constexpr const int32_t window_multiplayer_animation_frames[] = {
static constexpr int32_t window_multiplayer_animation_frames[] = {
8,
8,
7,
@@ -213,7 +213,7 @@ void MultiplayerWindow::SetPage(int32_t page_number)
widgets[WIDX_TITLE].text = WindowMultiplayerPageTitles[page];
WindowEventResizeCall(this);
WindowEventInvalidateCall(this);
WindowEventOnPrepareDrawCall(this);
InitScrollWidgets();
Invalidate();
}
@@ -347,7 +347,6 @@ void MultiplayerWindow::OnResize()
WindowSetResize(*this, 420, 124, 500, 450);
no_list_items = (IsServerPlayerInvisible() ? NetworkGetNumVisiblePlayers() : NetworkGetNumPlayers());
list_item_positions[0] = 0;
widgets[WIDX_HEADER_PING].right = width - 5;
@@ -360,7 +359,6 @@ void MultiplayerWindow::OnResize()
WindowSetResize(*this, 320, 200, 320, 500);
no_list_items = NetworkGetNumActions();
list_item_positions[0] = 0;
selected_list_item = -1;
Invalidate();
@@ -38,8 +38,6 @@ public:
widgets = window_network_status_widgets;
WindowInitScrollWidgets(*this);
no_list_items = 0;
selected_list_item = -1;
frame_no = 0;
min_width = 320;
min_height = 90;
+44 -24
View File
@@ -23,9 +23,9 @@
using namespace OpenRCT2;
static constexpr const StringId WINDOW_TITLE = STR_NONE;
static constexpr const int32_t WH = 109;
static constexpr const int32_t WW = 350;
static constexpr StringId WINDOW_TITLE = STR_NONE;
static constexpr int32_t WH = 109;
static constexpr int32_t WW = 350;
constexpr uint16_t SELECTED_ITEM_UNDEFINED = 0xFFFF;
@@ -61,6 +61,16 @@ class NewCampaignWindow final : public Window
private:
std::vector<RideId> RideList;
std::vector<ShopItem> ShopItems;
struct CampaignVariables
{
int16_t campaign_type;
int16_t no_weeks; // 0x482
union
{
::RideId RideId;
ObjectEntryIndex ShopItemId;
};
} Campaign;
static bool RideValueCompare(const RideId& a, const RideId& b)
{
@@ -164,13 +174,13 @@ public:
widgets[WIDX_TITLE].text = MarketingCampaignNames[campaignType][0];
// Campaign type
campaign.campaign_type = campaignType;
Campaign.campaign_type = campaignType;
// Number of weeks
campaign.no_weeks = 2;
Campaign.no_weeks = 2;
// Currently selected ride
campaign.RideId = RideId::GetNull();
Campaign.RideId = RideId::GetNull();
RefreshRides();
}
@@ -185,7 +195,7 @@ public:
case WIDX_RIDE_DROPDOWN_BUTTON:
dropdownWidget = widget - 1;
if (campaign.campaign_type == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE)
if (Campaign.campaign_type == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE)
{
GetShopItems();
if (!ShopItems.empty())
@@ -236,11 +246,11 @@ public:
break;
// In RCT2, the maximum was 6 weeks
case WIDX_WEEKS_INCREASE_BUTTON:
campaign.no_weeks = std::min(campaign.no_weeks + 1, 12);
Campaign.no_weeks = std::min(Campaign.no_weeks + 1, 12);
Invalidate();
break;
case WIDX_WEEKS_DECREASE_BUTTON:
campaign.no_weeks = std::max(campaign.no_weeks - 1, 2);
Campaign.no_weeks = std::max(Campaign.no_weeks - 1, 2);
Invalidate();
break;
}
@@ -256,7 +266,7 @@ public:
case WIDX_START_BUTTON:
{
auto gameAction = ParkMarketingAction(
campaign.campaign_type, campaign.RideId.ToUnderlying(), campaign.no_weeks);
Campaign.campaign_type, Campaign.RideId.ToUnderlying(), Campaign.no_weeks);
gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) {
if (result->Error == GameActions::Status::Ok)
{
@@ -277,19 +287,19 @@ public:
if (dropdownIndex < 0)
return;
if (campaign.campaign_type == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE)
if (Campaign.campaign_type == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE)
{
if (static_cast<size_t>(dropdownIndex) >= ShopItems.size())
return;
campaign.ShopItemId = EnumValue(ShopItems[dropdownIndex]);
Campaign.ShopItemId = EnumValue(ShopItems[dropdownIndex]);
}
else
{
if (static_cast<size_t>(dropdownIndex) >= RideList.size())
return;
campaign.RideId = RideList[dropdownIndex];
Campaign.RideId = RideList[dropdownIndex];
}
Invalidate();
@@ -301,7 +311,7 @@ public:
widgets[WIDX_RIDE_DROPDOWN].type = WindowWidgetType::Empty;
widgets[WIDX_RIDE_DROPDOWN_BUTTON].type = WindowWidgetType::Empty;
widgets[WIDX_RIDE_DROPDOWN].text = STR_MARKETING_NOT_SELECTED;
switch (campaign.campaign_type)
switch (Campaign.campaign_type)
{
case ADVERTISING_CAMPAIGN_RIDE_FREE:
case ADVERTISING_CAMPAIGN_RIDE:
@@ -309,9 +319,9 @@ public:
widgets[WIDX_RIDE_DROPDOWN].type = WindowWidgetType::DropdownMenu;
widgets[WIDX_RIDE_DROPDOWN_BUTTON].type = WindowWidgetType::Button;
widgets[WIDX_RIDE_LABEL].text = STR_MARKETING_RIDE;
if (campaign.RideId != RideId::GetNull())
if (Campaign.RideId != RideId::GetNull())
{
auto curRide = GetRide(campaign.RideId);
auto curRide = GetRide(Campaign.RideId);
if (curRide != nullptr)
{
widgets[WIDX_RIDE_DROPDOWN].text = STR_STRINGID;
@@ -326,9 +336,9 @@ public:
widgets[WIDX_RIDE_DROPDOWN].type = WindowWidgetType::DropdownMenu;
widgets[WIDX_RIDE_DROPDOWN_BUTTON].type = WindowWidgetType::Button;
widgets[WIDX_RIDE_LABEL].text = STR_MARKETING_ITEM;
if (campaign.ShopItemId != SELECTED_ITEM_UNDEFINED)
if (Campaign.ShopItemId != SELECTED_ITEM_UNDEFINED)
{
widgets[WIDX_RIDE_DROPDOWN].text = GetShopItemDescriptor(ShopItem(campaign.ShopItemId)).Naming.Plural;
widgets[WIDX_RIDE_DROPDOWN].text = GetShopItemDescriptor(ShopItem(Campaign.ShopItemId)).Naming.Plural;
}
break;
}
@@ -338,7 +348,7 @@ public:
// Enable / disable start button based on ride dropdown
WidgetSetDisabled(*this, WIDX_START_BUTTON, false);
if (widgets[WIDX_RIDE_DROPDOWN].type == WindowWidgetType::DropdownMenu && campaign.RideId == RideId::GetNull())
if (widgets[WIDX_RIDE_DROPDOWN].type == WindowWidgetType::DropdownMenu && Campaign.RideId == RideId::GetNull())
WidgetSetDisabled(*this, WIDX_START_BUTTON, true);
}
@@ -351,24 +361,34 @@ public:
// Number of weeks
Widget* spinnerWidget = &widgets[WIDX_WEEKS_SPINNER];
auto ft = Formatter();
ft.Add<int16_t>(campaign.no_weeks);
ft.Add<int16_t>(Campaign.no_weeks);
DrawTextBasic(
dpi, windowPos + ScreenCoordsXY{ spinnerWidget->left + 1, spinnerWidget->top },
campaign.no_weeks == 1 ? STR_MARKETING_1_WEEK : STR_X_WEEKS, ft, { colours[0] });
Campaign.no_weeks == 1 ? STR_MARKETING_1_WEEK : STR_X_WEEKS, ft, { colours[0] });
screenCoords = windowPos + ScreenCoordsXY{ 14, 60 };
// Price per week
ft = Formatter();
ft.Add<money64>(AdvertisingCampaignPricePerWeek[campaign.campaign_type]);
ft.Add<money64>(AdvertisingCampaignPricePerWeek[Campaign.campaign_type]);
DrawTextBasic(dpi, screenCoords, STR_MARKETING_COST_PER_WEEK, ft);
screenCoords.y += 13;
// Total price
ft = Formatter();
ft.Add<money64>(AdvertisingCampaignPricePerWeek[campaign.campaign_type] * campaign.no_weeks);
ft.Add<money64>(AdvertisingCampaignPricePerWeek[Campaign.campaign_type] * Campaign.no_weeks);
DrawTextBasic(dpi, screenCoords, STR_MARKETING_TOTAL_COST, ft);
}
void OnResize() override
{
ResizeFrame();
}
int16_t GetCampaignType() const
{
return Campaign.campaign_type;
}
};
WindowBase* WindowNewCampaignOpen(int16_t campaignType)
@@ -376,7 +396,7 @@ WindowBase* WindowNewCampaignOpen(int16_t campaignType)
auto w = static_cast<NewCampaignWindow*>(WindowBringToFrontByClass(WindowClass::NewCampaign));
if (w != nullptr)
{
if (w->campaign.campaign_type == campaignType)
if (w->GetCampaignType() == campaignType)
return w;
WindowClose(*w);
+33 -27
View File
@@ -40,12 +40,12 @@
using namespace OpenRCT2::TrackMetaData;
static constexpr const StringId WindowTitle = STR_NONE;
static constexpr const int32_t WindowHeight = 382;
static constexpr const int32_t WindowWidth = 601;
static constexpr const int32_t RideListItemsMax = 384;
static constexpr const int32_t RideTabCount = 6;
static constexpr const int32_t GroupByTrackTypeWidth = 172;
static constexpr StringId WindowTitle = STR_NONE;
static constexpr int32_t WindowHeight = 382;
static constexpr int32_t WindowWidth = 601;
static constexpr int32_t RideListItemsMax = 384;
static constexpr int32_t RideTabCount = 6;
static constexpr int32_t GroupByTrackTypeWidth = 172;
#pragma region Ride type view order
@@ -53,7 +53,7 @@ static constexpr const int32_t GroupByTrackTypeWidth = 172;
* The order of ride types shown in the new ride window so that the order stays consistent across games and rides of the same
* type are kept together.
*/
static constexpr const ride_type_t RideTypeViewOrder[] = {
static constexpr ride_type_t RideTypeViewOrder[] = {
// Transport rides
RIDE_TYPE_MINIATURE_RAILWAY,
RIDE_TYPE_MONORAIL,
@@ -199,8 +199,8 @@ enum
WIDX_GROUP_BY_TRACK_TYPE,
};
static constexpr const ScreenCoordsXY GroupByTrackTypeOrigin{ WindowWidth - 8 - GroupByTrackTypeWidth, 47 };
static constexpr const ScreenSize GroupTrackTypeSize{ GroupByTrackTypeWidth, 14 };
static constexpr ScreenCoordsXY GroupByTrackTypeOrigin{ WindowWidth - 8 - GroupByTrackTypeWidth, 47 };
static constexpr ScreenSize GroupTrackTypeSize{ GroupByTrackTypeWidth, 14 };
// clang-format off
static Widget window_new_ride_widgets[] = {
@@ -227,7 +227,7 @@ static Widget window_new_ride_widgets[] = {
#pragma endregion
static constexpr const StringId RideTitles[] = {
static constexpr StringId RideTitles[] = {
STR_NEW_TRANSPORT_RIDES, // TRANSPORT_TAB
STR_NEW_GENTLE_RIDES, // GENTLE_TAB
STR_NEW_ROLLER_COASTERS, // ROLLER_COASTER_TAB
@@ -238,7 +238,7 @@ static constexpr const StringId RideTitles[] = {
};
static_assert(std::size(RideTitles) == TAB_COUNT);
static constexpr const int32_t TabAnimationLoops[] = {
static constexpr int32_t TabAnimationLoops[] = {
20, // TRANSPORT_TAB
32, // GENTLE_TAB
10, // ROLLER_COASTER_TAB
@@ -249,7 +249,7 @@ static constexpr const int32_t TabAnimationLoops[] = {
};
static_assert(std::size(TabAnimationLoops) == TAB_COUNT);
static constexpr const int32_t TabAnimationDivisor[] = {
static constexpr int32_t TabAnimationDivisor[] = {
4, // TRANSPORT_TAB
8, // GENTLE_TAB
2, // ROLLER_COASTER_TAB
@@ -260,7 +260,7 @@ static constexpr const int32_t TabAnimationDivisor[] = {
};
static_assert(std::size(TabAnimationDivisor) == TAB_COUNT);
static constexpr const int32_t ThrillRidesTabAnimationSequence[] = {
static constexpr int32_t ThrillRidesTabAnimationSequence[] = {
5, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 0, 0, 0,
};
@@ -274,6 +274,12 @@ private:
RideSelection _lastTrackDesignCountRideType{};
int32_t _lastTrackDesignCount{};
RideSelection _windowNewRideListItems[RideListItemsMax]{};
struct NewRideVariables
{
RideSelection SelectedRide;
RideSelection HighlightedRide;
uint16_t SelectedRideCountdown;
} _newRideVars{};
public:
static void SetOpeningPage(NewRideTabId tab)
@@ -294,7 +300,7 @@ public:
_filter.clear();
frame_no = 0;
new_ride.SelectedRide = { RIDE_TYPE_NULL, OBJECT_ENTRY_INDEX_NULL };
_newRideVars.SelectedRide = { RIDE_TYPE_NULL, OBJECT_ENTRY_INDEX_NULL };
_lastTrackDesignCountRideType.Type = RIDE_TYPE_NULL;
_lastTrackDesignCountRideType.EntryIndex = OBJECT_ENTRY_INDEX_NULL;
@@ -322,7 +328,7 @@ public:
WidgetInvalidate(*this, WIDX_FILTER_TEXT_BOX);
}
if (new_ride.SelectedRide.Type != RIDE_TYPE_NULL && new_ride.selected_ride_countdown-- == 0)
if (_newRideVars.SelectedRide.Type != RIDE_TYPE_NULL && _newRideVars.SelectedRideCountdown-- == 0)
{
RideSelect();
}
@@ -336,7 +342,7 @@ public:
// Remove highlight when mouse leaves rides list
if (!WidgetIsHighlighted(*this, WIDX_RIDE_LIST))
{
new_ride.HighlightedRide = { RIDE_TYPE_NULL, OBJECT_ENTRY_INDEX_NULL };
_newRideVars.HighlightedRide = { RIDE_TYPE_NULL, OBJECT_ENTRY_INDEX_NULL };
WidgetInvalidate(*this, WIDX_RIDE_LIST);
}
}
@@ -414,7 +420,7 @@ public:
if (_currentTab != RESEARCH_TAB)
{
RideSelection item = new_ride.HighlightedRide;
RideSelection item = _newRideVars.HighlightedRide;
if (item.Type != RIDE_TYPE_NULL || item.EntryIndex != OBJECT_ENTRY_INDEX_NULL)
DrawRideInformation(dpi, item, windowPos + ScreenCoordsXY{ 3, height - 64 }, width - 6);
}
@@ -440,12 +446,12 @@ public:
void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
RideSelection item = ScrollGetRideListItemAt(screenCoords);
if (new_ride.HighlightedRide == item)
if (_newRideVars.HighlightedRide == item)
{
return;
}
new_ride.HighlightedRide = item;
_newRideVars.HighlightedRide = item;
Invalidate();
}
@@ -457,10 +463,10 @@ public:
return;
}
new_ride.SelectedRide = item;
_newRideVars.SelectedRide = item;
OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, windowPos.x + (width / 2));
new_ride.selected_ride_countdown = 8;
_newRideVars.SelectedRideCountdown = 8;
Invalidate();
}
@@ -479,9 +485,9 @@ public:
{
// Draw flat button rectangle
int32_t buttonFlags = 0;
if (new_ride.SelectedRide == *listItem)
if (_newRideVars.SelectedRide == *listItem)
buttonFlags |= INSET_RECT_FLAG_BORDER_INSET;
if (new_ride.HighlightedRide == *listItem || buttonFlags != 0)
if (_newRideVars.HighlightedRide == *listItem || buttonFlags != 0)
GfxFillRectInset(
dpi, { coords, coords + ScreenCoordsXY{ 115, 115 } }, colours[1],
INSET_RECT_FLAG_FILL_MID_LIGHT | buttonFlags);
@@ -530,8 +536,8 @@ public:
{
_currentTab = tab;
frame_no = 0;
new_ride.HighlightedRide = { RIDE_TYPE_NULL, OBJECT_ENTRY_INDEX_NULL };
new_ride.selected_ride_countdown = std::numeric_limits<uint16_t>::max();
_newRideVars.HighlightedRide = { RIDE_TYPE_NULL, OBJECT_ENTRY_INDEX_NULL };
_newRideVars.SelectedRideCountdown = std::numeric_limits<uint16_t>::max();
PopulateRideList();
RefreshWidgetSizing();
Invalidate();
@@ -545,7 +551,7 @@ public:
private:
void RideSelect()
{
RideSelection item = new_ride.SelectedRide;
RideSelection item = _newRideVars.SelectedRide;
if (item.Type == RIDE_TYPE_NULL)
{
return;
@@ -957,7 +963,7 @@ private:
//
StringId stringId = STR_NEW_RIDE_COST;
if (!GetRideTypeDescriptor(item.Type).HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK))
if (GetRideTypeDescriptor(item.Type).HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
stringId = STR_NEW_RIDE_COST_FROM;
ft = Formatter();
+8 -3
View File
@@ -21,9 +21,9 @@
#include <openrct2/management/NewsItem.h>
#include <openrct2/sprites.h>
static constexpr const StringId WINDOW_TITLE = STR_RECENT_MESSAGES;
static constexpr const int32_t WH = 300;
static constexpr const int32_t WW = 400;
static constexpr StringId WINDOW_TITLE = STR_RECENT_MESSAGES;
static constexpr int32_t WH = 300;
static constexpr int32_t WW = 400;
// clang-format off
enum WindowNewsWidgetIdx {
@@ -306,6 +306,11 @@ public:
i++;
}
}
void OnResize() override
{
ResizeFrame();
}
};
WindowBase* WindowNewsOpen()
+9 -4
View File
@@ -14,9 +14,9 @@
#include <openrct2/drawing/Drawing.h>
#include <openrct2/sprites.h>
static constexpr const StringId WINDOW_TITLE = STR_NOTIFICATION_SETTINGS;
static constexpr const int32_t WH = 300;
static constexpr const int32_t WW = 400;
static constexpr StringId WINDOW_TITLE = STR_NOTIFICATION_SETTINGS;
static constexpr int32_t WH = 300;
static constexpr int32_t WW = 400;
// clang-format off
enum
@@ -34,7 +34,7 @@ struct NotificationDef
size_t config_offset;
};
static constexpr const NotificationDef NewsItemOptionDefinitions[] = {
static constexpr NotificationDef NewsItemOptionDefinitions[] = {
{ NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_AWARD, offsetof(NotificationConfiguration, ParkAward) },
{ NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_MARKETING_CAMPAIGN_FINISHED, offsetof(NotificationConfiguration, ParkMarketingCampaignFinished) },
{ NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_WARNINGS, offsetof(NotificationConfiguration, ParkWarnings) },
@@ -259,6 +259,11 @@ private:
return configValue;
}
void OnResize() override
{
ResizeFrameWithPage();
}
static constexpr int32_t TabAnimationDivisor[3] = {
1, // Park
4, // Ride
+10 -5
View File
@@ -266,10 +266,10 @@ enum WindowObjectLoadErrorWidgetIdx {
WIDX_DOWNLOAD_ALL
};
static constexpr const StringId WINDOW_TITLE = STR_OBJECT_LOAD_ERROR_TITLE;
static constexpr const int32_t WW = 450;
static constexpr const int32_t WH = 400;
static constexpr const int32_t WW_LESS_PADDING = WW - 5;
static constexpr StringId WINDOW_TITLE = STR_OBJECT_LOAD_ERROR_TITLE;
static constexpr int32_t WW = 450;
static constexpr int32_t WH = 400;
static constexpr int32_t WW_LESS_PADDING = WW - 5;
constexpr int32_t NAME_COL_LEFT = 4;
constexpr int32_t SOURCE_COL_LEFT = (WW_LESS_PADDING / 4) + 1;
constexpr int32_t TYPE_COL_LEFT = 5 * WW_LESS_PADDING / 8 + 1;
@@ -311,7 +311,7 @@ static constexpr StringId GetStringFromObjectType(const ObjectType type)
return STR_OBJECT_SELECTION_PATH_SIGNS;
case ObjectType::Paths:
return STR_OBJECT_SELECTION_FOOTPATHS;
case ObjectType::PathBits:
case ObjectType::PathAdditions:
return STR_OBJECT_SELECTION_PATH_EXTRAS;
case ObjectType::SceneryGroup:
return STR_OBJECT_SELECTION_SCENERY_GROUPS;
@@ -551,6 +551,11 @@ public:
}
}
void OnResize() override
{
ResizeFrame();
}
void Initialise(utf8* path, const size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects)
{
_invalidEntries = std::vector<ObjectEntryDescriptor>(missingObjects, missingObjects + numMissingObjects);
+64 -54
View File
@@ -159,6 +159,7 @@ enum WindowOptionsWidgetIdx {
WIDX_TRAP_CURSOR,
WIDX_INVERT_DRAG,
WIDX_ZOOM_TO_CURSOR,
WIDX_WINDOW_BUTTONS_ON_THE_LEFT,
WIDX_HOTKEY_DROPDOWN,
WIDX_THEMES_GROUP,
WIDX_THEMES_LABEL,
@@ -212,9 +213,9 @@ enum WindowOptionsWidgetIdx {
WIDX_ASSET_PACKS,
};
static constexpr const StringId WINDOW_TITLE = STR_OPTIONS_TITLE;
static constexpr const int32_t WW = 310;
static constexpr const int32_t WH = 332;
static constexpr StringId WINDOW_TITLE = STR_OPTIONS_TITLE;
static constexpr int32_t WW = 310;
static constexpr int32_t WH = 332;
#define MAIN_OPTIONS_WIDGETS \
WINDOW_SHIM(WINDOW_TITLE, WW, WH), \
@@ -318,21 +319,22 @@ static Widget window_options_audio_widgets[] = {
static Widget window_options_controls_and_interface_widgets[] = {
MAIN_OPTIONS_WIDGETS,
#define CONTROLS_GROUP_START 53
MakeWidget({ 5, CONTROLS_GROUP_START + 0}, {300, 92}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CONTROLS_GROUP ), // Controls group
MakeWidget({ 10, CONTROLS_GROUP_START + 13}, {290, 14}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_SCREEN_EDGE_SCROLLING, STR_SCREEN_EDGE_SCROLLING_TIP ), // Edge scrolling
MakeWidget({ 10, CONTROLS_GROUP_START + 30}, {290, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_TRAP_MOUSE, STR_TRAP_MOUSE_TIP ), // Trap mouse
MakeWidget({ 10, CONTROLS_GROUP_START + 45}, {290, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_INVERT_RIGHT_MOUSE_DRAG, STR_INVERT_RIGHT_MOUSE_DRAG_TIP), // Invert right mouse dragging
MakeWidget({ 10, CONTROLS_GROUP_START + 60}, {290, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_ZOOM_TO_CURSOR, STR_ZOOM_TO_CURSOR_TIP ), // Zoom to cursor
MakeWidget({155, CONTROLS_GROUP_START + 75}, {145, 13}, WindowWidgetType::Button, WindowColour::Secondary, STR_HOTKEY, STR_HOTKEY_TIP ), // Set hotkeys buttons
MakeWidget({ 5, CONTROLS_GROUP_START + 0}, {300,107}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CONTROLS_GROUP ), // Controls group
MakeWidget({ 10, CONTROLS_GROUP_START + 13}, {290, 14}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_SCREEN_EDGE_SCROLLING, STR_SCREEN_EDGE_SCROLLING_TIP ), // Edge scrolling
MakeWidget({ 10, CONTROLS_GROUP_START + 30}, {290, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_TRAP_MOUSE, STR_TRAP_MOUSE_TIP ), // Trap mouse
MakeWidget({ 10, CONTROLS_GROUP_START + 45}, {290, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_INVERT_RIGHT_MOUSE_DRAG, STR_INVERT_RIGHT_MOUSE_DRAG_TIP ), // Invert right mouse dragging
MakeWidget({ 10, CONTROLS_GROUP_START + 60}, {290, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_ZOOM_TO_CURSOR, STR_ZOOM_TO_CURSOR_TIP ), // Zoom to cursor
MakeWidget({ 10, CONTROLS_GROUP_START + 75}, {290, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary, STR_WINDOW_BUTTONS_ON_THE_LEFT, STR_WINDOW_BUTTONS_ON_THE_LEFT_TIP), // Window buttons on the left
MakeWidget({155, CONTROLS_GROUP_START + 90}, {145, 13}, WindowWidgetType::Button, WindowColour::Secondary, STR_HOTKEY, STR_HOTKEY_TIP ), // Set hotkeys buttons
#undef CONTROLS_GROUP_START
#define THEMES_GROUP_START 148
#define THEMES_GROUP_START 163
MakeWidget({ 5, THEMES_GROUP_START + 0}, {300, 48}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_THEMES_GROUP ), // Themes group
MakeWidget({ 10, THEMES_GROUP_START + 14}, {145, 12}, WindowWidgetType::Label, WindowColour::Secondary, STR_THEMES_LABEL_CURRENT_THEME, STR_CURRENT_THEME_TIP ), // Themes
MakeWidget({155, THEMES_GROUP_START + 14}, {145, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_STRING ),
MakeWidget({288, THEMES_GROUP_START + 15}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_CURRENT_THEME_TIP ),
MakeWidget({155, THEMES_GROUP_START + 30}, {145, 13}, WindowWidgetType::Button, WindowColour::Secondary, STR_EDIT_THEMES_BUTTON, STR_EDIT_THEMES_BUTTON_TIP), // Themes button
#undef THEMES_GROUP_START
#define TOOLBAR_GROUP_START 200
#define TOOLBAR_GROUP_START 215
MakeWidget({ 5, TOOLBAR_GROUP_START + 0}, {300, 92}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_TOOLBAR_BUTTONS_GROUP ), // Toolbar buttons group
MakeWidget({ 10, TOOLBAR_GROUP_START + 14}, {280, 12}, WindowWidgetType::Label, WindowColour::Secondary, STR_SHOW_TOOLBAR_BUTTONS_FOR ),
MakeWidget({ 24, TOOLBAR_GROUP_START + 31}, {122, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_FINANCES_BUTTON_ON_TOOLBAR, STR_FINANCES_BUTTON_ON_TOOLBAR_TIP ), // Finances
@@ -663,8 +665,12 @@ private:
y = std::max<int32_t>(y, widget->bottom);
}
height = y + 6;
widgets[WIDX_BACKGROUND].bottom = height - 1;
widgets[WIDX_PAGE_BACKGROUND].bottom = height - 1;
ResizeFrameWithPage();
}
void OnResize() override
{
ResizeFrameWithPage();
}
void CommonUpdate()
@@ -1349,32 +1355,22 @@ private:
break;
case WIDX_TITLE_MUSIC_DROPDOWN:
{
if (!IsRCT1TitleMusicAvailable())
const bool rct1MusicThemeIsAvailable = IsRCT1TitleMusicAvailable();
int32_t numItems{};
int32_t checkedIndex{};
for (auto theme : TitleThemeOptions)
{
// Only show None and RCT2
int32_t numItems{};
if (theme.Kind == TitleMusicKind::RCT1 && !rct1MusicThemeIsAvailable)
continue;
if (gConfigSound.TitleMusic == theme.Kind)
checkedIndex = numItems;
gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL;
gDropdownItems[numItems++].Args = TitleMusicNames[0];
gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL;
gDropdownItems[numItems++].Args = TitleMusicNames[2];
ShowDropdown(widget, numItems);
if (gConfigSound.TitleMusic == TitleMusicKind::None)
Dropdown::SetChecked(0, true);
else if (gConfigSound.TitleMusic == TitleMusicKind::RCT2)
Dropdown::SetChecked(1, true);
}
else
{
// Show None, RCT1, RCT2 and random
int32_t numItems{};
for (auto musicName : TitleMusicNames)
{
gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL;
gDropdownItems[numItems++].Args = musicName;
}
ShowDropdown(widget, numItems);
Dropdown::SetChecked(EnumValue(gConfigSound.TitleMusic), true);
gDropdownItems[numItems++].Args = theme.Name;
}
ShowDropdown(widget, numItems);
Dropdown::SetChecked(checkedIndex, true);
break;
}
}
@@ -1407,18 +1403,20 @@ private:
break;
case WIDX_TITLE_MUSIC_DROPDOWN:
{
auto titleMusic = static_cast<TitleMusicKind>(dropdownIndex);
if (!IsRCT1TitleMusicAvailable() && dropdownIndex != 0)
// HACK: When RCT1 is not available, it's not in the dropdown, so indices higher than it should be incremented
const bool rct1MusicThemeIsAvailable = IsRCT1TitleMusicAvailable();
for (size_t i = 0; i < std::size(TitleThemeOptions) && static_cast<int32_t>(i) <= dropdownIndex; i++)
{
titleMusic = TitleMusicKind::RCT2;
if (TitleThemeOptions[i].Kind == TitleMusicKind::RCT1 && !rct1MusicThemeIsAvailable)
dropdownIndex++;
}
gConfigSound.TitleMusic = titleMusic;
gConfigSound.TitleMusic = TitleThemeOptions[dropdownIndex].Kind;
ConfigSaveDefault();
Invalidate();
OpenRCT2::Audio::StopTitleMusic();
if (titleMusic != TitleMusicKind::None)
if (gConfigSound.TitleMusic != TitleMusicKind::None)
{
OpenRCT2::Audio::PlayTitleMusic();
}
@@ -1465,14 +1463,14 @@ private:
return { 500, 0 };
}
StringId GetTitleMusicName()
StringId GetTitleMusicName() const
{
auto index = EnumValue(gConfigSound.TitleMusic);
if (index < 0 || static_cast<size_t>(index) >= std::size(TitleMusicNames))
{
index = EnumValue(TitleMusicKind::None);
}
return TitleMusicNames[index];
auto theme = std::find_if(std::begin(TitleThemeOptions), std::end(TitleThemeOptions), [](auto&& option) {
return gConfigSound.TitleMusic == option.Kind;
});
if (theme != std::end(TitleThemeOptions))
return theme->Name;
return STR_OPENRCT2_DROPDOWN;
}
void AudioPrepareDraw()
@@ -1590,6 +1588,12 @@ private:
Invalidate();
WindowInvalidateByClass(WindowClass::TopToolbar);
break;
case WIDX_WINDOW_BUTTONS_ON_THE_LEFT:
gConfigInterface.WindowButtonsOnTheLeft ^= 1;
ConfigSaveDefault();
Invalidate();
WindowInvalidateAll();
break;
case WIDX_INVERT_DRAG:
gConfigGeneral.InvertViewportDrag ^= 1;
ConfigSaveDefault();
@@ -1654,6 +1658,7 @@ private:
SetCheckboxValue(WIDX_TOOLBAR_SHOW_MUTE, gConfigInterface.ToolbarShowMute);
SetCheckboxValue(WIDX_TOOLBAR_SHOW_CHAT, gConfigInterface.ToolbarShowChat);
SetCheckboxValue(WIDX_TOOLBAR_SHOW_ZOOM, gConfigInterface.ToolbarShowZoom);
SetCheckboxValue(WIDX_WINDOW_BUTTONS_ON_THE_LEFT, gConfigInterface.WindowButtonsOnTheLeft);
size_t activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex();
const utf8* activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex);
@@ -2048,7 +2053,7 @@ private:
Invalidate();
WindowEventResizeCall(this);
WindowEventInvalidateCall(this);
WindowEventOnPrepareDrawCall(this);
InitScrollWidgets();
Invalidate();
}
@@ -2146,11 +2151,16 @@ private:
STR_SAVE_EVERY_30MINUTES, STR_SAVE_EVERY_HOUR, STR_SAVE_NEVER,
};
static constexpr StringId TitleMusicNames[] = {
STR_OPTIONS_MUSIC_VALUE_NONE,
STR_ROLLERCOASTER_TYCOON_1_DROPDOWN,
STR_ROLLERCOASTER_TYCOON_2_DROPDOWN,
STR_OPTIONS_MUSIC_VALUE_RANDOM,
static constexpr struct
{
TitleMusicKind Kind;
StringId Name;
} TitleThemeOptions[] = {
{ TitleMusicKind::None, STR_OPTIONS_MUSIC_VALUE_NONE },
{ TitleMusicKind::OpenRCT2, STR_OPENRCT2_DROPDOWN },
{ TitleMusicKind::RCT1, STR_ROLLERCOASTER_TYCOON_1_DROPDOWN },
{ TitleMusicKind::RCT2, STR_ROLLERCOASTER_TYCOON_2_DROPDOWN },
{ TitleMusicKind::Random, STR_OPTIONS_MUSIC_VALUE_RANDOM },
};
static constexpr StringId FullscreenModeNames[] = {
+6 -6
View File
@@ -35,8 +35,8 @@
#include <openrct2/world/Entrance.h>
#include <openrct2/world/Park.h>
static constexpr const StringId WINDOW_TITLE = STR_STRINGID;
static constexpr const int32_t WH = 224;
static constexpr StringId WINDOW_TITLE = STR_STRINGID;
static constexpr int32_t WH = 224;
// clang-format off
enum WindowParkPage {
@@ -167,7 +167,7 @@ struct WindowParkAward {
uint32_t sprite;
};
static constexpr const WindowParkAward _parkAwards[] = {
static constexpr WindowParkAward _parkAwards[] = {
{ STR_AWARD_MOST_UNTIDY, SPR_AWARD_MOST_UNTIDY },
{ STR_AWARD_MOST_TIDY, SPR_AWARD_MOST_TIDY },
{ STR_AWARD_BEST_ROLLERCOASTERS, SPR_AWARD_BEST_ROLLERCOASTERS },
@@ -595,7 +595,7 @@ private:
{
WindowDrawViewport(dpi, *this);
if (viewport->flags & VIEWPORT_FLAG_SOUND_ON)
GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), windowPos + ScreenCoordsXY{ 2, 2 });
GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), WindowGetViewportSoundIconPos(*this));
}
// Draw park closed / open label
@@ -632,7 +632,7 @@ private:
}
// Call invalidate event
WindowEventInvalidateCall(this);
WindowEventOnPrepareDrawCall(this);
focus = newFocus;
@@ -1193,7 +1193,7 @@ private:
Invalidate();
WindowEventResizeCall(this);
WindowEventInvalidateCall(this);
WindowEventOnPrepareDrawCall(this);
WindowEventUpdateCall(this);
if (listen && viewport != nullptr)
viewport->flags |= VIEWPORT_FLAG_SOUND_ON;
+8 -3
View File
@@ -25,9 +25,9 @@
#include <openrct2/localisation/Localisation.h>
#include <openrct2/world/Park.h>
static constexpr const StringId WINDOW_TITLE = STR_SET_PATROL_AREA;
static constexpr const int32_t WH = 54;
static constexpr const int32_t WW = 104;
static constexpr StringId WINDOW_TITLE = STR_SET_PATROL_AREA;
static constexpr int32_t WH = 54;
static constexpr int32_t WW = 104;
enum WindowPatrolAreaWidgetIdx
{
@@ -283,6 +283,11 @@ private:
auto coords = FootpathGetCoordinatesFromPos(pos, nullptr, nullptr);
return coords.IsNull() ? std::nullopt : std::make_optional(coords);
}
void OnResize() override
{
ResizeFrame();
}
};
WindowBase* WindowPatrolAreaOpen(EntityId staffId)
+9 -29
View File
@@ -78,6 +78,9 @@ static Widget *window_player_page_widgets[] = {
class PlayerWindow final : public Window
{
int16_t _previousRotation = -1;
bool _drawViewport = true;
public:
void Init(const uint8_t id)
{
@@ -93,13 +96,10 @@ public:
page = 0;
frame_no = 0;
list_information_type = 0;
picked_peep_frame = 0;
min_width = 210;
min_height = 134;
max_width = 500;
max_height = 450;
no_list_items = 0;
selected_list_item = -1;
Invalidate();
@@ -108,16 +108,6 @@ public:
pressed_widgets = 0;
}
void OnClose() override
{
switch (page)
{
case WINDOW_PLAYER_PAGE_STATISTICS:
OnCloseStatistics();
break;
}
}
void OnResize() override
{
switch (page)
@@ -224,8 +214,6 @@ private:
page = newPage;
frame_no = 0;
no_list_items = 0;
selected_list_item = -1;
hold_down_widgets = 0;
pressed_widgets = 0;
@@ -305,7 +293,7 @@ private:
return;
}
// Don't scroll if the view was originally undefined
if (var_492 == -1)
if (!_drawViewport)
{
scroll = false;
}
@@ -322,12 +310,12 @@ private:
}
// Draw the viewport
var_492 = 0;
_drawViewport = true;
}
else
{
// Don't draw the viewport
var_492 = -1;
_drawViewport = false;
}
}
}
@@ -368,9 +356,9 @@ private:
bool scroll = true;
// Use this spare window field for rotation check
if (var_4AE != GetCurrentRotation())
if (_previousRotation != GetCurrentRotation())
{
var_4AE = GetCurrentRotation();
_previousRotation = GetCurrentRotation();
scroll = false;
}
UpdateViewport(scroll);
@@ -483,7 +471,7 @@ private:
}
DrawTextEllipsised(dpi, screenCoords, updatedWidth, STR_LAST_ACTION_RAN, ft, { TextAlignment::CENTRE });
if (viewport != nullptr && var_492 != -1)
if (viewport != nullptr && _drawViewport)
{
WindowDrawViewport(dpi, *this);
}
@@ -586,14 +574,6 @@ private:
#pragma region Statistics
void OnCloseStatistics()
{
if (error.var_480)
{
error.var_480 = 0;
}
}
void OnResizeStatistics()
{
WindowSetResize(*this, 210, 80, 210, 80);
@@ -17,8 +17,8 @@
#include <openrct2/windows/Intent.h>
#include <openrct2/world/Park.h>
static constexpr const int32_t WW = 200;
static constexpr const int32_t WH = 100;
static constexpr int32_t WW = 200;
static constexpr int32_t WH = 100;
// clang-format off
enum WindowRideRefurbishWidgetIdx
@@ -89,6 +89,11 @@ public:
DrawTextWrapped(dpi, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE });
}
}
void OnResize() override
{
ResizeFrame();
}
};
WindowBase* WindowRideRefurbishPromptOpen(const Ride& ride)
+10 -5
View File
@@ -23,10 +23,10 @@
#include <openrct2/world/Park.h>
#include <openrct2/world/Scenery.h>
static constexpr const int32_t WH_DEVELOPMENT = 196;
static constexpr const int32_t WW_DEVELOPMENT = 300;
static constexpr const int32_t WH_FUNDING = 207;
static constexpr const int32_t WW_FUNDING = 320;
static constexpr int32_t WH_DEVELOPMENT = 196;
static constexpr int32_t WW_DEVELOPMENT = 300;
static constexpr int32_t WH_FUNDING = 207;
static constexpr int32_t WW_FUNDING = 320;
// clang-format off
enum {
@@ -106,7 +106,7 @@ const int32_t window_research_tab_animation_loops[] = {
16,
};
static constexpr const StringId ResearchStageNames[] = {
static constexpr StringId ResearchStageNames[] = {
STR_RESEARCH_STAGE_INITIAL_RESEARCH,
STR_RESEARCH_STAGE_DESIGNING,
STR_RESEARCH_STAGE_COMPLETING_DESIGN,
@@ -280,6 +280,11 @@ private:
}
}
void OnResize() override
{
ResizeFrameWithPage();
}
void DrawTabImage(DrawPixelInfo& dpi, int32_t tabPage, int32_t spriteIndex)
{
WidgetIndex widgetIndex = WIDX_TAB_1 + tabPage;
Loaded 100 of 538 files, more files were not shown because too many files have changed in this diff. Show more