Pref rpy

Coding and VN Engine > pref_rpy

New Preference Screen init python: def window: _preferences.fullscreen = False return def fullscreen: _preferences.fullscreen = True return def transon: _preferences.transitions = 2 return def transoff: _preferences.transitions = 0 return def textadd: if _preferences.text_cps == 151: _preferences.text_cps = 0 if _preferences.text_cps < 151: if _preferences.text_cps != 0: _preferences.text_cps = _preferences.text_cps + 15 return def textsub: if _preferences.text_cps > 1 : _preferences.text_cps = _preferences.text_cps - 15 if _preferences.text_cps == 0: _preferences.text_cps = 151 return def musicadd: if _preferences.get_volume('music') < 1.0: _preferences.set_volume('music', _preferences.get_volume('music') + 0.1) if _preferences.get_volume('music') > 1.0: _preferences.set_volume('music', 1.0) return def musicsub: if _preferences.get_volume('music') > 0.0: _preferences.set_volume('music', _preferences.get_volume('music') - 0.1) if _preferences.get_volume('music') < 0.1: _preferences.set_volume('music', 0.0) return def soundadd: if _preferences.get_volume('sfx') < 1.0: _preferences.set_volume('sfx', _preferences.get_volume('sfx') + 0.1) if _preferences.get_volume('sfx') > 1.0: _preferences.set_volume('sfx', 1.0) return def soundsub: if _preferences.get_volume('sfx') > 0.0: _preferences.set_volume('sfx', _preferences.get_volume('sfx') - 0.1) if _preferences.get_volume('sfx') < 0.1: _preferences.set_volume('sfx', 0.0) return def skipseen: _preferences.skip_unseen = False return def skipall: _preferences.skip_unseen = True return
 * 1) Unfinished###
 * 1) Unfinished###

label newpref_menu: $ ui.image(ui_background) $ ui.image(ui_topborder,                 xpos=0,                  ypos=0                  ) $ ui.image(ui_botborder,                 xpos=0,                  ypos=500                  ) $ ui.frame(background=None,xpos=0.45, ypos=0.5, xanchor='center', yanchor='center') $ ui.grid(2, 6, padding=12, transpose=False) ##Window Mode $ ui.frame(xanchor='right',            yanchor='center',             xpos=1.0,             ypos=0.5             ) $ ui.text("Mode") $ ui.hbox(xanchor='center',            yanchor='center',             xpos=0.5,             ypos=0.5             ) $ ui.textbutton("Fullscreen", lambda: fullscreen) $ ui.textbutton("Windowed", lambda: window) $ ui.close ##Transitons $ ui.frame(xanchor='right',            yanchor='center',             xpos=1.0,             ypos=0.5             ) $ ui.text("Transitons") $ ui.hbox(xanchor='center',            yanchor='center',             xpos=0.5,             ypos=0.5             ) $ ui.textbutton("On", clicked= lambda: transon) $ ui.textbutton("Off", clicked= lambda: transoff) $ ui.close ##Text Speed $ ui.frame(xanchor='right',            yanchor='center',             xpos=1.0,             ypos=0.5             ) $ ui.text("Text Speed") $ ui.hbox(xanchor='center',            yanchor='center',             xpos=0.5,             ypos=0.5             ) $ ui.textbutton("-", clicked= lambda: (textsub, renpy.jump('newpref_menu'))) $ ui.frame(xminimum=50) $ ui.text("%s" % (_preferences.text_cps), xpos=0.5, xanchor='center') $ ui.textbutton("+", clicked= lambda: (textadd, renpy.jump('newpref_menu'))) $ ui.close ##Music Volume $ ui.frame(xanchor='right',            yanchor='center',             xpos=1.0,             ypos=0.5             ) $ ui.text("Music Volume") $ ui.hbox(xanchor='center',            yanchor='center',             xpos=0.5,             ypos=0.5             ) $ ui.textbutton("-", clicked= lambda: (musicsub, renpy.jump('newpref_menu'))) $ ui.frame(xminimum=50) $ ui.text("%s" % ( _preferences.get_volume('music')), xpos=0.5, xanchor='center') $ ui.textbutton("+", clicked= lambda: (musicadd, renpy.jump('newpref_menu'))) $ ui.close ##Sound Volume $ ui.frame(xanchor='right',            yanchor='center',             xpos=1.0,             ypos=0.5             ) $ ui.text("Sound Volume") $ ui.hbox(xanchor='center',            yanchor='center',             xpos=0.5,             ypos=0.5             ) $ ui.textbutton("-", clicked= lambda: (soundsub, renpy.jump('newpref_menu'))) $ ui.frame(xminimum=50) $ ui.text("%s" % ( _preferences.get_volume('sfx')), xpos=0.5, xanchor='center') $ ui.textbutton("+", clicked= lambda: (soundadd, renpy.jump('newpref_menu'))) $ ui.close ##Skip $ ui.frame(xanchor='right',            yanchor='center',             xpos=1.0,             ypos=0.5             ) $ ui.text("Skip Options") $ ui.hbox(xanchor='center',            yanchor='center',             xpos=0.5,             ypos=0.5             ) $ ui.textbutton("Seen", lambda: skipseen) $ ui.textbutton("All", lambda: skipall) $ ui.close $ ui.close $ ui.imagebutton(ui_return1,                        ui_return2,                         clicked=ui.jumps("_return"),                         xanchor=0.5,                         xpos=0.5,                         ypos=0.78                         ) $ ui.textbutton("Test",                       clicked= lambda: renpy.sound.play("beep.wav"),                        xanchor=0.5,                        xpos=0.7,                        ypos=0.6                        ) $ ui.interact(suppress_overlay=True, suppress_underlay=True, mouse='mainmenu') return