Skip to content

Commit

Permalink
Style tweaks per Linkid's review.
Browse files Browse the repository at this point in the history
  • Loading branch information
wrzwicky committed Oct 17, 2017
1 parent 3ac6029 commit 999a066
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
17 changes: 9 additions & 8 deletions fofix/core/GameEngine.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ def __init__(self, config = None):
themename = self.config.get("coffee", "themename")
themepath = os.path.join(Version.dataPath(), "themes", themename)
self._initTheme(themename, themepath)
self._initStages()

# Load game modifications
Mod.init(self)
Expand All @@ -313,7 +314,6 @@ def __init__(self, config = None):

log.debug("Ready.")


# evilynux - This stops the crowd cheers if they're still playing (issue 317).
def quit(self):
# evilynux - self.audio.close() crashes when we attempt to restart
Expand All @@ -324,17 +324,16 @@ def quit(self):
self.task.removeTask(taskData['task'])
self.running = False


def _initTheme(self, themename, themepath):
'''
"""
Select the source of graphics for the game.
Note that currently this can only be called GameEngine on startup.
:param themename: what to call this theme
:type themename: str
:param themepath: absolute path to theme folder
:type themepath: str
'''
"""

log.notice( 'Setting theme %s from "%s"' % (themename,themepath) )

Expand All @@ -361,14 +360,17 @@ def _initTheme(self, themename, themepath):
log.notice("Theme activated using built-in Theme class")
self.task.addTask(self.theme)

## ------------------------------ ##
def _initStages(self):
"""
Setup animated stages from already-setup theme.
Only call this after _initTheme().
##MFH: Animated stage folder selection option
# <themename>\Stages still contains the backgrounds for when stage rotation is off, and practice.png
# subfolders under Stages\ will each be treated as a separate animated stage set
"""

self.stageFolders = []
currentTheme = themename
currentTheme = self.theme.name

stagespath = os.path.join(themepath, "backgrounds")
if os.path.exists(stagespath):
Expand Down Expand Up @@ -423,7 +425,6 @@ def _initTheme(self, themename, themepath):
log.warn("No stages\ folder found, forcing None setting for Animated Stage.")
self.config.set("game","animated_stage_folder", "None") #MFH: force "None" when Stages folder can't be found


def setStartupLayer(self, startupLayer):
"""
Set the L{Layer} that will be shown when the all
Expand Down
8 changes: 0 additions & 8 deletions fofix/game/guitarscene/instruments/Drum.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ def renderNote(self, length, sustain, color, tailOnly = False, isTappable = Fals
gl.glPopMatrix()
gl.glDisable(gl.GL_DEPTH_TEST)


def renderFrets(self, visibility, song, controls):
w = self.boardWidth / self.strings
size = (.22, .22)
Expand Down Expand Up @@ -443,7 +442,6 @@ def renderFrets(self, visibility, song, controls):

gl.glDisable(gl.GL_DEPTH_TEST)


def renderFreestyleFlames(self, visibility, controls):
if self.flameColors[0][0] == -1:
return
Expand All @@ -452,7 +450,6 @@ def renderFreestyleFlames(self, visibility, controls):

v = 1.0 - visibility


flameLimit = 10.0
flameLimitHalf = round(flameLimit/2.0)
for fretNum in range(self.strings+1): #need to add 1 to string count to check this correctly (bass drum doesnt count as a string)
Expand Down Expand Up @@ -601,7 +598,6 @@ def renderFreestyleFlames(self, visibility, controls):
else: #MFH - flame count is done - reset it!
self.freestyleHitFlameCounts[fretNum] = 0 #MFH


def render(self, visibility, song, pos, controls, killswitch):

if shaders.turnon:
Expand Down Expand Up @@ -674,7 +670,6 @@ def render(self, visibility, song, pos, controls, killswitch):
self.renderAnimatedFlames(song, pos)
self.renderFlames(song, pos) #MFH - only when freestyle inactive!


def playDrumSounds(self, controls, playBassDrumOnly = False): #MFH - handles playing of drum sounds.
#Returns list of drums that were just hit (including logic for detecting a held bass pedal)
#pass playBassDrumOnly = True (optional paramater) to only play the bass drum sound, but still
Expand Down Expand Up @@ -713,7 +708,6 @@ def playDrumSounds(self, controls, playBassDrumOnly = False): #MFH - handles p

return drumsJustHit


#volshebnyi - handle freestyle picks here
def freestylePick(self, song, pos, controls):
drumsJustHit = self.playDrumSounds(controls)
Expand All @@ -731,7 +725,6 @@ def freestylePick(self, song, pos, controls):

return numHits


def hitNote(self, time, note):
self.pickStartPos = max(self.pickStartPos, time)
self.playedNotes.append([time, note])
Expand Down Expand Up @@ -800,7 +793,6 @@ def run(self, ticks, pos, controls):

activeFrets = [(note.number - 1) for time, note in self.playedNotes]


if -1 in activeFrets:
self.openFretActivity = min(self.openFretActivity + ticks / 24.0, 0.6)

Expand Down

0 comments on commit 999a066

Please sign in to comment.