Griftlands

Griftlands

51 ratings
Game Timer
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
332.199 KB
11 Jan, 2021 @ 3:48am
19 Feb, 2021 @ 7:19pm
4 Change Notes ( view )

Subscribe to download
Game Timer

Description
Game Timer

Add a game-time timer.

The mod can assist you in the achievement To The Oshnudrome!.

Enjoy!
10 Comments
东兴耀扬 6 Jul, 2021 @ 7:39am 
很好用 那个20人讨厌和喜欢的成就是怎么刷出来的啊
Asty 15 Jun, 2021 @ 10:36am 
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 12 Mar, 2021 @ 11:04pm 
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吃小庄  [author] 6 Feb, 2021 @ 8:20pm 
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 6 Feb, 2021 @ 8:09am 
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 6 Feb, 2021 @ 8:09am 
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吃小庄  [author] 21 Jan, 2021 @ 7:03am 
已修复
qwerty吃小庄  [author] 21 Jan, 2021 @ 2:41am 
已知,正在修改
xc-ustcfetr 20 Jan, 2021 @ 6:57am 
最新版本有BUG(顶部栏位加了METTLE点显示,和计时器在空间可能冲突了?),需要作者更新
Puro 17 Jan, 2021 @ 7:29am 
好东西
码了