package formview

import (
	"go_dreamfactory/cmd/v2/model"
	"go_dreamfactory/cmd/v2/service"
	"go_dreamfactory/pb"

	"fyne.io/fyne/v2"
	"github.com/sirupsen/logrus"
)

// 玩家战斗记录
type UserBattlerecordView struct {
	BaseformView
}

func (this *UserBattlerecordView) CreateView(t *model.TestCase) fyne.CanvasObject {
	this.form.OnSubmit = func() {
		if err := service.GetPttService().SendToClient(
			t.MainType,
			t.SubType,
			&pb.UserBattlerecordReq{},
		); err != nil {
			logrus.Error(err)
			return
		}

	}
	return this.form
}
