源战役客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.4 KiB

  1. Message = Message or {}
  2. local Message = Message
  3. --sound_type "fault" "award" "success"
  4. function Message.show(str,sound_type)
  5. if sound_type then
  6. --[[@
  7. /;
  8. lua_soundM:PlayUIEffectSound(LuaSoundManager.SOUND_UI.SUCCESS)
  9. ]]
  10. local use_sound_type
  11. if sound_type == "fault" then
  12. use_sound_type = LuaSoundManager.SOUND_UI.FAULT
  13. end
  14. lua_soundM:PlayUIEffectSound(use_sound_type)
  15. end
  16. -- local arg = {...}
  17. -- local result="";
  18. -- for key, var in ipairs(arg) do
  19. -- if type(var)=="table" then
  20. -- for key1, var1 in ipairs(var) do
  21. -- result=result.."[key]"..key1.."[var]"..var1.."\n"
  22. -- end
  23. -- elseif type(var)=="userdata" then
  24. -- result = result.."a userdata"
  25. -- else
  26. -- result = result .. var
  27. -- end
  28. -- end
  29. str = str or ""
  30. SysInfoCtrl.Instance:AppendMsg(SysInfoCtrl.SysInfoType.MINI,str)
  31. end
  32. --批量show,做时间间隔。
  33. function Message.listshow(str_list)
  34. if #str_list<=0 then
  35. return
  36. end
  37. local timer
  38. local call=function ( ... )
  39. if #str_list>0 then
  40. str=table.remove(str_list,1)
  41. Message.show(str)
  42. else
  43. TimerQuest.CancelQuest(GlobalTimerQuest, timer)
  44. return true
  45. end
  46. end
  47. timer=TimerQuest.AddPeriodQuest(GlobalTimerQuest, call,0.3,-1)
  48. end