1- import { checkbox , compute , dropdown , DropdownParams , FlexiblePosition , groupbox , label , LabelParams , WidgetCreator , window } from "openrct2-flexui" ;
1+ import { button , checkbox , compute , dropdown , DropdownParams , FlexiblePosition , groupbox , label , LabelParams , WidgetCreator , window } from "openrct2-flexui" ;
22import { ParkRide } from "../objects/parkRide" ;
33import { setBuildMonth , setBuildYear , setCustomDesign , setExcitementRating , setFrozenRatings , setIndestructable , setIntensityRating , setNauseaRating } from "../services/rideEditor" ;
44import { formatRelativeDate , getDateMonth , getDateYear , monthNames } from "../utilities/date" ;
@@ -9,6 +9,7 @@ import { labelled, labelledSpinner, LabelledSpinnerParams, multiplier } from "./
99
1010const int16max = 32_767 , int16min = - 32_768 ;
1111const controlsLabelWidth = 85 ;
12+ const buttonSize = 24 ;
1213
1314
1415/**
@@ -24,7 +25,7 @@ export const rideWindow = window({
2425 title : model . _title ,
2526 position : "center" ,
2627 width : { value : 233 , min : 185 , max : 250 } ,
27- height : 252 ,
28+ height : 322 ,
2829 colours : [ 24 , 24 ] ,
2930 onOpen : ( ) => model . _open ( ) ,
3031 onClose : ( ) => model . _close ( ) ,
@@ -115,6 +116,30 @@ export const rideWindow = window({
115116 } )
116117 ]
117118 } ) ,
119+ groupbox ( {
120+ text : "Ride name" ,
121+ tooltip : "Edit the name of the ride" ,
122+ content : [
123+ label ( {
124+ text : model . _title ,
125+ } ) ,
126+ button ( {
127+ text : "Rename ride" ,
128+ height : buttonSize ,
129+ onClick : ( ) => {
130+ ui . showTextInput ( {
131+ title : "Ride/attraction name" ,
132+ initialValue : model . _title . get ( ) ,
133+ description : "Enter new name for this ride/attraction:" ,
134+ callback : ( input ) => {
135+ const ride = model . _ride . get ( ) ;
136+ if ( ride ) context . executeAction ( "ridesetname" , { ride : ride . _id , name : input } ) ;
137+ }
138+ } ) ;
139+ }
140+ } )
141+ ]
142+ } ) ,
118143 multiplier ( model . _multiplierIndex )
119144 ]
120145} ) ;
0 commit comments