Jump to content

Recommended Posts

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 trueend

The 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?

I guess I'll use it then :D

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 :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...