From 95bc86a9e908e530577980b95a14c750444fc87e Mon Sep 17 00:00:00 2001 From: umi Date: Tue, 18 Aug 2020 15:48:43 +0200 Subject: [PATCH] Add gift items. --- Plugin_FC2/Plugin_FC2.cs | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/Plugin_FC2/Plugin_FC2.cs b/Plugin_FC2/Plugin_FC2.cs index 43ea130..f4ff0fc 100644 --- a/Plugin_FC2/Plugin_FC2.cs +++ b/Plugin_FC2/Plugin_FC2.cs @@ -31,7 +31,7 @@ public class Plugin_FC2 : IPlugin { private long _LastCommentIndexTmp; private long _AnonymousIndex; private Dictionary _AnonymousHash; - private string[] _GiftItems; + private Dictionary _GiftItems; #endregion @@ -39,7 +39,7 @@ public class Plugin_FC2 : IPlugin { #region ■IPluginメンバの実装 public string Name { get { return "FC2ライブ読み上げ API ver"; } } - public string Version { get { return "2019/05/23版"; } } + public string Version { get { return "2020/08/18版"; } } public string Caption { get { return "FC2ライブのコメントを読み上げます。"; } } //プラグインの設定画面情報(設定画面が必要なければnullを返す) @@ -54,7 +54,23 @@ public void Begin() { this._IconStatus = true; this._SettingStatus = false; this.ResetCommentIndex(); - this._GiftItems = new string[] {"風船", "ハート", "ダイヤ"}; + this._GiftItems = new Dictionary(){ + {0, "風船"}, + {1, "ハート"}, + {2, "ダイヤ"}, + {3, "ドーナツ"}, + {4, "ニンジャ"}, + {5, "キャンディ"}, + {6, "クラッカー"}, + {7, "花火"}, + {8, "キッス"}, + {9, "いいね"}, + {10, "車"}, + {11, "さかな"}, + {12, "UFO"}, + {13, "シャンパン"}, + {999, "オチャコ"} + }; //タイマー登録 this._Timer = new System.Threading.Timer(this.Timer_Event, null, 0, 1000); @@ -148,10 +164,10 @@ private long getAnonymousIndex(string hash) { } private string getGiftItemName(int id) { - if(this._GiftItems.Length < id + 1) { - return "何か"; + if(this._GiftItems.ContainsKey(id)) { + return this._GiftItems[id]; } - return this._GiftItems[id]; + return "何か"; } private void AddCommentTalk(long lastCommentIndex) {