安装 Steam
登录
|
语言
繁體中文(繁体中文)
日本語(日语)
한국어(韩语)
ไทย(泰语)
български(保加利亚语)
Čeština(捷克语)
Dansk(丹麦语)
Deutsch(德语)
English(英语)
Español-España(西班牙语 - 西班牙)
Español - Latinoamérica(西班牙语 - 拉丁美洲)
Ελληνικά(希腊语)
Français(法语)
Italiano(意大利语)
Bahasa Indonesia(印度尼西亚语)
Magyar(匈牙利语)
Nederlands(荷兰语)
Norsk(挪威语)
Polski(波兰语)
Português(葡萄牙语 - 葡萄牙)
Português-Brasil(葡萄牙语 - 巴西)
Română(罗马尼亚语)
Русский(俄语)
Suomi(芬兰语)
Svenska(瑞典语)
Türkçe(土耳其语)
Tiếng Việt(越南语)
Українська(乌克兰语)
报告翻译问题









im Still not fast enough to get the achievement i care too much to let my allies die to save 5 minutes
I'm going to have a try about your suggestions
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.
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.
码了