Skip to content

Commit

Permalink
Merge branch 'master' into menu-edits
Browse files Browse the repository at this point in the history
Conflicts:
	src/GameEngine.py
	src/Settings.py
  • Loading branch information
akedrou committed Jul 19, 2011
2 parents e62670f + 9f1284a commit 5ddd514
Show file tree
Hide file tree
Showing 29 changed files with 744 additions and 450 deletions.
Binary file modified data/themes/MegaLight GH3/menu/maintext.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed data/themes/MegaLight GH3/menu/maintext_gh3.png
Binary file not shown.
2 changes: 2 additions & 0 deletions data/themes/MegaLight GH3/theme.ini
Expand Up @@ -8,6 +8,8 @@ song_name_text_color = #FFFFFF
song_info_display_scale = 0.0012
loading_phrase = Keepin' in clean
use_solo_submenu = False
#copy these values to the theme.ini if you want it to have GH3 coloration
flames_color = #BF5C05
fretS_color = #4CB2E5
Expand Down
14 changes: 14 additions & 0 deletions data/themes/MegaLight V4/rockmeter.ini
Expand Up @@ -171,3 +171,17 @@ alignment = center
color = #FFFFFF00
fadeTo = #FFFFFFFF
transitionTime = 1000.0

[layer19:Text]
text = "%i Note Streak" % (50*int(streak/50))
ypos = .7
xpos = .5
shadow = True
alignment = center

[layer19:fx0:Fade]
color = #FFFF0000
fadeTo = #FFFF00FF
transitionTime = 1.0
transitionTimeOut = 1000.0
condition = streak % 50 == 0 and streak > 0 and self.triggerPick()
7 changes: 0 additions & 7 deletions data/themes/Uberlight/CustomTheme.py

This file was deleted.

Binary file modified data/themes/Uberlight/frets/fretbuttons.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed data/themes/Uberlight/menu/maintext.png
Binary file not shown.
Binary file modified data/themes/Uberlight/notes/drum/notes.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/themes/Uberlight/notes/notes.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 7 additions & 27 deletions data/themes/Uberlight/rockmeter.ini
@@ -1,30 +1,10 @@
[layer0:Image]
texture = base.png
xpos = .07
ypos = .26
xscale = 10
yscale = 220
valignment = bottom
rect = (0,1,0,rock)

[layer1:Image]
texture = base.png
xscale = 250
yscale = 10
[layer0:Text]
text = "Rock:%03i%s Power:%03i%s Part:%s %ix" %(rock*100, "%", power*100, "%", part, multiplier)
xpos = .5
ypos = .08
ypos = .06
alignment = center
rect = (0,power,0,1)

[layer2:Text]
text = score
font = scoreFont
xpos = .9
ypos =.88

[layer3:Text]
text = "%dx" % multiplier
font = scoreFont
xpos = .5
ypos = .04
alignment = center
[layer1:Text]
text = "Score:%07i" %score
xpos = .62
ypos = .8
Binary file removed data/themes/Uberlight/rockmeter/base.png
Binary file not shown.
Binary file modified data/themes/Uberlight/tails/bigtail1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/themes/Uberlight/tails/kill1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/themes/Uberlight/tails/tail1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions data/themes/Uberlight/theme.ini
@@ -0,0 +1,4 @@
[theme]
render_necks = False
song_list_display = 3
loading_phrase = _
46 changes: 46 additions & 0 deletions src/Dialogs.py
Expand Up @@ -2087,12 +2087,58 @@ def render(self, visibility, topMost):
else:
wrapCenteredText(font, (x,y), self.text, scale = self.fScale, rightMargin = self.rMargin, linespace = self.lspacing)

#nhydock - expanding on LoadingSplashScreen so there can be overlay and song dependant backgrounds
class SongLoadingSplashScreen(LoadingSplashScreen):
def __init__(self, engine, text, songName, libraryName):
super(SongLoadingSplashScreen, self).__init__(engine, text)

self.engine.loadImgDrawing(self, "songBack", os.path.join(libraryName, songName, "loading.png"))
if self.songBack:
self.engine.loadImgDrawing(self, "loadingImg", os.path.join("themes", self.engine.data.themeLabel, "loading_overlay.png"))

def render(self, visibility, topMost):
self.engine.view.setViewport(1,0)
font = self.engine.data.loadingFont #MFH - new font support

if not font:
return

with self.engine.view.orthogonalProjection(normalize = True):
v = (1 - visibility) ** 2
fadeScreen(v)
w, h = self.engine.view.geometry[2:4]

self.engine.theme.setBaseColor(1 - v)
self.engine.drawImage(self.songBack, scale = (1.0,-1.0), coord = (w/2,h/2), stretched = 3)
self.engine.drawImage(self.loadingImg, scale = (1.0,-1.0), coord = (w/2,h/2), stretched = 3)
w, h = font.getStringSize(self.text, scale=self.fScale)

x = self.loadingx
y = self.loadingy - h / 2 + v * .5

#akedrou - support for Loading Text Color
c1,c2,c3 = self.textColor
glColor3f(c1,c2,c3)

# evilynux - Made text about 2 times smaller (as requested by worldrave)
if self.allowtext:
if self.theme == 1:
wrapCenteredText(font, (x,y), self.text, scale = self.fScale, rightMargin = self.rMargin, linespace = self.lspacing, allowshadowoffset = True, shadowoffset = (self.engine.theme.shadowoffsetx, self.engine.theme.shadowoffsety))
else:
wrapCenteredText(font, (x,y), self.text, scale = self.fScale, rightMargin = self.rMargin, linespace = self.lspacing)

def showLoadingSplashScreen(engine, text = _("Loading...")):
splash = LoadingSplashScreen(engine, text)
engine.view.pushLayer(splash)
engine.run()
return splash

def showSongLoadingSplashScreen(engine, songName, libraryName, text = _("Loading...")):
splash = SongLoadingSplashScreen(engine, text, songName, libraryName)
engine.view.pushLayer(splash)
engine.run()
return splash

def changeLoadingSplashScreenText(engine, splash, text=_("Loading...")):
splash.text = text
engine.run()
Expand Down
142 changes: 142 additions & 0 deletions src/Drum.py
Expand Up @@ -155,6 +155,31 @@ def loadNotes(self):
engine.loadImgDrawing(self, "noteOpenAnimatedPower", get("animated_open_power.png"))
engine.loadImgDrawing(self, "noteOpenAnimated", get("animated_open.png"))

size = (self.boardWidth/1.9, (self.boardWidth/self.strings)/3.0)
self.openVtx = np.array([[-size[0], .27, size[1]],
[size[0], .27, size[1]],
[-size[0], -.27, -size[1]],
[size[0], -.27, -size[1]]],
dtype=np.float32)

self.noteTexCoord = [[np.array([[i/float(self.strings), s/6.0],
[(i+1)/float(self.strings), s/6.0],
[i/float(self.strings), (s+1)/6.0],
[(i+1)/float(self.strings), (s+1)/6.0]],
dtype=np.float32)
for i in range(self.strings)] for s in range(0,5,2)]
self.openTexCoord = [np.array([[0.0, s/6.0],
[1.0, s/6.0],
[0.0, (s+1)/6.0],
[1.0, (s+1)/6.0]], dtype=np.float32) for s in range(1,6,2)]

self.animatedOpenTexCoord = [[np.array([[0.0, s/float(self.noteSpinFrames)],
[1.0, s/float(self.noteSpinFrames)],
[0.0, (s+1)/float(self.noteSpinFrames)],
[1.0, (s+1)/float(self.noteSpinFrames)]],
dtype=np.float32)
for i in range(self.strings)] for s in range(self.noteSpinFrames)]

else:
defaultOpenNote = False

Expand Down Expand Up @@ -202,6 +227,123 @@ def loadFrets(self):
else:
engine.loadImgDrawing(self, "keytexopen", get("keytex_open.png"))

def renderNote(self, length, sustain, color, tailOnly = False, isTappable = False, fret = 0, spNote = False, isOpen = False, spAct = False):

if tailOnly:
return

if self.twoDnote == True:
tailOnly = True

y = 0
if spNote:
y += 1
elif self.starPowerActive:
y += 2

if isOpen:
vtx = self.openVtx
if self.noteSpin:
texCoord = self.animatedOpenTexCoord[self.noteSpinFrameIndex]
if spNote == True:
noteImage = self.noteOpenAnimatedPower
elif self.starPowerActive == True: #death_au: drum sp active notes.
noteImage = self.noteOpenAnimatedPowerActive
else:
noteImage = self.noteOpenAnimated
if not noteImage:
noteImage = self.noteButtons
texCoord = self.openTexCoord[y]
else:
if not noteImage:
noteImage = self.noteButtons
texCoord = self.noteTexCoord[y]
else:
fret -= 1
vtx = self.noteVtx
if self.noteSpin:
texCoord = self.animatedNoteTexCoord[self.noteSpinFrameIndex][fret]
if spNote:
noteImage = self.noteAnimatedPower
elif self.starPowerActive:
noteImage = self.noteAnimatedPowerActive
else:
noteImage = self.noteAnimatedNormal
if not noteImage:
noteImage = self.noteButtons
texCoord = self.noteTexCoord[y][fret]
else:
noteImage = self.noteButtons
texCoord = self.noteTexCoord[y][fret]

self.engine.draw3Dtex(noteImage, vertex = vtx, texcoord = texCoord,
scale = (1,1,0), rot = (30,1,0,0), multiples = False, color = color)

else: #3d Notes
shaders.setVar("Material",color,"notes")

self.notepos = self.engine.theme.drumnotepos
self.noterot = self.engine.theme.drumnoterot

if fret == 0:
fret = 4 #fret 4 is angled, get fret 2 :)
#fret = 2 #compensating for this in drum.
elif fret == 4:
fret = 0

if isOpen and self.openMesh is not None:
meshObj = self.openMesh
elif spNote and self.starMesh is not None:
meshObj = self.starMesh
else:
meshObj = self.noteMesh

glPushMatrix()
glEnable(GL_DEPTH_TEST)
glDepthMask(1)
glShadeModel(GL_SMOOTH)

if not isOpen:
if spNote and self.threeDspin:
glRotate(90 + self.time/3, 0, 1, 0)
elif not spNote and self.noterotate:
glRotatef(90, 0, 1, 0)
glRotatef(-90, 1, 0, 0)

if fret >= 0 and fret <= 4:
glRotate(self.noterot[fret], 0, 0, 1)
glTranslatef(0, self.notepos[fret], 0)

texture = None
if self.notetex:

if isOpen:
if self.opentexture_star:
texture = self.opentexture_star
elif self.opentexture_stara and self.starPowerActive:
texture = self.opentexture_stara
elif self.opentexture:
texture = self.opentexture

elif self.startex and spNote:
texture = getattr(self,"startex"+chr(97+fret))

elif self.spActTex and spAct:
texture = self.spActTex

elif self.staratex and self.starPowerActive:
texture = getattr(self,"staratex"+chr(97+fret))

else:
texture = getattr(self,"notetex"+chr(97+fret))

self.render3DNote(texture, meshObj, color, isTappable)

glDepthMask(0)
glPopMatrix()
glDisable(GL_DEPTH_TEST)


def renderFrets(self, visibility, song, controls):
w = self.boardWidth / self.strings
size = (.22, .22)
Expand Down
4 changes: 2 additions & 2 deletions src/Font.py
Expand Up @@ -145,7 +145,7 @@ def setCustomGlyph(self, character, texture):
"""
pass

def render(self, text, pos = (0, 0), rotate = 0, scale = DEFAULT_SCALE, shadowoffset = (.0022, .0005), align = LEFT, new = False, shadow = False, outline = False):
def render(self, text, pos = (0, 0), rotate = 0, scale = DEFAULT_SCALE, shadowoffset = (.0022, .0005), align = LEFT, new = False, shadow = False, outline = False, shadowOpacity = 1.0):
"""
Draw some text.
Expand Down Expand Up @@ -211,7 +211,7 @@ def drawSquare(w,h,tw,th):

if self.shadow or shadow:
with cmgl.PushedAttrib(GL_CURRENT_BIT):
glColor4f(0, 0, 0, glGetDoublev(GL_CURRENT_COLOR)[3])
glColor4f(0, 0, 0, glGetDoublev(GL_CURRENT_COLOR)[3]*shadowOpacity)
with cmgl.PushedMatrix():
glTranslatef(shadowoffset[0], shadowoffset[1], 0)
drawSquare(w,h,tw,th)
Expand Down
20 changes: 7 additions & 13 deletions src/GameEngine.py
Expand Up @@ -279,24 +279,16 @@ def sortOptionsByKey(dict):
Config.define("game", "script_lyric_pos", int, 0, text = _("Script Lyric Position"), options = {0: _("Bottom"), 1: _("Top")}, tipText = _("Display script lyrics at either the bottom or top of the screen.")) #MFH - script.txt lyric display position
Config.define("game", "hopo_indicator", bool, False, text = _("Show HO/PO Indicator"), options = {False: _("No"), True: _("Yes")}, tipText = _("If enabled, 'HOPO' will appear in game. When there are HOPO notes active, it will turn white."))
Config.define("performance", "star_score_updates", int, 1, text = _("Star Updates"), options = {0: _("On Hit"), 1: _("Score Change")}, tipText = _("If set to 'On Hit', your star score will only be checked when you hit a note. If set to 'Score Change', your star score will constantly update. (This is affected by the 'Performance' quickset)"))
Config.define("performance", "star_continuous_fillup", bool, True, text = _("Partial Star Continuous Fillup"), options = {False: _("No"), True: _("Yes")}, tipText = _("Sets whether your partial stars will fill up gradually ('Yes') or in chunks. (This is affected by the 'Performance' quickset)")) #stump
Config.define("game", "kill_debug", bool, False, text = _("Effects Debug"), options = {False: _("Off"), True: _("On")}, tipText = _("If enabled, will show on-screen the raw data of your killswitch/whammy."))
Config.define("game", "show_unused_text_events", bool, False, text = _("Show Unused Events"), options = {False: _("No"), True: _("Yes")}, tipText = _("If enabled, various MIDI events not used by the game will be shown on-screen."))
Config.define("game", "rb_midi_lyrics", int, 1, text = _("Show Lyrics in All Modes"), options = {0: _("No"), 1: _("Single Player"), 2: _("Always")}, tipText = _("Sets whether or not MIDI lyrics will be displayed in modes without a vocalist. 'Single Player' will only show lyrics when in Solo modes."))
Config.define("game", "rb_midi_sections", int, 0, text = _("Show MIDI Sections"), options = {0: _("No"), 1: _("Single Player"), 2: _("Always")}, tipText = _("Sets whether or not to scroll the names of sections as marked in the MIDI files."))
Config.define("performance", "in_game_stats", int, 0, text = _("Show In-Game Stats"), options = {0: _("Off"), 1: _("By Theme"), 2: _("On")}, tipText = _("Sets whether or not to show detailed stats as you play. 'By Theme' leaves it to the theme creator."))
Config.define("game", "in_game_stars", int, 1, text = _("Show Stars In-Game"), options = {0: _("Off"), 1: _("By Theme"), 2: _("On")}, tipText = _("Sets whether or not to show your star score as you play. 'By Theme' leaves it to the theme creator."))
Config.define("game", "partial_stars", int, 1, text = _("Show Partial Stars"), options = {0: _("Off"), 1: _("On")}, tipText = _("Sets whether or not to show partial stars, if available"))
Config.define("game", "hopo_debug_disp", int, 0, text = _("HO/PO Debug"), options = {0: _("Off"), 1: _("On")}, tipText = _("If enabled, various log messages will be recorded regarding the HO/PO system. Please leave this disabled if submitting logs for bug reports unless you are certain it is necessary."))
Config.define("game", "gsolo_accuracy_disp", int, 1, text = _("Show Solo Stats"), options = {0: _("Off"), 1: _("Percent"), 2: _("Detail")}, tipText = _("Sets whether to show your solo results when you finish a solo. 'Percent' will only show the percentage, while 'Detail' includes additional information."))
Config.define("game", "decimal_places", int, 1, text = _("Stat Decimal Places"), options = dict([(n, n) for n in range(0, 3)]), tipText = _("Determines how many decimal places will be noted in displaying stats."))
Config.define("game", "star_scoring", int, 3, text = _("Star Scoring Style"), options = sortOptionsByKey({0: _("Accuracy"), 1: _("GH"), 2: _("RB"), 3: _("RB+GH"), 4: _("RB2")}), tipText = _("Sets which system to use to calculate your star score."))#MFH
Config.define("game", "gsolo_acc_pos", int, 3, text = _("Solo Stat Positioning"), options = sortOptionsByKey({0: _("Right"), 1: _("Center"), 2: _("Left"), 3: _("Rock Band")}), tipText = _("Sets where your solo result stats will be displayed."))#MFH,(racer: added RB)
Config.define("game", "game_time", int, 1, text = _("Time Display Format"), options = {0: _("Off"), 1: _("Countdown"), 2: _("Elapsed")}, tipText = _("Sets whether the song time is displayed as time elapsed, time remaining, or not at all")) #MFH
Config.define("game", "in_game_font_shadowing", bool, False, text = _("In-Game Font Shadow"), options = {False: _("Off"), True: _("On")}, tipText = _("Sets whether or not a shadowed font will be used, if available."))
Config.define("game", "solo_frame", int, 1, text = _("Show Solo Frame"), options = {0: _("Off"), 1: _("On")}, tipText = _("Sets whether to show a frame around the solo stats, if available."))
Config.define("game", "starfx", bool, True, text = _("GH SP Lights"), options = {True: _("On"), False: _("Off")}, tipText = _("Sets whether to fade images over the starpower bulbs in GH themes when fully lit."))#blazingamer
Config.define("game", "small_rb_mult", int, 1, text = _("RB Small 1x Multiplier"), options = {0: _("Off"), 1: _("By Theme"), 2: _("On")}, tipText = _("When enabled, RB-type themes will have a smaller mult image when the multiplier is at 1x. 'By Theme' leaves it to the theme creator."))#blazingamer
Config.define("game", "midi_lyric_mode", int, 2, text = _("Lyric Display Mode"), options = {0: _("Scrolling"), 1: _("Simple Lines"), 2: _("2-Line")}, tipText = _("Sets the display mode for MIDI lyrics. Both 'Simple Lines' and '2-Line' will show as single phrases when playing the vocal part."))
Config.define("game", "vocal_scroll", int, 2, text = _("Lyric Speed Mode"), options = sortOptionsByKey({0: _("BPM"), 1: _("Difficulty"), 2: _("BPM & Diff")}), tipText = _("Sets what determines the speed of the scrolling lyrics."))
Config.define("game", "vocal_speed", int, 100, text = _("Lyric Speed Percent"), options = dict([(n, n) for n in range(10, 410, 10)]), tipText = _("Sets how quickly lyrics will scroll."))
Expand Down Expand Up @@ -957,19 +949,21 @@ def draw3Dtex(self, image, vertex, texcoord, coord = None, scale = None, rot = N
if depth == True:
glDepthMask(1)

triangVtx = np.array(
if not isinstance(vertex, np.ndarray):
vertex = np.array(
[[ vertex[0], vertscale, vertex[1]],
[ vertex[2], vertscale, vertex[1]],
[ vertex[0], -vertscale, vertex[3]],
[ vertex[2], -vertscale, vertex[3]]], dtype=np.float32)

textriangVtx = np.array(

if not isinstance(texcoord, np.ndarray):
texcoord = np.array(
[[texcoord[0], texcoord[1]],
[texcoord[2], texcoord[1]],
[texcoord[0], texcoord[3]],
[texcoord[2], texcoord[3]]], dtype=np.float32)

cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=triangVtx, colors=col_array, texcoords=textriangVtx)
cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=vertex, colors=col_array, texcoords=texcoord)

if depth == True:
glDepthMask(0)
Expand Down

0 comments on commit 5ddd514

Please sign in to comment.