mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-27 02:32:21 +02:00
Renaming function to make it clear that logging happens
This commit is contained in:
parent
96aada282f
commit
6db0cc8d08
@ -494,7 +494,7 @@ export function initMoveAnim(scene: BattleScene, move: Moves): Promise<void> {
|
|||||||
.then(response => {
|
.then(response => {
|
||||||
const contentType = response.headers.get("content-type");
|
const contentType = response.headers.get("content-type");
|
||||||
if (!response.ok || contentType?.indexOf("application/json") === -1) {
|
if (!response.ok || contentType?.indexOf("application/json") === -1) {
|
||||||
useDefaultAnim(move, defaultMoveAnim, response.status, response.statusText);
|
useAndLogDefaultAnim(move, defaultMoveAnim, response.status, response.statusText);
|
||||||
return resolve();
|
return resolve();
|
||||||
}
|
}
|
||||||
return response.json();
|
return response.json();
|
||||||
@ -516,7 +516,7 @@ export function initMoveAnim(scene: BattleScene, move: Moves): Promise<void> {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
useDefaultAnim(move, defaultMoveAnim, error);
|
useAndLogDefaultAnim(move, defaultMoveAnim, error);
|
||||||
return resolve();
|
return resolve();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -532,7 +532,7 @@ export function initMoveAnim(scene: BattleScene, move: Moves): Promise<void> {
|
|||||||
* @param defaultMoveAnim the default move to use as the default animation
|
* @param defaultMoveAnim the default move to use as the default animation
|
||||||
* @param optionalParams parameters to add to the error logging
|
* @param optionalParams parameters to add to the error logging
|
||||||
*/
|
*/
|
||||||
function useDefaultAnim(move: Moves, defaultMoveAnim: Moves, ...optionalParams: any[]) {
|
function useAndLogDefaultAnim(move: Moves, defaultMoveAnim: Moves, ...optionalParams: any[]) {
|
||||||
const moveName = Utils.animationFileName(move);
|
const moveName = Utils.animationFileName(move);
|
||||||
console.error(`Could not load animation file for move '${moveName}'`, ...optionalParams);
|
console.error(`Could not load animation file for move '${moveName}'`, ...optionalParams);
|
||||||
populateMoveAnim(move, moveAnims.get(defaultMoveAnim));
|
populateMoveAnim(move, moveAnims.get(defaultMoveAnim));
|
||||||
|
Loading…
Reference in New Issue
Block a user