@@ -28,7 +28,7 @@ type Props = {|
2828 assetShortHeaders : Array < AssetShortHeader > ,
2929 addedAssetIds : Array < string > ,
3030 onClose : ( ) => void ,
31- onAssetPackAdded : ( ) => void ,
31+ onAssetsAdded : ( ) => void ,
3232 project : gdProject ,
3333 objectsContainer : gdObjectsContainer ,
3434 events : gdEventsList ,
@@ -40,7 +40,7 @@ export const AssetPackDialog = ({
4040 assetShortHeaders,
4141 addedAssetIds,
4242 onClose,
43- onAssetPackAdded ,
43+ onAssetsAdded ,
4444 project,
4545 objectsContainer,
4646 events,
@@ -56,18 +56,18 @@ export const AssetPackDialog = ({
5656
5757 const resourcesFetcher = useResourceFetcher ( ) ;
5858 const [
59- isAssetPackBeingInstalled ,
60- setIsAssetPackBeingInstalled ,
59+ areAssetsBeingInstalled ,
60+ setAreAssetsBeingInstalled ,
6161 ] = React . useState < boolean > ( false ) ;
6262
6363 const eventsFunctionsExtensionsState = React . useContext (
6464 EventsFunctionsExtensionsContext
6565 ) ;
6666
67- const onInstallAssetPack = React . useCallback (
67+ const onInstallAssets = React . useCallback (
6868 async ( assetShortHeaders : Array < AssetShortHeader > ) => {
6969 if ( ! assetShortHeaders || ! assetShortHeaders . length ) return ;
70- setIsAssetPackBeingInstalled ( true ) ;
70+ setAreAssetsBeingInstalled ( true ) ;
7171 try {
7272 const installOutputs = await Promise . all (
7373 assetShortHeaders . map ( assetShortHeader =>
@@ -88,14 +88,14 @@ export const AssetPackDialog = ({
8888
8989 await resourcesFetcher . ensureResourcesAreFetched ( project ) ;
9090
91- setIsAssetPackBeingInstalled ( false ) ;
92- onAssetPackAdded ( ) ;
91+ setAreAssetsBeingInstalled ( false ) ;
92+ onAssetsAdded ( ) ;
9393 } catch ( error ) {
94- setIsAssetPackBeingInstalled ( false ) ;
95- console . error ( 'Error while installing the asset pack ' , error ) ;
94+ setAreAssetsBeingInstalled ( false ) ;
95+ console . error ( 'Error while installing the assets ' , error ) ;
9696 showErrorBox ( {
9797 message :
98- 'There was an error while installing the asset pack . Verify your internet connection or try again later.' ,
98+ 'There was an error while installing the assets . Verify your internet connection or try again later.' ,
9999 rawError : error ,
100100 errorId : 'install-asset-pack-error' ,
101101 } ) ;
@@ -108,11 +108,11 @@ export const AssetPackDialog = ({
108108 objectsContainer ,
109109 events ,
110110 onObjectAddedFromAsset ,
111- onAssetPackAdded ,
111+ onAssetsAdded ,
112112 ]
113113 ) ;
114114
115- const dialogContent = isAssetPackBeingInstalled
115+ const dialogContent = areAssetsBeingInstalled
116116 ? {
117117 actionButton : (
118118 < TextButton
@@ -141,15 +141,15 @@ export const AssetPackDialog = ({
141141 key = "install-again"
142142 label = { < Trans > Install again</ Trans > }
143143 primary = { false }
144- onClick = { ( ) => onInstallAssetPack ( assetShortHeaders ) }
144+ onClick = { ( ) => onInstallAssets ( assetShortHeaders ) }
145145 />
146146 ) ,
147- onApply : ( ) => onInstallAssetPack ( assetShortHeaders ) ,
147+ onApply : ( ) => onInstallAssets ( assetShortHeaders ) ,
148148 content : (
149149 < Text >
150150 < Trans >
151- You already have this asset pack installed, do you want to add the { ' ' }
152- { assetShortHeaders . length } assets again?
151+ You already have these { assetShortHeaders . length } assets
152+ installed, do you want to add them again?
153153 </ Trans >
154154 </ Text >
155155 ) ,
@@ -161,15 +161,14 @@ export const AssetPackDialog = ({
161161 key = "continue"
162162 label = { < Trans > Continue</ Trans > }
163163 primary
164- onClick = { ( ) => onInstallAssetPack ( assetShortHeaders ) }
164+ onClick = { ( ) => onInstallAssets ( assetShortHeaders ) }
165165 />
166166 ) ,
167- onApply : ( ) => onInstallAssetPack ( assetShortHeaders ) ,
167+ onApply : ( ) => onInstallAssets ( assetShortHeaders ) ,
168168 content : (
169169 < Text >
170170 < Trans >
171- You're about to add { assetShortHeaders . length } assets from the
172- asset pack. Continue?
171+ You're about to add { assetShortHeaders . length } assets. Continue?
173172 </ Trans >
174173 </ Text >
175174 ) ,
@@ -181,24 +180,24 @@ export const AssetPackDialog = ({
181180 key = "install-missing"
182181 primary
183182 onClick = { ( ) => {
184- onInstallAssetPack ( missingAssetShortHeaders ) ;
183+ onInstallAssets ( missingAssetShortHeaders ) ;
185184 } }
186185 buildMenuTemplate = { i18n => [
187186 {
188187 label : i18n . _ ( t `Install all the assets` ) ,
189- click : ( ) => onInstallAssetPack ( assetShortHeaders ) ,
188+ click : ( ) => onInstallAssets ( assetShortHeaders ) ,
190189 } ,
191190 ] }
192191 />
193192 ) ,
194- onApply : ( ) => onInstallAssetPack ( missingAssetShortHeaders ) ,
193+ onApply : ( ) => onInstallAssets ( missingAssetShortHeaders ) ,
195194 content : (
196195 < Text >
197196 < Trans >
198197 You already have{ ' ' }
199198 { assetShortHeaders . length - missingAssetShortHeaders . length } { ' ' }
200- asset(s) from this pack in your scene. Do you want to add the
201- remaining { missingAssetShortHeaders . length } asset (s)?
199+ asset(s) in your scene. Do you want to add the remaining { ' ' }
200+ { missingAssetShortHeaders . length } one (s)?
202201 </ Trans >
203202 </ Text >
204203 ) ,
@@ -210,12 +209,12 @@ export const AssetPackDialog = ({
210209 title = { assetPack . name }
211210 open
212211 onRequestClose = { ( ) => {
213- if ( ! isAssetPackBeingInstalled ) onClose ( ) ;
212+ if ( ! areAssetsBeingInstalled ) onClose ( ) ;
214213 } }
215214 cannotBeDismissed
216215 actions = { [
217- // Installing a pack is not cancelable, so we hide the button while installing.
218- ! isAssetPackBeingInstalled ? (
216+ // Installing a list of assets is not cancelable, so we hide the button while installing.
217+ ! areAssetsBeingInstalled ? (
219218 < TextButton
220219 key = "cancel"
221220 label = { < Trans > Cancel</ Trans > }
0 commit comments