gameCfg.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import ConfProxy, { ConfListProxy } from "./confProxy"
  2. import { XlsConfig, xlsItemKind, xlsItemMoney, xlsMathInfo, xlsPackageInfo, xlsLanguageLang, xlsLanguageClientText, xlsLanguageSeverHouduan
  3. , xlsAudioInfo, xlsGuideInfo } from "./xlsConfig"
  4. export default class Gamecfg {
  5. static itemKind:ConfProxy<xlsItemKind>
  6. static itemMoney:ConfProxy<xlsItemMoney>
  7. static mathInfo:ConfProxy<xlsMathInfo>
  8. static packageInfo:ConfProxy<xlsPackageInfo>
  9. static languageLang:ConfProxy<xlsLanguageLang>
  10. static languageClientText:ConfProxy<xlsLanguageClientText>
  11. static languageSeverHouduan:ConfProxy<xlsLanguageSeverHouduan>
  12. static audioInfo:ConfProxy<xlsAudioInfo>
  13. static guideInfo:ConfProxy<xlsGuideInfo>
  14. static guideInfoList:ConfListProxy<xlsGuideInfo>
  15. static initLoading(loadSuccess: Function) {
  16. try {
  17. new XlsConfig("loadJson",(xls: XlsConfig) => {
  18. Gamecfg.mathInfo = new ConfProxy("mathInfo",xls.xlsMathInfo ,"key")
  19. Gamecfg.packageInfo = new ConfProxy("packageInfo",xls.xlsPackageInfo ,"id")
  20. Gamecfg.languageLang = new ConfProxy("languageLang",xls.xlsLanguageLang ,"key")
  21. Gamecfg.languageClientText = new ConfProxy("languageClientText",xls.xlsLanguageClientText ,"key")
  22. Gamecfg.audioInfo = new ConfProxy("audioInfo",xls.xlsAudioInfo ,"id")
  23. loadSuccess(true)
  24. })
  25. } catch (error) {
  26. loadSuccess(false)
  27. }
  28. }
  29. static init(loadSuccess: Function, progressCallback: Function) {
  30. try {
  31. new XlsConfig("pzwj",(xls: XlsConfig) => {
  32. Gamecfg.itemKind = new ConfProxy("itemKind",xls.xlsItemKind ,"kind")
  33. Gamecfg.itemMoney = new ConfProxy("itemMoney",xls.xlsItemMoney ,"id")
  34. Gamecfg.languageSeverHouduan = new ConfProxy("languageSeverHouduan",xls.xlsLanguageSeverHouduan ,"key")
  35. Gamecfg.guideInfo = new ConfProxy("guideInfo",xls.xlsGuideInfo ,"id")
  36. Gamecfg.guideInfoList = new ConfListProxy("guideInfoList",xls.xlsGuideInfo ,"event")
  37. loadSuccess(true)
  38. }, progressCallback)
  39. } catch (error) {
  40. loadSuccess(false)
  41. }
  42. }
  43. }