KLFriendEnemyLogTextItem.lua 918 B

1234567891011121314151617181920212223242526272829303132
  1. ---@class KLFriendEnemyLogTextItem:UIKmlLuaPanelBase
  2. ---@field view KLFriendEnemyLogTextItemView
  3. local KLFriendEnemyLogTextItem = class(UIKmlLuaPanelBase)
  4. local this =KLFriendEnemyLogTextItem
  5. ---创建时调用一次
  6. function this:Init()
  7. end
  8. ---创建或者刷新界面数据时调用
  9. function this:Refresh()
  10. GUI:Text_setString(self.view.textContent, self.args and self.args.text or "")
  11. end
  12. ---@param data FriendProto.FriendLog
  13. function this:SetLog(data)
  14. local str = os.date("%Y-%m-%d %H:%M:%S", data.time//1000)
  15. ---@type cfg_map_info_column
  16. local mapName = SL:GetConfig("cfg_map_info", data.mapCfgId)
  17. local res = string.format("%s 被他在 %s <color=#ff2323>击杀</color> 仇恨度+10", str, mapName and mapName.mapname or "")
  18. GUI:Text_setString(self.view.textContent, res)
  19. end
  20. ---注册UI事件和服务器消息
  21. function this:RegistEvents()
  22. end
  23. function this:Close()
  24. end
  25. return this