Skip to content

Commit

Permalink
resort a few config key sections;
Browse files Browse the repository at this point in the history
fix setlist path handling
  • Loading branch information
akedrou committed Aug 2, 2011
1 parent 4eb3063 commit 46d46c9
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 34 deletions.
2 changes: 2 additions & 0 deletions src/Dialogs.py
Expand Up @@ -518,6 +518,8 @@ def __init__(self, engine, masks, path, prompt = "", dirSelect = False):
driveLetters=win32api.GetLogicalDriveStrings().split('\x00')[:-1]
self.driveLetters = []
#Here we should filter some drives out. Anything inaccessible, or with no space.
#I have been playing around with other scenarios for figuring out whether or not a drive
#is suitable, but this seemed the simplest. (akedrou)
for drive in driveLetters:
try:
size = win32file.GetDiskFreeSpaceEx(drive)
Expand Down
23 changes: 11 additions & 12 deletions src/GameEngine.py
Expand Up @@ -171,7 +171,7 @@ def sortOptionsByKey(dict):
Config.define("setlist", "keep_play_count", int, 1, text = _("Remember Play Count"), options = {0: _("No"), 1: _("Yes")}, tipText = _("Keeps track of how many times you've played each song."))
Config.define("setlist", "sort_direction", int, 0, text = _("Sort Direction"), options = {0: _("Ascending"), 1: _("Descending")}, tipText = _("Choose whether to sort in ascending (A-Z) or descending (Z-A) order."))
Config.define("setlist", "sort_order", int, 0, text = _("Sort Setlist By"), options = sortOptionsByKey({0: _("Title"), 1: _("Artist"), 2: _("Times played"), 3: _("Album"), 4: _("Genre"), 5: _("Year"), 6: _("Band Difficulty"), 7: _("Difficulty"), 8:_("Song Collection")}), tipText = _("Choose how to sort the setlist by default."))
Config.define("performance", "disable_libcount", bool, True, text = _("Show Setlist Size"), options = {False: _("Yes"), True: _("No")}, tipText = _("Show the number of songs inside of each setlist."))
Config.define("setlist", "disable_libcount", bool, True, text = _("Show Setlist Size"), options = {False: _("Yes"), True: _("No")}, tipText = _("Show the number of songs inside of each setlist."))
Config.define("setlist", "songlist_difficulty", int, 0, text = _("Difficulty (Setlist Score)"), options = difficulties, tipText = _("Sets the default difficulty displayed in the setlist score."))
Config.define("setlist", "songlist_instrument", int, 0, text = _("Instrument (Setlist Score)"), options = parts, tipText = _("Sets the default part displayed in the setlist score.")) #MFH

Expand All @@ -194,7 +194,7 @@ def sortOptionsByKey(dict):
Config.define("game", "whammy_saves_starpower", bool, False, text = _("Effects Save SP"), options = {False: _("No"), True: _("Yes")}, tipText = _("If enabled, whammying while in SP will slow down its decrease. And your score will be handicapped by 5%."))
Config.define("game", "bass_groove_enable", int, 1, text = _("Bass Groove"), options = {0: _("Off"), 1: _("By Theme"), 2: _("By MIDI"), 3: _("On")}, tipText = _("Enable or disable bass groove (additional score multiplier for bass)")) #MFH
Config.define("game", "note_hit_window", int, 2, text = _("Note Hit Window"), options = sortOptionsByKey({0: _("Tightest"), 1: _("Tight"), 2: _("Standard"), 3: _("Wide"), 4: _("Widest")}), tipText = _("Sets how accurate you need to be while playing."))#racer blazingamer
Config.define("handicap", "early_hit_window", int, 0, text = _("Early Hit Window"), options = sortOptionsByKey({0: _("Auto"), 1: _("None (RB2)"), 2: _("Half (GH2)"), 3: _("Full (FoF)")}), tipText = _("Sets how much time before the note is part of the hit window. 'Auto' uses the MIDI to determine.")) #MFH
Config.define("game", "early_hit_window", int, 0, text = _("Early Hit Window"), options = sortOptionsByKey({0: _("Auto"), 1: _("None (RB2)"), 2: _("Half (GH2)"), 3: _("Full (FoF)")}), tipText = _("Sets how much time before the note is part of the hit window. 'Auto' uses the MIDI to determine.")) #MFH
Config.define("game", "gh2_sloppy", int, 0, text = _("GH2 Sloppy Mode"), options = {0: _("Off"), 1: _("On")}, tipText = _("Sloppy mode allows you to hold higher frets while tapping lower frets during HO/PO sections. This will lower your score by 25%."))
Config.define("game", "hopo_frequency", int, 2, text = _("HO/PO Frequency"), options = sortOptionsByKey({0: _("Least"), 1: _("Less"), 2: _("Normal"), 3: _("More"), 4: _("Even More"), 5: _("Most")}), tipText = _("Sets the window used to determine HO/PO notes. Increasing the frequency will reduce your score, and lower settings will give you a tiny bonus."))
Config.define("game", "fail_mode", bool, True, text = _("No Fail"), options = {True: _("Off"), False: _("On")}, tipText = _("Sets whether or not you can fail out of a song."))
Expand All @@ -207,15 +207,15 @@ def sortOptionsByKey(dict):
Config.define("rules", "face_off_fail", bool, True, text = _("Failing"), options = {True: _("Enabled"), False: _("Disabled")}, tipText = _("Sets whether you can fail in Face-Off Mode"))

#Battle Items (Q)
Config.define("game", "battle_Whammy", int, 1, text = _("Whammy"), options = {0: _("Off"), 1: _("On")}, tipText = _("Makes opponent miss notes until the whammy bar is pushed a few times"))
Config.define("game", "battle_Diff_Up", int, 1, text = _("Difficulty Up"), options = {0: _("Off"), 1: _("On")}, tipText = _("Ups opponent's difficulty for a while (if not playing on Expert)"))
Config.define("game", "battle_String_Break", int, 1, text = _("String Break"), options = {0: _("Off"), 1: _("On")}, tipText = _("Breaks a string, causing your opponent to miss notes on that fret until they push the fret button several times."))
Config.define("game", "battle_Double", int, 1, text = _("Double Notes"), options = {0: _("Off"), 1: _("On")}, tipText = _("Makes single notes into chords, and chords into even bigger ones."))
Config.define("game", "battle_Death_Drain", int, 2, text = _("Death Drain"), options = {0: _("Off"), 1: _("On"), 2: _("Sudden Death Only")}, tipText = _("Drains your opponents life until they die. 'Sudden Death Only' keeps this from appearing until you reach sudden death mode."))
Config.define("game", "battle_Amp_Overload", int, 1, text = _("Amp Overload"), options = {0: _("Off"), 1: _("On")}, tipText = _("Makes opponent's amp flip out, making notes disappear and reappear randomly."))
Config.define("game", "battle_Switch_Controls", int, 1, text = _("Switch Controls"), options = {0: _("Off"), 1: _("On")}, tipText = _("Switches opponent to (or from) lefty mode for a bit!"))
Config.define("game", "battle_Steal", int, 1, text = _("Steal Object"), options = {0: _("Off"), 1: _("On")}, tipText = _("Steals an object your opponent has."))
Config.define("game", "battle_Tune", int, 1, text = _("Guitar Tune"), options = {0: _("Off"), 1: _("On")}, tipText = _("Makes opponent miss all notes until they play a scale."))
Config.define("rules", "battle_Whammy", int, 1, text = _("Whammy"), options = {0: _("Off"), 1: _("On")}, tipText = _("Makes opponent miss notes until the whammy bar is pushed a few times"))
Config.define("rules", "battle_Diff_Up", int, 1, text = _("Difficulty Up"), options = {0: _("Off"), 1: _("On")}, tipText = _("Ups opponent's difficulty for a while (if not playing on Expert)"))
Config.define("rules", "battle_String_Break", int, 1, text = _("String Break"), options = {0: _("Off"), 1: _("On")}, tipText = _("Breaks a string, causing your opponent to miss notes on that fret until they push the fret button several times."))
Config.define("rules", "battle_Double", int, 1, text = _("Double Notes"), options = {0: _("Off"), 1: _("On")}, tipText = _("Makes single notes into chords, and chords into even bigger ones."))
Config.define("rules", "battle_Death_Drain", int, 2, text = _("Death Drain"), options = {0: _("Off"), 1: _("On"), 2: _("Sudden Death Only")}, tipText = _("Drains your opponents life until they die. 'Sudden Death Only' keeps this from appearing until you reach sudden death mode."))
Config.define("rules", "battle_Amp_Overload", int, 1, text = _("Amp Overload"), options = {0: _("Off"), 1: _("On")}, tipText = _("Makes opponent's amp flip out, making notes disappear and reappear randomly."))
Config.define("rules", "battle_Switch_Controls", int, 1, text = _("Switch Controls"), options = {0: _("Off"), 1: _("On")}, tipText = _("Switches opponent to (or from) lefty mode for a bit!"))
Config.define("rules", "battle_Steal", int, 1, text = _("Steal Object"), options = {0: _("Off"), 1: _("On")}, tipText = _("Steals an object your opponent has."))
Config.define("rules", "battle_Tune", int, 1, text = _("Guitar Tune"), options = {0: _("Off"), 1: _("On")}, tipText = _("Makes opponent miss all notes until they play a scale."))

#Co-Op Rules
Config.define("rules", "coop_rockmeter", int, 2, text = _("Co-Op Rockmeter"), options = {0: _("Solo"), 1: _("Band"), 2: _("Both")}, tipText = _("Sets who controls the rockmeter. Solo means every member has their own, Band means you're in it together. In both, you are responsible for both."))
Expand Down Expand Up @@ -342,7 +342,6 @@ def sortOptionsByKey(dict):
Config.define("debug", "use_new_vbpm_beta", int, 0, text = _("New BPM Logic"), options = {0: _("Off"), 1: _("On")}, tipText = _("If enabled, the game will attempt to use the new BPM logic. This is not a finished feature. Use at your own risk."))
Config.define("debug", "use_new_song_database", bool, False, text=_("New Song Database Code"), options={False: _("Off"), True: _("On")}, tipText=_("Activates the new, incomplete song database code.")) #stump
Config.define("debug", "show_raw_vocal_data", int, 0, text = _("Show Raw Vocal Data"), options = {0: _("Off"), 1: _("On")}, tipText = _("If enabled, various information about the microphone input will be show in text on screen. Probably only needed for vocal debugging."))
Config.define("game", "disable_vbpm", bool, False, text = _("Disable Variable BPM"), options = {False: _("No"), True: _("Yes")}, tipText = _("This will disable the use of the Variable BPM logic."))

#MFH - log settings
Config.define("log", "log_ini_reads", int, 0, text = _("Log INI Reads"), options = {0: _("No"), 1: _("Yes")}, tipText = _("Logs any read to an INI file. This is unnecessary information in bug reports; please leave it disabled unless you are certain it is relevant."))
Expand Down
40 changes: 20 additions & 20 deletions src/Settings.py
Expand Up @@ -693,15 +693,15 @@ def __init__(self, engine):
self.jurgenSettingsMenu = Menu.Menu(self.engine, jurgenSettings, pos = (self.opt_text_x, self.opt_text_y), textColor = self.opt_text_color, selectedColor = self.opt_selected_color)

self.battleObjectSettings = [
ConfigChoice(engine, engine.config, "game", "battle_Whammy", autoApply = True),
ConfigChoice(engine, engine.config, "game", "battle_Diff_Up", autoApply = True),
ConfigChoice(engine, engine.config, "game", "battle_String_Break", autoApply = True),
ConfigChoice(engine, engine.config, "game", "battle_Double", autoApply = True),
ConfigChoice(engine, engine.config, "game", "battle_Death_Drain", autoApply = True),
ConfigChoice(engine, engine.config, "game", "battle_Amp_Overload", autoApply = True),
ConfigChoice(engine, engine.config, "game", "battle_Switch_Controls", autoApply = True),
ConfigChoice(engine, engine.config, "game", "battle_Steal", autoApply = True),
ConfigChoice(engine, engine.config, "game", "battle_Tune", autoApply = True),
ConfigChoice(engine, engine.config, "rules", "battle_Whammy", autoApply = True),
ConfigChoice(engine, engine.config, "rules", "battle_Diff_Up", autoApply = True),
ConfigChoice(engine, engine.config, "rules", "battle_String_Break", autoApply = True),
ConfigChoice(engine, engine.config, "rules", "battle_Double", autoApply = True),
ConfigChoice(engine, engine.config, "rules", "battle_Death_Drain", autoApply = True),
ConfigChoice(engine, engine.config, "rules", "battle_Amp_Overload", autoApply = True),
ConfigChoice(engine, engine.config, "rules", "battle_Switch_Controls", autoApply = True),
ConfigChoice(engine, engine.config, "rules", "battle_Steal", autoApply = True),
ConfigChoice(engine, engine.config, "rules", "battle_Tune", autoApply = True),
]

self.battleObjectSettingsMenu = Menu.Menu(self.engine, self.battleObjectSettings, pos = (self.opt_text_x, self.opt_text_y), textColor = self.opt_text_color, selectedColor = self.opt_selected_color)
Expand Down Expand Up @@ -969,7 +969,7 @@ def __init__(self, engine):
ConfigChoice(engine, engine.config, "audio", "disable_preview", autoApply = True), #myfingershurt
ConfigChoice(engine, engine.config, "setlist", "songlist_instrument", autoApply = True), #MFH
ConfigChoice(engine, engine.config, "setlist", "songlist_difficulty", autoApply = True), #evilynux
ConfigChoice(engine, engine.config, "performance", "disable_libcount", autoApply = True, isQuickset = 1),
ConfigChoice(engine, engine.config, "setlist", "disable_libcount", autoApply = True, isQuickset = 1),
ConfigChoice(engine, engine.config, "performance", "cache_song_metadata", autoApply = True, isQuickset = 1), #stump
ConfigChoice(engine, engine.config, "setlist", "nil_show_next_score", autoApply = True), #MFH
]
Expand All @@ -993,7 +993,7 @@ def __init__(self, engine):
ConfigChoice(engine, engine.config, "game", "hopo_frequency", autoApply = True),
ConfigChoice(engine, engine.config, "game", "fail_mode", autoApply = True),
ConfigChoice(engine, engine.config, "audio", "speed_factor", autoApply = True), #MFH
ConfigChoice(engine, engine.config, "handicap", "early_hit_window", autoApply = True), #MFH
ConfigChoice(engine, engine.config, "game", "early_hit_window", autoApply = True), #MFH
(_("Mod settings"), self.modSettingsMenu, _("Enable or disable any mods you have installed.")),
]
self.cheatMenu = Menu.Menu(engine, self.cheats, pos = (self.opt_text_x, self.opt_text_y), textColor = self.opt_text_color, selectedColor = self.opt_selected_color)
Expand Down Expand Up @@ -1116,8 +1116,8 @@ def baseLibrarySelect(self):
Log.debug("settings.baseLibrarySelect function call...")
newPath = Dialogs.chooseFile(self.engine, masks = ["*/*"], prompt = _("Choose a new songs directory."), dirSelect = True)
if newPath != None:
Config.set("setlist", "base_library", os.path.dirname(newPath))
Config.set("setlist", "selected_library", os.path.basename(newPath))
Config.set("setlist", "base_library", newPath)
Config.set("setlist", "selected_library", "")
Config.set("setlist", "selected_song", "")
self.engine.resource.refreshBaseLib() #myfingershurt - to let user continue with new songpath without restart

Expand Down Expand Up @@ -1283,7 +1283,7 @@ def refreshCheatSettings(self, init = False):
ConfigChoice(self.engine, self.engine.config, "game", "hopo_frequency", autoApply = True),
ConfigChoice(self.engine, self.engine.config, "game", "fail_mode", autoApply = True),
ConfigChoice(self.engine, self.engine.config, "audio", "speed_factor", autoApply = True), #MFH
ConfigChoice(self.engine, self.engine.config, "handicap", "early_hit_window", autoApply = True), #MFH
ConfigChoice(self.engine, self.engine.config, "game", "early_hit_window", autoApply = True), #MFH
(_("Mod settings"), self.modSettingsMenu, _("Enable or disable any mods you have installed.")),]
choices.extend(choicesb)
if init:
Expand Down Expand Up @@ -1341,8 +1341,8 @@ def baseLibrarySelect(self):
Log.debug("settings.baseLibrarySelect function call...")
newPath = Dialogs.chooseFile(self.engine, masks = ["*/*"], prompt = _("Choose a new songs directory."), dirSelect = True)
if newPath != None:
Config.set("setlist", "base_library", os.path.dirname(newPath))
Config.set("setlist", "selected_library", os.path.basename(newPath))
Config.set("setlist", "base_library", newPath)
Config.set("setlist", "selected_library", "")
Config.set("setlist", "selected_song", "")
self.engine.resource.refreshBaseLib() #myfingershurt - to let user continue with new songpath without restart

Expand Down Expand Up @@ -1412,7 +1412,7 @@ def quickset(config):
config.set("menu", "use_graphical_submenu", 0)
config.set("audio", "enable_crowd_tracks", 0)
config.set("performance", "static_strings", True)
config.set("performance", "disable_libcount", True)
config.set("setlist", "disable_libcount", True)
config.set("performance", "killfx", 2)
config.set("performance", "star_score_updates", 0)
config.set("performance", "cache_song_metadata", False)
Expand All @@ -1436,7 +1436,7 @@ def quickset(config):
config.set("menu", "use_graphical_submenu", 0)
config.set("audio", "enable_crowd_tracks", 1)
config.set("performance", "static_strings", True)
config.set("performance", "disable_libcount", True)
config.set("setlist", "disable_libcount", True)
config.set("performance", "killfx", 0)
config.set("performance", "star_score_updates", 0)
config.set("performance", "cache_song_metadata", True)
Expand All @@ -1459,7 +1459,7 @@ def quickset(config):
config.set("menu", "use_graphical_submenu", 1)
config.set("audio", "enable_crowd_tracks", 1)
config.set("performance", "static_strings", True)
config.set("performance", "disable_libcount", True)
config.set("setlist", "disable_libcount", True)
config.set("performance", "killfx", 0)
config.set("performance", "star_score_updates", 1)
config.set("performance", "cache_song_metadata", True)
Expand All @@ -1483,7 +1483,7 @@ def quickset(config):
config.set("menu", "use_graphical_submenu", 1)
config.set("audio", "enable_crowd_tracks", 1)
config.set("performance", "static_strings", False)
config.set("performance", "disable_libcount", False)
config.set("setlist", "disable_libcount", False)
config.set("performance", "killfx", 0)
config.set("performance", "star_score_updates", 1)
config.set("performance", "cache_song_metadata", True)
Expand Down
4 changes: 2 additions & 2 deletions src/SongChoosingScene.py
Expand Up @@ -794,10 +794,10 @@ def keyPressed(self, key, unicode):
return
if self.song:
self.song.fadeout(1000)
if self.library != Song.DEFAULT_LIBRARY and not self.tut:
if not self.tut:
self.initialItem = self.library
self.library = os.path.dirname(self.library)
if self.library == os.path.join("..", self.engine.config.get("setlist", "base_library")):
if self.library == os.path.dirname(self.engine.config.get("setlist", "base_library")):
self.quit()
return
self.selectedItem = None
Expand Down

0 comments on commit 46d46c9

Please sign in to comment.