当前位置: 首页>>代码示例>>Python>>正文


Python Player.loadPlayers方法代码示例

本文整理汇总了Python中Player.loadPlayers方法的典型用法代码示例。如果您正苦于以下问题:Python Player.loadPlayers方法的具体用法?Python Player.loadPlayers怎么用?Python Player.loadPlayers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Player的用法示例。


在下文中一共展示了Player.loadPlayers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import Player [as 别名]
# 或者: from Player import loadPlayers [as 别名]
  def __init__(self, resource, svg):

    self.logClassInits = Config.get("game", "log_class_inits")
    if self.logClassInits == 1:
      Log.debug("Data class init (Data.py)...")
    self.logLoadings = Config.get("game", "log_loadings")
    
    self.logImageNotFound = Config.get("log", "log_image_not_found")
    
    self.resource = resource
    self.svg      = svg

    self.sfxVolume    = Config.get("audio", "SFX_volume")
    self.crowdVolume  = Config.get("audio", "crowd_volume")

    #Get theme
    themename = Config.get("coffee", "themename")
    self.themeLabel = themename
    self.themeCoOp  = False

    self.players = None
    self.players = Player.loadPlayers()

    #myfingershurt: check for existance of theme path
    themepath = os.path.join(Version.dataPath(), "themes")
    self.themepath = themepath
    self.path = Version.dataPath()

    if not self.checkImgDrawing(os.path.join("themes",themename,"notes.png")):
      #myfingershurt: here need to ensure an existing theme is selected
      themes = []
      defaultTheme = None           #myfingershurt
      allthemes = os.listdir(themepath)
      for name in allthemes:
        if self.checkImgDrawing(os.path.join("themes",name,"notes.png")):
          themes.append(name)
          if name == "MegaLight":         #myfingershurt
            defaultTheme = name     #myfingershurt
      i = len(themes)
      if defaultTheme != "MegaLight":     #myfingershurt
        defaultTheme = themes[0]    #myfingershurt
      #not a valid theme if notes.png isn't there!  Force default theme:
      Config.set("coffee", "themename",defaultTheme)
      #re-init Data with new default
      themename = defaultTheme
      self.themeLabel = themename

    
    if not os.path.exists(os.path.join(Version.dataPath(), "themes", themename, "vocals")):
      self.vocalPath = "vocals"
    else:
      self.vocalPath = os.path.join("themes",themename,"vocals")

    if self.checkImgDrawing(os.path.join("themes",themename,"spfill.png")):
      self.theme = 0
    elif self.checkImgDrawing(os.path.join("themes",themename,"overdrive fill.png")):
      self.theme = 2
      self.themeCoOp = True
    else:
      self.theme = 1
      if self.checkImgDrawing(os.path.join("themes",themename,"coop_rockmeter.png")):
        self.themeCoOp = True

    self.fontScreenBottom = 0.75      #from our current viewport's constant 3:4 aspect ratio (which is always stretched to fill the video resolution)

    self.loadPartImages()
    #myfingershurt: multi-OS compatibility file access fixes using os.path.join()
    # load font customization images

    #Worldrave - Use new defined Star3 and star4. Using star1 and star2 as a fallback.

    #MFH - no more custom glyphs, these are wasting memory.
    #MFH - but we do need these star1-4 images anyway.  Leaving them loaded here in the Data object.
    self.loadImgDrawing(self, "star1",   os.path.join("themes",themename,"star1.png"), textureSize = (128, 128))
    self.loadImgDrawing(self, "star2",   os.path.join("themes",themename,"star2.png"), textureSize = (128, 128))
    
    #MFH - let's not rely on errors here if we don't have to...
    if not self.loadImgDrawing(self, "star3",   os.path.join("themes",themename,"star3.png"), textureSize = (128, 128)):
      self.star3 = self.star1
    if not self.loadImgDrawing(self, "star4",   os.path.join("themes",themename,"star4.png"), textureSize = (128, 128)):
      self.star4 = self.star2
      

    if self.loadImgDrawing(self, "starPerfect",   os.path.join("themes",themename,"starperfect.png"), textureSize = (128, 128)):
      self.perfectStars = True
      self.maskStars = False
    else:
      self.starPerfect = self.star2
      self.fcStars   = False
      self.starFC     = self.star2
      self.maskStars = True
      self.perfectStars = False

    #self.perfectStars = False
    if self.perfectStars:
      if self.loadImgDrawing(self, "starFC",   os.path.join("themes",themename,"starfc.png"), textureSize = (128, 128)):
        self.fcStars   = True
      else:
        #self.starFC = None
        self.starFC = self.starPerfect
#.........这里部分代码省略.........
开发者ID:upgradeadvice,项目名称:fofix-grisly-virtualenv,代码行数:103,代码来源:Data.py

示例2: __init__

# 需要导入模块: import Player [as 别名]
# 或者: from Player import loadPlayers [as 别名]
    def __init__(self, resource, svg):

        self.logClassInits = Config.get("game", "log_class_inits")
        if self.logClassInits == 1:
            Log.debug("Data class init (Data.py)...")
        self.logLoadings = Config.get("game", "log_loadings")

        self.logImageNotFound = Config.get("log", "log_image_not_found")

        self.resource = resource
        self.svg      = svg

        self.sfxVolume    = Config.get("audio", "SFX_volume")
        self.crowdVolume  = Config.get("audio", "crowd_volume")

        #Get theme
        themename = Config.get("coffee", "themename")
        self.themeLabel = themename
        self.themeCoOp  = False

        self.players = None
        self.players = Player.loadPlayers()

        #myfingershurt: check for existence of theme path
        themepath = os.path.join(Version.dataPath(), "themes")
        self.themepath = themepath
        self.path = Version.dataPath()

        if not self.checkImgDrawing(os.path.join("themes",themename,"notes","notes.png")):
            #myfingershurt: here need to ensure an existing theme is selected
            themes = []
            defaultTheme = None           #myfingershurt
            allthemes = os.listdir(themepath)
            for name in allthemes:
                if self.checkImgDrawing(os.path.join("themes",name,"notes","notes.png")):
                    themes.append(name)
                    if name == "MegaLight V4":         #myfingershurt
                        defaultTheme = name     #myfingershurt
            if defaultTheme != "MegaLight V4":     #myfingershurt
                defaultTheme = themes[0]    #myfingershurt
            #not a valid theme if notes.png isn't there!  Force default theme:
            Config.set("coffee", "themename",defaultTheme)
            #re-init Data with new default
            themename = defaultTheme
            self.themeLabel = themename


        if not os.path.exists(os.path.join(Version.dataPath(), "themes", themename, "vocals")):
            self.vocalPath = "vocals"
        else:
            self.vocalPath = os.path.join("themes",themename,"vocals")

        self.theme = 2
        self.themeCoOp = True

        self.fontScreenBottom = 0.75      #from our current viewport's constant 3:4 aspect ratio (which is always stretched to fill the video resolution)

        self.loadPartImages()
        #myfingershurt: multi-OS compatibility file access fixes using os.path.join()
        # load font customization images

        #Worldrave - Use new defined Star3 and star4. Using star1 and star2 as a fallback.

        #MFH - no more custom glyphs, these are wasting memory.
        #MFH - but we do need these star1-4 images anyway.  Leaving them loaded here in the Data object.
        self.loadImgDrawing(self, "star1",   os.path.join("themes",themename,"star1.png"), textureSize = (128, 128))
        self.loadImgDrawing(self, "star2",   os.path.join("themes",themename,"star2.png"), textureSize = (128, 128))

        #MFH - let's not rely on errors here if we don't have to...
        if not self.loadImgDrawing(self, "star3",   os.path.join("themes",themename,"star3.png"), textureSize = (128, 128)):
            self.star3 = self.star1
        if not self.loadImgDrawing(self, "star4",   os.path.join("themes",themename,"star4.png"), textureSize = (128, 128)):
            self.star4 = self.star2


        if self.loadImgDrawing(self, "starPerfect",   os.path.join("themes",themename,"starperfect.png"), textureSize = (128, 128)):
            self.perfectStars = True
            self.maskStars = False
        else:
            self.starPerfect = self.star2
            self.fcStars   = False
            self.starFC     = self.star2
            self.maskStars = True
            self.perfectStars = False

        if self.perfectStars:
            if self.loadImgDrawing(self, "starFC",   os.path.join("themes",themename,"starfc.png"), textureSize = (128, 128)):
                self.fcStars   = True
            else:
                self.starFC = self.starPerfect
                self.fcStars = False

        # load misc images
        self.loadImgDrawing(self, "loadingImage", os.path.join("themes",themename,"loadingbg.png"), textureSize = (256,256))
        self.loadImgDrawing(self, "optionsBG", os.path.join("themes",themename,"menu","optionsbg.png"))
        if self.loadImgDrawing(self, "submenuSelect", os.path.join("themes",themename,"submenuselect.png")):
            subSelectImgW = self.submenuSelect.width1()
            self.submenuSelectFound = True
            self.subSelectWFactor = 640.000/subSelectImgW
            self.subSelectImgH = self.submenuSelect.height1()
#.........这里部分代码省略.........
开发者ID:Richardgriff,项目名称:fofix,代码行数:103,代码来源:Data.py


注:本文中的Player.loadPlayers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。