欺诈之地

欺诈之地

51 个评价
计时器
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
332.199 KB
2021 年 1 月 11 日 上午 3:48
2021 年 2 月 19 日 下午 7:19
4 项改动说明 ( 查看 )

订阅以下载
计时器

描述
计时器

增加了一个计时器,可记录游戏时间。

可协助完成成就"前往奥诗奴竞速场!".

Enjoy!
10 条留言
东兴耀扬 2021 年 7 月 6 日 上午 7:39 
很好用 那个20人讨厌和喜欢的成就是怎么刷出来的啊
Asty 2021 年 6 月 15 日 上午 10:36 
Very useful
im Still not fast enough to get the achievement i care too much to let my allies die to save 5 minutes
[CTC] Mordecai 2021 年 3 月 12 日 下午 11:04 
This is great! Really hope they will add a similar timer in the base game at some point. Thank you for making this mod!
qwerty吃小庄  [作者] 2021 年 2 月 6 日 下午 8:20 
Wow, thanks so much:steamhappy: Actually I can hardly realize the codes of Widgets , so I just copy the codes from the original place.
I'm going to have a try about your suggestions:steamthumbsup:
RageLeague 2021 年 2 月 6 日 上午 8:09 
Something like this:

local old_fn = Widget.MainOverlayTopBar.init
function Widget.MainOverlayTopBar:init()
old_fn(self)
self.game_timer = self.main_bar_left_widgets:AddChild( Widget.GameTimer() )
:Bloom(0.1)
:SetFocusable( true )
:SetToolTipLayoutFn( function( w, tooltip_widget ) tooltip_widget:LayoutBounds( "left", "below", w ):Offset( 0, -SPACING.M1 ) end )
:LayoutBounds( "after", "center" ):Offset( 20, 0 )
end

This does almost the same thing, but the difference is that it appends to the existing function instead of replacing it, so you don't need to worry about the source code changing or another mod adding to the overlay bar.
One of the downside to this method is that you can only append or prepend code, so you cannot insert code in the middle. However, when that is not necessary, it is better to use this method.
RageLeague 2021 年 2 月 6 日 上午 8:09 
Looks good.
Here's a few suggestions for the mod: I noticed that you copied and pasted the game's source code and modified it. However, this can lead to a few issues, because if the source code changes, you are forced to change the entire code, and you have to keep track of the different branches. Seems way too much work. And it doesn't work well with other mods that modifies the main overlay bar.
Instead of setting the function, what you can do is reusing the old function. For example, for your Widget.MainOverlayTopBar:init function, instead of rewriting everything, you can store it to a local variable, and then call that variable in your modified function.
qwerty吃小庄  [作者] 2021 年 1 月 21 日 上午 7:03 
已修复
qwerty吃小庄  [作者] 2021 年 1 月 21 日 上午 2:41 
已知,正在修改
xc-ustcfetr 2021 年 1 月 20 日 上午 6:57 
最新版本有BUG(顶部栏位加了METTLE点显示,和计时器在空间可能冲突了?),需要作者更新
Puro 2021 年 1 月 17 日 上午 7:29 
好东西
码了