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