#---------------------general Mod audio settings---------------------# define persistent.KoGa3main_menu_music = True label KoGa3MusicCheck: #label for main Mod checking existing Music addon return init 999 python: config.has_music = True init python: # main menu music / default volumes if not persistent.KoGa3set_volumes: config.default_music_volume = 0.5 config.default_sfx_volume = 0.5 config.default_voice_volume = 0.3 persistent.KoGa3set_volumes = True if persistent.KoGa3main_menu_music is True: config.main_menu_music = "/MainMenuTrack.mp3" else: config.main_menu_music = "" renpy.music.stop(channel=u'music', fadeout=None) # needed for jukebox player def convert_float_into_time(t): i, f = divmod(t, 1) i = int(i) m, s = divmod(i, 60) h, m = divmod(m, 60) return "{:02}:{:02}".format(m, s) # new audio channel for the game #not used for this game renpy.music.register_channel("music1", mixer="voice") renpy.music.register_channel("sound1", mixer="sfx") renpy.music.register_channel("sound2", mixer="sfx") # #---------------------Check for Jukebox icons after load---------------------# # label after_load: # $ KoGa3Temp1 = renpy.music.get_playing(channel='music') # if KoGa3Temp1 == "/MainMenuTrack.mp3": # stop music fadeout 1.0 #---------------------setting default for QuickMusic---------------------# init python: # config.default_music_volume = 0.5 #info: already set in main Mod # config.default_sfx_volume = 0.5 # config.default_voice_volume = 0.5 # if persistent.KoGa3main_menu_music is True: # config.main_menu_music = "/music/Fill The Void_cut.mp3" # else: # config.main_menu_music = "" # renpy.music.stop(channel=u'music', fadeout=None) # needed for jukebox player def convert_float_into_time(t): i, f = divmod(t, 1) i = int(i) m, s = divmod(i, 60) h, m = divmod(m, 60) return "{:02}:{:02}".format(m, s) # new audio channel for the game #not used for this game renpy.music.register_channel("music1", mixer="voice") renpy.music.register_channel("sound1", mixer="sfx") renpy.music.register_channel("sound2", mixer="sfx") #---------------------set Jukebox menu---------------------# screen KoGa3ScreenJukebox: default soundis = False default p = None if not main_menu: add "/KoGa3MenuBack_settings.png" $ iTracks2 = 0 modal True vbox: xalign 0.5 spacing -12 null height (34) hbox: timer .1 repeat True action SetScreenVariable("p",p) $ KoGa3CurrentMusicName = renpy.music.get_playing(channel='music') if isinstance(renpy.music.is_playing(channel='music'), int): if renpy.music.get_pos(channel='music'): textbutton ("━━━━━━━━━━━━━━━━━━━━━━━━ Jukebox ━━━━━━━━━━━ "): text_style "KoGa3_1_button_text" sensitive False action NullAction() $ p = renpy.music.get_pos(channel='music') $ p_variable = " {} / {}".format(convert_float_into_time(renpy.music.get_pos(channel='music')), convert_float_into_time(renpy.music.get_duration(channel='music'))) text ("[p_variable]"): ypos 8 style "KoGa3_1_text" else: textbutton ("━━━━━━━━━━━━━━━━━━━━━━━━ Jukebox ━━━━━━━━━━━━━━━━━━━━━━━━"): text_style "KoGa3_1_button_text" sensitive False action NullAction() hbox: spacing 15 if iTracks > 0 and iTracks < 61: textbutton ("[iTracks] tracks (a-z):"): text_style "KoGa3_1_button_text" sensitive False action NullAction() hbox: spacing 20 if KoGa3JukeboxButton is 1: if iTracks < 13: textbutton ("1-[iTracks]"): text_style "KoGa3_1_button_text" selected True action NullAction() else: textbutton ("1-12"): text_style "KoGa3_1_button_text" selected True action NullAction() else: if iTracks < 13: textbutton ("1-[iTracks]"): text_style "KoGa3_1_button_text" selected False action [ SetVariable("KoGa3JukeboxButton", 1) ] else: textbutton ("1-12"): text_style "KoGa3_1_button_text" selected False action [ SetVariable("KoGa3JukeboxButton", 1) ] if iTracks > 12: if KoGa3JukeboxButton is 2: if iTracks < 25: textbutton ("13-[iTracks]"): text_style "KoGa3_1_button_text" selected True action NullAction() else: textbutton ("13-24"): text_style "KoGa3_1_button_text" selected True action NullAction() else: if iTracks < 25: textbutton ("13-[iTracks]"): text_style "KoGa3_1_button_text" selected False action [ SetVariable("KoGa3JukeboxButton", 2) ] else: textbutton ("13-24"): text_style "KoGa3_1_button_text" selected False action [ SetVariable("KoGa3JukeboxButton", 2) ] if iTracks > 24: if KoGa3JukeboxButton is 3: if iTracks < 37: textbutton ("25-[iTracks]"): text_style "KoGa3_1_button_text" selected True action NullAction() else: textbutton ("25-36"): text_style "KoGa3_1_button_text" selected True action NullAction() else: if iTracks < 37: textbutton ("25-[iTracks]"): text_style "KoGa3_1_button_text" selected False action [ SetVariable("KoGa3JukeboxButton", 3) ] else: textbutton ("25-36"): text_style "KoGa3_1_button_text" selected False action [ SetVariable("KoGa3JukeboxButton", 3) ] if iTracks > 36: if KoGa3JukeboxButton is 4: if iTracks < 49: textbutton ("37-[iTracks]"): text_style "KoGa3_1_button_text" selected True action NullAction() else: textbutton ("37-48"): text_style "KoGa3_1_button_text" selected True action NullAction() else: if iTracks < 49: textbutton ("37-[iTracks]"): text_style "KoGa3_1_button_text" selected False action [ SetVariable("KoGa3JukeboxButton", 4) ] else: textbutton ("37-48"): text_style "KoGa3_1_button_text" selected False action [ SetVariable("KoGa3JukeboxButton", 4) ] if iTracks > 48: if KoGa3JukeboxButton is 5: if iTracks < 61: textbutton ("49-[iTracks]"): text_style "KoGa3_1_button_text" selected True action NullAction() else: textbutton ("49-60"): text_style "KoGa3_1_button_text" selected True action NullAction() else: if iTracks < 61: textbutton ("49-[iTracks]"): text_style "KoGa3_1_button_text" selected False action [ SetVariable("KoGa3JukeboxButton", 5) ] else: textbutton ("49-60"): text_style "KoGa3_1_button_text" selected False action [ SetVariable("KoGa3JukeboxButton", 5) ] elif iTracks > 60: textbutton ("To many or no tracks detected ([iTracks]) / min=1, max=60"): text_style "KoGa3_1_button_text" selected True action NullAction() else: textbutton ("(no tracks detected)"): text_style "KoGa3_1_button_text" selected True action NullAction() if iTracks > 0 and iTracks < 61: textbutton ("────────────────────────────────────────────────────────"): text_style "KoGa3_1_button_text" sensitive False action NullAction() if KoGa3JukeboxButton is 1: if iTracks > 0: hbox: hbox: xsize 10 textbutton (""): text_style "KoGa3_1_button_text" sensitive False action NullAction() vbox: spacing -12 for i in files: $ iTracks2 = iTracks2 + 1 if iTracks2 < 13: $ TrackName = i $ i = "music/" + i textbutton ("[TrackName]"): text_style "KoGa3_1_button_text" sensitive True action [ Stop("music"), Stop("music1"), KoGa3MR_All1.Play(i) ] if KoGa3JukeboxButton is 2: if iTracks > 0: hbox: hbox: xsize 10 textbutton (""): text_style "KoGa3_1_button_text" sensitive False action NullAction() vbox: spacing -12 for i in files: $ iTracks2 = iTracks2 + 1 if iTracks2 > 12 and iTracks2 < 25: $ TrackName = i $ i = "music/" + i textbutton ("[TrackName]"): text_style "KoGa3_1_button_text" sensitive True action [ Stop("music"), Stop("music1"), KoGa3MR_All1.Play(i) ] if KoGa3JukeboxButton is 3: if iTracks > 0: hbox: hbox: xsize 10 textbutton (""): text_style "KoGa3_1_button_text" sensitive False action NullAction() vbox: spacing -12 for i in files: $ iTracks2 = iTracks2 + 1 if iTracks2 > 24 and iTracks2 < 37: $ TrackName = i $ i = "music/" + i textbutton ("[TrackName]"): text_style "KoGa3_1_button_text" sensitive True action [ Stop("music"), Stop("music1"), KoGa3MR_All1.Play(i) ] if KoGa3JukeboxButton is 4: if iTracks > 0: hbox: hbox: xsize 10 textbutton (""): text_style "KoGa3_1_button_text" sensitive False action NullAction() vbox: spacing -12 for i in files: $ iTracks2 = iTracks2 + 1 if iTracks2 > 36 and iTracks2 < 49: $ TrackName = i $ i = "music/" + i textbutton ("[TrackName]"): text_style "KoGa3_1_button_text" sensitive True action [ Stop("music"), Stop("music1"), KoGa3MR_All1.Play(i) ] if KoGa3JukeboxButton is 5: if iTracks > 0: hbox: hbox: xsize 10 textbutton (""): text_style "KoGa3_1_button_text" sensitive False action NullAction() vbox: spacing -12 for i in files: $ iTracks2 = iTracks2 + 1 if iTracks2 > 48 and iTracks2 < 61: $ TrackName = i $ i = "music/" + i textbutton ("[TrackName]"): text_style "KoGa3_1_button_text" sensitive True action [ Stop("music"), Stop("music1"), KoGa3MR_All1.Play(i) ] textbutton ("────────────────────────────────────────────────────────"): text_style "KoGa3_1_button_text" sensitive False action NullAction() hbox: hbox: xsize 360 textbutton ("Mod music volume: "): text_style "KoGa3_1_button_text" selected False sensitive False action NullAction() hbox: bar: ypos 5 xsize 495 value Preference("music volume") hbox: hbox: xsize 360 hbox: spacing 40 textbutton ("Pause"): text_style "KoGa3_1_button_text" sensitive True action PauseAudio('music', value="toggle") textbutton ("Stop"): text_style "KoGa3_1_button_text" selected False action [ # SetVariable("KoGa3JukeboxPlayNew", False), Stop("music"), Stop("music1") ] hbox: hbox: if KoGa3MainMenu == 1: if KoGa3CurrentMusicName == KoGa3CurrentMusic: textbutton (""): text_style "KoGa3_1_button_text" sensitive True action [ Play("music", MusicMenu1) ] else: textbutton ("back to the menu title"): text_style "KoGa3_1_button_text" sensitive True action [ Stop("music"), Stop("music1"), Play("music", MusicMenu1) ] if KoGa3MainMenu == 0: textbutton ("Repeat: "): text_style "KoGa3_1_button_text" sensitive False action NullAction() if KoGa3JukeboxPlayNew == "Single": textbutton ("single track"): text_style "KoGa3_1_button_text" selected False action [ #SetVariable("KoGa3Jukebox", ""), SetVariable("KoGa3JukeboxPlayNew", "All"), #Stop("music"), #Stop("music1"), KoGa3MR_All1.SetShuffle(False), KoGa3MR_All1.SetSingleTrack(False) ] if KoGa3JukeboxPlayNew == "All": textbutton ("all tracks"): text_style "KoGa3_1_button_text" selected False action [ #SetVariable("KoGa3Jukebox", ""), SetVariable("KoGa3JukeboxPlayNew", "AllShuffle"), #Stop("music"), #Stop("music1"), KoGa3MR_All1.SetShuffle(True), KoGa3MR_All1.SetSingleTrack(False) ] if KoGa3JukeboxPlayNew == "AllShuffle": textbutton ("all tracks (shuffle)"): text_style "KoGa3_1_button_text" selected False action [ #SetVariable("KoGa3Jukebox", ""), SetVariable("KoGa3JukeboxPlayNew", "Single"), #Stop("music"), #Stop("music1"), KoGa3MR_All1.SetShuffle(False), KoGa3MR_All1.SetSingleTrack(True) ] textbutton ("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"): text_style "KoGa3_1_button_text" sensitive False action NullAction() hbox: spacing 30 if main_menu: textbutton ("Back"): text_style "KoGa3_1_button_text" selected False action [ #SetVariable("KoGa3MainMenu", 0), Hide("KoGa3ScreenBlank"), Hide("KoGa3ScreenJukebox"), ] else: textbutton ("Back"): text_style "KoGa3_1_button_text" selected False action [ Hide("KoGa3ScreenJukebox"), Show("KoGa3GameSettings") ] textbutton _("Close"): text_style "KoGa3_1_button_text" selected False action [ SetVariable ("KoGa3ModMenuButtonPressed", False), Hide("KoGa3ScreenJukebox") ] #---------------------music room (max 48 tracks)---------------------# init python: #define import file names import re def file_list(dir=""): list = renpy.list_files() rv = [] for f in list: if re.match(dir,f): rv.append(f[(len(dir)):]) return rv default iTracks2 = 0 #for track pages 1-12 / 13-24 / 25-36 / 37-48 init python: iTracks = 0 #default for counting the tracks init python: #define the music room and counting the tracks files = file_list("music/") #import file list from folder ...music/ # Step 1. Create a MusicRoom instance. KoGa3MR_All1 = MusicRoom(channel=u'music', fadeout=0.2) # Step 2. Add music files. for i in files: i = "music/" + i iTracks = iTracks +1 KoGa3MR_All1.add(i, always_unlocked=True) default KoGa3MusicChannel = 0 default KoGa3JukeboxButton = 1 default MusicMenu1 = "/MainMenuTrack.mp3" default KoGa3CurrentMusic = MusicMenu1 default KoGa3Music = 0 #1 Music Mod / 0 WT Mod default KoGa3OriginalMusic = 1 default KoGa3OriginalSound = 1 default KoGa3Jukebox = "" default KoGa3JukeboxPlay = "All" #old variable) default KoGa3JukeboxPlayNew = "All" #default KoGa3SSound = 1 #variable sound effects (bump, knock, ...) #default KoGa3HSound = 1 #variable human sounds (haha, sigh, shh,...) #default KoGa3ESound = 1 #variable human erotic (moaning and kissing)