Jump to content

Recommended Posts

I want to edit this function in it

function ChatHistoryManager:GetDisplayName(name, prefab)
    return name ~= "" and name or STRINGS.UI.SERVERADMINSCREEN.UNKNOWN_USER_NAME
end

but i have no idea how I can edit this file, does anyone know how?

Edited by . . .

chathistory.lua doesn't return a class (so AddClassPostConstruct won't work) but assigns it to global ChatHistory so you can edit that:

local old_ChatHistory_GetDisplayName = _G.ChatHistory.GetDisplayName
_G.ChatHistory.GetDisplayName = function(self, name, prefab, ...)
    local old_return_string = old_ChatHistory_GetDisplayName(self, name, prefab, ...)

    -- Your code
end

 

  • Thanks 1

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...