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.

63 regels
1.6 KiB

  1. local ZPDef = ZPFramework.ZPImport("zp_base.luaScript.ZPDef")
  2. local ZPSound = ZPFramework.ZPFrameworkClassImprot("zp_base.luaScript.ZPSound")
  3. local gulinSound = class("gulinSound", ZPSound)
  4. local path = "mj/res/sound"
  5. local luzhouPath = "luzhou/res/sound"
  6. gulinSound.man = "c_man"
  7. gulinSound.women = "c_women"
  8. gulinSound.pre = "c_"
  9. gulinSound.sound_t = 1
  10. local function dealSex(s)
  11. local sex=tonumber(s)
  12. if sex~=1 and sex~=2 then
  13. sex=1
  14. end
  15. return 2--sex
  16. end
  17. -- sound_t 1 普通话 2 方言
  18. function gulinSound.setSoundType( sound_t )
  19. gulinSound.sound_t = sound_t
  20. if sound_t == 1 then
  21. gulinSound.man = "c_man"
  22. gulinSound.women = "c_women"
  23. gulinSound.pre = "c_"
  24. else
  25. gulinSound.man = "man"
  26. gulinSound.women = "women"
  27. gulinSound.pre = ""
  28. end
  29. end
  30. function gulinSound.PlayOperateSound(sex,opType)
  31. if gulinSound.sound_t == 1 then--普通话
  32. gulinSound.super.PlayOperateSound(sex,opType)
  33. else
  34. if gulinSound.OperateSoundConfig[opType] then
  35. sex = dealSex(sex)
  36. local name = string.format("%s/%s/%sluzhou_mj_%s_%s.ogg", luzhouPath,sex ==1 and gulinSound.man or gulinSound.women, gulinSound.pre, sex, gulinSound.OperateSoundConfig[opType])
  37. playVoice(name)
  38. end
  39. end
  40. end
  41. function gulinSound.PlayZPSound(sex,value)
  42. if gulinSound.sound_t == 1 then--普通话
  43. gulinSound.super.PlayZPSound(sex,value)
  44. else
  45. sex = dealSex(sex)
  46. local name = string.format("%s/%s/%sluzhou_mj_%s_%x.ogg", luzhouPath,sex ==1 and gulinSound.man or gulinSound.women, gulinSound.pre, sex, value)
  47. playVoice(name)
  48. end
  49. end
  50. function gulinSound.PlayZhaNiao()
  51. playVoice(luzhouPath.."/hz_zhuaniao.ogg")
  52. end
  53. return gulinSound