mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-09-30 07:06:18 -04:00
247bda97c6
* Added loaders for itemratio.txt, Overlay.txt, UniqueAppellation.txt * Adjust unique appellation loader for expansion data * fixes: response to PR comments * overlay.go: PR comment fixes Co-authored-by: Bojan Novkovic <bojan.novkovic@kset.org>
33 lines
616 B
Go
33 lines
616 B
Go
package d2datadict
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2common"
|
|
)
|
|
|
|
type UniqueAppellationRecord struct {
|
|
// The title
|
|
Name string
|
|
}
|
|
|
|
var UniqueAppellations map[string]*UniqueAppellationRecord
|
|
|
|
func LoadUniqueAppellations(file []byte) {
|
|
UniqueAppellations = make(map[string]*UniqueAppellationRecord)
|
|
|
|
d := d2common.LoadDataDictionary(file)
|
|
for d.Next() {
|
|
record := &UniqueAppellationRecord{
|
|
Name: d.String("Name"),
|
|
}
|
|
UniqueAppellations[record.Name] = record
|
|
}
|
|
|
|
if d.Err != nil {
|
|
panic(d.Err)
|
|
}
|
|
|
|
log.Printf("Loaded %d UniqueAppellation records", len(UniqueAppellations))
|
|
}
|