Micha Posted January 6, 2015 Share Posted January 6, 2015 modmain.lua:local require = GLOBAL.require local NUIClock = require "widgets.uiclock"function NUIClock:OnGainFocus() NUIClock._base.OnGainFocus(self) local clock_str = "Fubar" self.text:SetString(clock_str) return trueendThe plan is to replace the "World 1" Text with various useful informations, best summed up by the glorious "Fubar". To me it looks like the new Object gets loaded but OnGainFocus is never called. May you guys help me out? Link to comment Share on other sites More sharing options...
Mobbstar Posted January 6, 2015 Share Posted January 6, 2015 Um... I have modified a couple of classes in my mods, but beyond the AddClassPostConstruct I have no clue. Link to comment Share on other sites More sharing options...
Micha Posted January 6, 2015 Author Share Posted January 6, 2015 I guess I'll use it then function NewClock() local require = GLOBAL.require local NUIClock = require "widgets/uiclock" NUIClock.OnGainFocus = function (self) NUIClock._base.OnGainFocus(self) local clock_str = "Fubar" self.text:SetString(clock_str) return true endendAddSimPostInit(NewClock)Works for me Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.