This commit is contained in:
aozhiwei 2024-06-21 13:31:04 +08:00
parent b0cd82dd97
commit 9bc2e93721
2 changed files with 34355 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,7 @@ package mt
import (
"q5"
"f5"
"os"
"mtb"
"jccommon"
"strings"
@ -29,7 +30,7 @@ func (this *ItemTable) Load() {
func (this *ItemTable) PostInit1() {
items := []*struct {
Id int32 `json:"id"`
Name int32 `json:"name"`
Name string `json:"name"`
Type int32 `json:"type"`
SubType int32 `json:"sub_type"`
}{}
@ -37,11 +38,17 @@ func (this *ItemTable) PostInit1() {
func (ele *Item) bool {
if ele.GetType() == jccommon.ITEM_TYPE_HERO ||
ele.GetType() == jccommon.ITEM_TYPE_GOLD_BULLION {
p := q5.NewSliceElement(&items)
p := *q5.NewSliceElement(&items)
p.Id = ele.GetId()
p.Name = ele.GetName()
p.Type = ele.GetType()
p.SubType = ele.GetSubType()
}
return true
})
data := q5.EncodeJson(&items)
if err := os.WriteFile("item.json", []byte(data), 0644); err == nil {
}
}
func (this *ItemTable) Search(name string, itemIds map[int32]int32) {