From 46d46c9caef7d6e5cb5c9ac00cf6ff525fe9ce21 Mon Sep 17 00:00:00 2001 From: Tom Skinner Date: Tue, 2 Aug 2011 16:29:24 -0600 Subject: [PATCH] resort a few config key sections; fix setlist path handling --- src/Dialogs.py | 2 ++ src/GameEngine.py | 23 +++++++++++------------ src/Settings.py | 40 ++++++++++++++++++++-------------------- src/SongChoosingScene.py | 4 ++-- 4 files changed, 35 insertions(+), 34 deletions(-) diff --git a/src/Dialogs.py b/src/Dialogs.py index eb1abd3ef..3bd7ebcef 100644 --- a/src/Dialogs.py +++ b/src/Dialogs.py @@ -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) diff --git a/src/GameEngine.py b/src/GameEngine.py index d853c1063..f8ad3ea25 100644 --- a/src/GameEngine.py +++ b/src/GameEngine.py @@ -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 @@ -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.")) @@ -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.")) @@ -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.")) diff --git a/src/Settings.py b/src/Settings.py index f42b91f32..a91029141 100644 --- a/src/Settings.py +++ b/src/Settings.py @@ -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) @@ -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 ] @@ -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) @@ -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 @@ -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: @@ -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 @@ -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) @@ -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) @@ -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) @@ -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) diff --git a/src/SongChoosingScene.py b/src/SongChoosingScene.py index 178575a9e..9424d0d0f 100644 --- a/src/SongChoosingScene.py +++ b/src/SongChoosingScene.py @@ -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