优化活跃度初始化
This commit is contained in:
parent
802427073c
commit
f0614f6c19
@ -67,13 +67,14 @@ func init() {
|
||||
|
||||
func main() {
|
||||
// create a new ui
|
||||
app := app.NewWithID("protocol-test-tool")
|
||||
app.SetIcon(theme.ResourceIconPng)
|
||||
app := app.NewWithID("df-toolkit")
|
||||
app.SetIcon(theme.ResourceAppPng)
|
||||
appUI := ui.NewUI(app, configService, connService, pttService, obs)
|
||||
// logLifecycle(app)
|
||||
|
||||
//创建enter
|
||||
w := fyne.CurrentApp().NewWindow("传送门")
|
||||
w.SetIcon(theme.ResourceAppPng)
|
||||
// 检查版本
|
||||
if app.Metadata().Build > 1 {
|
||||
checkVersion(app, w)
|
||||
|
File diff suppressed because one or more lines are too long
@ -114,6 +114,7 @@ func (ui *MainWindowImpl) quiteHandle() {
|
||||
ui.parent.Show()
|
||||
ui.w.Close()
|
||||
ui.connService.Close()
|
||||
gobase.NewScheduler().Stop()
|
||||
}
|
||||
|
||||
// CreateWindow ....
|
||||
|
@ -93,7 +93,6 @@ func (this *ListBaseView) listBtnFun() func() {
|
||||
// set data
|
||||
func (this *ListBaseView) reloadListData() {
|
||||
if this.itemListData != nil {
|
||||
logrus.Debugf("list record:%v", len(this.itemListData.DataList))
|
||||
d := this.itemListData.AsInterfaceArray()
|
||||
this.dataBinding.Set(d)
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ func (this *configureComp) getTaskActiveList() (data []*cfg.GameActiveRewardData
|
||||
}
|
||||
|
||||
//获取活跃度奖励list
|
||||
func (this *configureComp) getTaskActiveByTag(taskTag int32) (data []*cfg.GameActiveRewardData, err error) {
|
||||
func (this *configureComp) getTaskActiveByTag(taskTag int32) (data []*cfg.GameActiveRewardData) {
|
||||
conf, err := this.getActiveRewardCfg()
|
||||
if err != nil {
|
||||
log.Errorf("get conf err:%v", err)
|
||||
|
@ -22,15 +22,15 @@ func (this *ModelTaskActive) Init(service core.IService, module core.IModule, co
|
||||
}
|
||||
|
||||
//初始化活跃度
|
||||
func (this *ModelTaskActive) initActiveReward(uid string) {
|
||||
data := this.moduleTask.configure.getTaskActiveList()
|
||||
func (this *ModelTaskActive) initActiveReward(uid string, taskTag comm.TaskTag) {
|
||||
data := this.moduleTask.configure.getTaskActiveByTag(int32(taskTag))
|
||||
|
||||
for _, conf := range data {
|
||||
objId := primitive.NewObjectID().Hex()
|
||||
ta := &pb.DBTaskActive{
|
||||
Id: objId,
|
||||
Uid: uid,
|
||||
Tag: conf.IdTag,
|
||||
Tag: int32(taskTag),
|
||||
RId: conf.Key,
|
||||
}
|
||||
if err := this.moduleTask.modelTaskActive.AddList(uid, ta.Id, ta); err != nil {
|
||||
|
@ -58,7 +58,8 @@ func (this *ModuleTask) InitTaskAll(uid string) {
|
||||
this.modelTask.initTask(uid, comm.TASK_DAILY)
|
||||
this.modelTask.initTask(uid, comm.TASK_WEEKLY)
|
||||
this.modelTask.initTask(uid, comm.TASK_ACHIEVE)
|
||||
this.modelTaskActive.initActiveReward(uid)
|
||||
this.modelTaskActive.initActiveReward(uid, comm.TASK_DAILY)
|
||||
this.modelTaskActive.initActiveReward(uid, comm.TASK_WEEKLY)
|
||||
}
|
||||
|
||||
// 初始化指定的任务
|
||||
@ -66,10 +67,10 @@ func (this *ModuleTask) InitTaskByTag(uid string, taskTag comm.TaskTag) {
|
||||
switch taskTag {
|
||||
case comm.TASK_DAILY:
|
||||
this.modelTask.initTask(uid, comm.TASK_DAILY)
|
||||
this.modelTaskActive.initActiveReward(uid)
|
||||
this.modelTaskActive.initActiveReward(uid, comm.TASK_DAILY)
|
||||
case comm.TASK_WEEKLY:
|
||||
this.modelTask.initTask(uid, comm.TASK_WEEKLY)
|
||||
this.modelTaskActive.initActiveReward(uid)
|
||||
this.modelTaskActive.initActiveReward(uid, comm.TASK_WEEKLY)
|
||||
case comm.TASK_ACHIEVE:
|
||||
this.modelTask.initTask(uid, comm.TASK_ACHIEVE)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user