Skip to content

Commit

Permalink
1.1.1 TypeScript移行
Browse files Browse the repository at this point in the history
  • Loading branch information
elleonard committed Feb 28, 2024
1 parent 2c2b3f8 commit ff85214
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 41 deletions.
35 changes: 0 additions & 35 deletions src/codes/NoseForTreasure/DarkPlasma_NoseForTreasure.js

This file was deleted.

33 changes: 33 additions & 0 deletions src/codes/NoseForTreasure/DarkPlasma_NoseForTreasure.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/// <reference path="./NoseForTreasure.d.ts" />

import { pluginName } from '../../common/pluginName';
import { parseArgs_noseForTreasure } from './_build/DarkPlasma_NoseForTreasure_commands';

const PLUGIN_COMMANDS = {
NOSE_FOR_TREASURE: 'noseForTreasure',
};

PluginManager.registerCommand(pluginName, PLUGIN_COMMANDS.NOSE_FOR_TREASURE, function (args) {
const parsedArgs = parseArgs_noseForTreasure(args);
const targetEvents = $gameMap
.events()
.filter(
(gameEvent) =>
gameEvent.event().meta[parsedArgs.tag] &&
parsedArgs.selfSwitches.every(
(selfSwitch) => $gameSelfSwitches.value(gameEvent.selfSwitchKey(selfSwitch.name)) === selfSwitch.state
)
);
$gameVariables.setValue(parsedArgs.variableId, targetEvents.length);
if (parsedArgs.balloon) {
targetEvents.forEach((event) => $gameTemp.requestBalloon(event, parsedArgs.balloon));
}
});

function Game_Event_NoseForTreasureMixIn(gameEvent: Game_Event) {
gameEvent.selfSwitchKey = function (selfSwitchCh) {
return [this._mapId, this._eventId, selfSwitchCh];
};
}

Game_Event_NoseForTreasureMixIn(Game_Event.prototype);
5 changes: 5 additions & 0 deletions src/codes/NoseForTreasure/NoseForTreasure.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference path="../../typings/rmmz.d.ts" />

declare interface Game_Event {
selfSwitchKey(selfSwitch: string): [number, number, string];
}
15 changes: 9 additions & 6 deletions src/codes/NoseForTreasure/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ DarkPlasma_NoseForTreasure:
year: 2021
license: MIT
histories:
- date: '2021/10/23'
version: '1.1.0'
- date: 2024/02/28
version: 1.1.1
description: 'TypeScript移行'
- date: 2021/10/23
version: 1.1.0
description: '特定イベントの上にバルーンを表示する機能を追加'
- date: '2021/10/22'
version: '1.0.1'
- date: 2021/10/22
version: 1.0.1
description: 'プラグインコマンドの日本語名を追加'
- date: '2021/10/21'
version: '1.0.0'
- date: 2021/10/21
version: 1.0.0
description: '公開'

locates:
Expand Down

0 comments on commit ff85214

Please sign in to comment.