Skip to content

Commit

Permalink
Add gift items.
Browse files Browse the repository at this point in the history
  • Loading branch information
umi committed Aug 18, 2020
1 parent cbf1f49 commit 95bc86a
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions Plugin_FC2/Plugin_FC2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ public class Plugin_FC2 : IPlugin {
private long _LastCommentIndexTmp;
private long _AnonymousIndex;
private Dictionary<string, long> _AnonymousHash;
private string[] _GiftItems;
private Dictionary<int, string> _GiftItems;

#endregion


#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を返す)
Expand All @@ -54,7 +54,23 @@ public void Begin() {
this._IconStatus = true;
this._SettingStatus = false;
this.ResetCommentIndex();
this._GiftItems = new string[] {"風船", "ハート", "ダイヤ"};
this._GiftItems = new Dictionary<int, string>(){
{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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 95bc86a

Please sign in to comment.