mirror of
https://github.com/csd4ni3l/connect-the-current.git
synced 2026-01-01 04:13:41 +01:00
remove music option from settings, fix preloading not working
This commit is contained in:
@@ -58,9 +58,7 @@ settings = {
|
|||||||
"FPS Limit": {"type": "slider", "min": 0, "max": 480, "config_key": "fps_limit", "default": 60},
|
"FPS Limit": {"type": "slider", "min": 0, "max": 480, "config_key": "fps_limit", "default": 60},
|
||||||
},
|
},
|
||||||
"Sound": {
|
"Sound": {
|
||||||
"Music": {"type": "bool", "config_key": "music", "default": True},
|
|
||||||
"SFX": {"type": "bool", "config_key": "sfx", "default": True},
|
"SFX": {"type": "bool", "config_key": "sfx", "default": True},
|
||||||
"Music Volume": {"type": "slider", "min": 0, "max": 100, "config_key": "music_volume", "default": 50},
|
|
||||||
"SFX Volume": {"type": "slider", "min": 0, "max": 100, "config_key": "sfx_volume", "default": 50},
|
"SFX Volume": {"type": "slider", "min": 0, "max": 100, "config_key": "sfx_volume", "default": 50},
|
||||||
},
|
},
|
||||||
"Miscellaneous": {
|
"Miscellaneous": {
|
||||||
|
|||||||
@@ -1,46 +1,55 @@
|
|||||||
import arcade.gui, arcade
|
import arcade.gui, arcade, os
|
||||||
|
|
||||||
button_texture = arcade.gui.NinePatchTexture(64 // 4, 64 // 4, 64 // 4, 64 // 4, arcade.load_texture("assets/graphics/button.png"))
|
_module_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
button_hovered_texture = arcade.gui.NinePatchTexture(64 // 4, 64 // 4, 64 // 4, 64 // 4, arcade.load_texture("assets/graphics/button_hovered.png"))
|
_assets_dir = os.path.join(os.path.dirname(_module_dir), 'assets')
|
||||||
|
|
||||||
wire_sound_effect = arcade.Sound("assets/sound/wire.mp3")
|
button_texture = arcade.gui.NinePatchTexture(
|
||||||
|
64 // 4, 64 // 4, 64 // 4, 64 // 4,
|
||||||
|
arcade.load_texture(os.path.join(_assets_dir, "graphics", "button.png"))
|
||||||
|
)
|
||||||
|
button_hovered_texture = arcade.gui.NinePatchTexture(
|
||||||
|
64 // 4, 64 // 4, 64 // 4, 64 // 4,
|
||||||
|
arcade.load_texture(os.path.join(_assets_dir, "graphics", "button_hovered.png"))
|
||||||
|
)
|
||||||
|
|
||||||
|
wire_sound_effect = arcade.Sound(os.path.join(_assets_dir, "sound", "wire.mp3"))
|
||||||
|
|
||||||
TEXTURE_MAP = {
|
TEXTURE_MAP = {
|
||||||
("line", "vertical", True): arcade.load_texture("assets/graphics/powered_lines/line/vertical.png"),
|
("line", "vertical", True): arcade.load_texture(os.path.join(_assets_dir, "graphics", "powered_lines", "line", "vertical.png")),
|
||||||
("line", "vertical", False): arcade.load_texture("assets/graphics/unpowered_lines/line/vertical.png"),
|
("line", "vertical", False): arcade.load_texture(os.path.join(_assets_dir, "graphics", "unpowered_lines", "line", "vertical.png")),
|
||||||
|
|
||||||
("line", "horizontal", True): arcade.load_texture("assets/graphics/powered_lines/line/horizontal.png"),
|
|
||||||
("line", "horizontal", False): arcade.load_texture("assets/graphics/unpowered_lines/line/horizontal.png"),
|
|
||||||
|
|
||||||
("corner", "left_bottom", True): arcade.load_texture("assets/graphics/powered_lines/corner/left_bottom.png"),
|
("line", "horizontal", True): arcade.load_texture(os.path.join(_assets_dir, "graphics", "powered_lines", "line", "horizontal.png")),
|
||||||
("corner", "left_bottom", False): arcade.load_texture("assets/graphics/unpowered_lines/corner/left_bottom.png"),
|
("line", "horizontal", False): arcade.load_texture(os.path.join(_assets_dir, "graphics", "unpowered_lines", "line", "horizontal.png")),
|
||||||
|
|
||||||
("corner", "left_top", True): arcade.load_texture("assets/graphics/powered_lines/corner/left_top.png"),
|
|
||||||
("corner", "left_top", False): arcade.load_texture("assets/graphics/unpowered_lines/corner/left_top.png"),
|
|
||||||
|
|
||||||
("corner", "right_bottom", True): arcade.load_texture("assets/graphics/powered_lines/corner/right_bottom.png"),
|
|
||||||
("corner", "right_bottom", False): arcade.load_texture("assets/graphics/unpowered_lines/corner/right_bottom.png"),
|
|
||||||
|
|
||||||
("corner", "right_top", True): arcade.load_texture("assets/graphics/powered_lines/corner/right_top.png"),
|
|
||||||
("corner", "right_top", False): arcade.load_texture("assets/graphics/unpowered_lines/corner/right_top.png"),
|
|
||||||
|
|
||||||
("t_junction", "left_right_bottom", True): arcade.load_texture("assets/graphics/powered_lines/t_junction/left_right_bottom.png"),
|
("corner", "left_bottom", True): arcade.load_texture(os.path.join(_assets_dir, "graphics", "powered_lines", "corner", "left_bottom.png")),
|
||||||
("t_junction", "left_right_bottom", False): arcade.load_texture("assets/graphics/unpowered_lines/t_junction/left_right_bottom.png"),
|
("corner", "left_bottom", False): arcade.load_texture(os.path.join(_assets_dir, "graphics", "unpowered_lines", "corner", "left_bottom.png")),
|
||||||
|
|
||||||
("t_junction", "left_right_top", True): arcade.load_texture("assets/graphics/powered_lines/t_junction/left_right_top.png"),
|
|
||||||
("t_junction", "left_right_top", False): arcade.load_texture("assets/graphics/unpowered_lines/t_junction/left_right_top.png"),
|
|
||||||
|
|
||||||
("t_junction", "top_bottom_left", True): arcade.load_texture("assets/graphics/powered_lines/t_junction/top_bottom_left.png"),
|
|
||||||
("t_junction", "top_bottom_left", False): arcade.load_texture("assets/graphics/unpowered_lines/t_junction/top_bottom_left.png"),
|
|
||||||
|
|
||||||
("t_junction", "top_bottom_right", True): arcade.load_texture("assets/graphics/powered_lines/t_junction/top_bottom_right.png"),
|
|
||||||
("t_junction", "top_bottom_right", False): arcade.load_texture("assets/graphics/unpowered_lines/t_junction/top_bottom_right.png"),
|
|
||||||
|
|
||||||
("cross", "cross", True): arcade.load_texture("assets/graphics/powered_lines/cross/cross.png"),
|
("corner", "left_top", True): arcade.load_texture(os.path.join(_assets_dir, "graphics", "powered_lines", "corner", "left_top.png")),
|
||||||
("cross", "cross", False): arcade.load_texture("assets/graphics/unpowered_lines/cross/cross.png"),
|
("corner", "left_top", False): arcade.load_texture(os.path.join(_assets_dir, "graphics", "unpowered_lines", "corner", "left_top.png")),
|
||||||
|
|
||||||
("power_source", "cross", True): arcade.load_texture("assets/graphics/power_source.png"),
|
("corner", "right_bottom", True): arcade.load_texture(os.path.join(_assets_dir, "graphics", "powered_lines", "corner", "right_bottom.png")),
|
||||||
|
("corner", "right_bottom", False): arcade.load_texture(os.path.join(_assets_dir, "graphics", "unpowered_lines", "corner", "right_bottom.png")),
|
||||||
|
|
||||||
("house", "cross", True): arcade.load_texture("assets/graphics/house_unpowered.png"),
|
("corner", "right_top", True): arcade.load_texture(os.path.join(_assets_dir, "graphics", "powered_lines", "corner", "right_top.png")),
|
||||||
("house", "cross", False): arcade.load_texture("assets/graphics/house_powered.png"),
|
("corner", "right_top", False): arcade.load_texture(os.path.join(_assets_dir, "graphics", "unpowered_lines", "corner", "right_top.png")),
|
||||||
}
|
|
||||||
|
("t_junction", "left_right_bottom", True): arcade.load_texture(os.path.join(_assets_dir, "graphics", "powered_lines", "t_junction", "left_right_bottom.png")),
|
||||||
|
("t_junction", "left_right_bottom", False): arcade.load_texture(os.path.join(_assets_dir, "graphics", "unpowered_lines", "t_junction", "left_right_bottom.png")),
|
||||||
|
|
||||||
|
("t_junction", "left_right_top", True): arcade.load_texture(os.path.join(_assets_dir, "graphics", "powered_lines", "t_junction", "left_right_top.png")),
|
||||||
|
("t_junction", "left_right_top", False): arcade.load_texture(os.path.join(_assets_dir, "graphics", "unpowered_lines", "t_junction", "left_right_top.png")),
|
||||||
|
|
||||||
|
("t_junction", "top_bottom_left", True): arcade.load_texture(os.path.join(_assets_dir, "graphics", "powered_lines", "t_junction", "top_bottom_left.png")),
|
||||||
|
("t_junction", "top_bottom_left", False): arcade.load_texture(os.path.join(_assets_dir, "graphics", "unpowered_lines", "t_junction", "top_bottom_left.png")),
|
||||||
|
|
||||||
|
("t_junction", "top_bottom_right", True): arcade.load_texture(os.path.join(_assets_dir, "graphics", "powered_lines", "t_junction", "top_bottom_right.png")),
|
||||||
|
("t_junction", "top_bottom_right", False): arcade.load_texture(os.path.join(_assets_dir, "graphics", "unpowered_lines", "t_junction", "top_bottom_right.png")),
|
||||||
|
|
||||||
|
("cross", "cross", True): arcade.load_texture(os.path.join(_assets_dir, "graphics", "powered_lines", "cross", "cross.png")),
|
||||||
|
("cross", "cross", False): arcade.load_texture(os.path.join(_assets_dir, "graphics", "unpowered_lines", "cross", "cross.png")),
|
||||||
|
|
||||||
|
("power_source", "cross", True): arcade.load_texture(os.path.join(_assets_dir, "graphics", "power_source.png")),
|
||||||
|
|
||||||
|
("house", "cross", True): arcade.load_texture(os.path.join(_assets_dir, "graphics", "house_unpowered.png")),
|
||||||
|
("house", "cross", False): arcade.load_texture(os.path.join(_assets_dir, "graphics", "house_powered.png")),
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user