mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-11-02 17:27:23 -04:00
8b2cc76c30
* add ObjMode.txt loader * add colors.txt loader * added storepage loader * Update storepage_loader.go removed printline Co-authored-by: kottz <edward.kallstedt@gmail.com>
31 lines
494 B
Go
31 lines
494 B
Go
package d2records
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2txt"
|
|
)
|
|
|
|
func objectModesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|
records := make(ObjectModes)
|
|
|
|
for d.Next() {
|
|
record := &ObjectModeRecord{
|
|
Name: d.String("Name"),
|
|
Token: d.String("Token"),
|
|
}
|
|
|
|
records[record.Name] = record
|
|
}
|
|
|
|
if d.Err != nil {
|
|
panic(d.Err)
|
|
}
|
|
|
|
r.Object.Modes = records
|
|
|
|
log.Printf("Loaded %d ObjectMode records", len(records))
|
|
|
|
return nil
|
|
}
|