ElseIf Key = 84 And BuyItemCount < 4
Mystring= "选择[T][添加]材料[" & I+1 & "]..."
Gosub [说话]
Gosub [设置材料]
ElseIf Key = 83
Mystring= "选择[S][商店类型]..."
Gosub [说话]
Gosub [选择商店]
Gosub [材料列表]
ElseIf Key = 68
Mystring= "选择[D][清空][材料列表]..."
Gosub [说话]
Gosub [清空材料列表]
Gosub [材料列表]
ElseIf Key = 89
If BuyItemCount >0
I=0
For BuyItemCount
If I>=1
If BuyItem_Page(I)<>BuyItem_Page(I-1)
Ptype=2
EndIf
EndIf
I=I+1
EndFor
EndIf
EndIf
Return [材料列表]
Sub [设置材料]
If ItemList = ""
Gosub [读取商店材料列表]
EndIf
Mystring = "│[" & StoreName & "]-材料[" & I+1 & "]" & vblf
Mystring = Mystring & "├─────────" & vblf
Mystring = Mystring & ItemList
Gosub [说话]
Gosub [等待按键]
While ItemCount < CInt("&H" & Chr(Key))
Gosub [等待按键]
EndWhile
Plugin BuyItem(I) =File.ReadINI(StoreName,Chr(Key),IniFile)
BuyItem(I) = Chr(Key) & BuyItem(I)
BuyItemCount= BuyItemCount+1
Mystring = "材料[" & I+1 & "]选择[" & Chr(Key) & "][" & Mid(BuyItem(I),6) & "]..."
Gosub [说话]
Gosub [设置材料个数]
Return [设置材料]
Sub [设置材料个数]
Cnt =0
BuyItem_PosX(I) = 466+((Mid(BuyItem(I),2,3)-1) mod 15 mod 5)*35
BuyItem_PosY(I) = 71+(((Mid(BuyItem(I),2,3)-1) Mod 15)\5)*35
BuyItem_Page(I) = (Mid(BuyItem(I),2,3)-1)\15+1
Mystring = "│材料[" & I+1 & "]-[" & Mid(BuyItem(I),6) & "]" & vblf
Mystring = Mystring & "├" & String(11,"─") & vblf
For 6
Cnt=Cnt+1
Mystring = Mystring & "│<" & Cnt & ">[" & Cnt*10 & "]个"& vblf
EndFor
Mystring = Mystring & "│<Z>自定义..."
Gosub [说话]
Gosub [等待按键]
While (Key <49 Or Key >Asc(Cnt)) And Key <>90
Gosub [等待按键]
EndWhile
If Key = 90
Rem [自定义个数]
SayString "请输入购买材料[" & I+1 & "][" & Mid(BuyItem(I),6) & "]的数量:"
Gosub [取得数字]
If Numb > 72
Mystring = "物品栏最多只有[72]个位置,请重新输入..."
Gosub [说话]
Goto [自定义个数]
EndIf
BuyItem_Amount(I) = Numb
Gosub [材料操作]
Else
BuyItem_Amount(I) = Chr(Key)*10
Mystring = "材料[" & I+1 & "]-购买[" & Mid(BuyItem(I),6) & "][" & BuyItem_Amount(I) &"]个..."
Gosub [说话]
Gosub [材料操作]
EndIf
Return [设置材料个数]
Sub [材料操作]
Mystring = "│材料[" & I+1 & "]-["
If Len(Mid(BuyItem(I),6)) >5
Mystring = Mystring & Mid(BuyItem(I),6,4) & ".."
Else
Mystring = Mystring & Mid(BuyItem(I),6)
EndIf
Mystring = Mystring & "][" & BuyItem_Amount(I) & "]个"
If Len(Mid(BuyItem(I),6)) <5
Mystring = Mystring & vblf
EndIf
Mystring = Mystring & "├" & String(11,"─") & vblf
Mystring = Mystring & "│<Y>确定 <X>修改 <D>删除"
Gosub [说话]
Gosub [等待按键]
While Key <>88 And Key <>89 And Key <>68
Gosub [等待按键]
EndWhile