diff --git a/src/main.cpp b/src/main.cpp index de515d8..8f6e6c2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -49,11 +49,14 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi } int mode = data::cfg["mode"].asInt(); - int red_value = data::cfg["decoration"]["rgb"][0].asInt(); - int green_value = data::cfg["decoration"]["rgb"][1].asInt(); - int blue_value = data::cfg["decoration"]["rgb"][2].asInt(); - window.clear(sf::Color(red_value, green_value, blue_value)); + Json::Value rgb = data::cfg["decoration"]["rgb"]; + int red_value = rgb[0].asInt(); + int green_value = rgb[1].asInt(); + int blue_value = rgb[2].asInt(); + int alpha_value = rgb.size() == 3 ? 255 : rgb[3].asInt(); + + window.clear(sf::Color(red_value, green_value, blue_value, alpha_value)); switch (mode) { case 1: osu::draw(); diff --git a/src/osu.cpp b/src/osu.cpp index dcaa81a..5744707 100644 --- a/src/osu.cpp +++ b/src/osu.cpp @@ -5,7 +5,7 @@ Json::Value left_key_value, right_key_value, smoke_key_value, wave_key_value; int osu_x, osu_y, osu_h, osu_v; int offset_x, offset_y; int horizontal, vertical; -int paw_r, paw_g, paw_b; +int paw_r, paw_g, paw_b, paw_a; int paw_edge_r, paw_edge_g, paw_edge_b; double scale; bool is_mouse, is_letterbox, is_left_handed, is_enable_toggle_smoke; @@ -48,6 +48,7 @@ bool init() { paw_r = osu["paw"][0].asInt(); paw_g = osu["paw"][1].asInt(); paw_b = osu["paw"][2].asInt(); + paw_a = osu["paw"].size() == 3 ? 255 : osu["paw"][3].asInt(); paw_edge_r = osu["pawEdge"][0].asInt(); paw_edge_g = osu["pawEdge"][1].asInt(); @@ -252,8 +253,8 @@ void draw() { for (int i = 0; i < 26; i += 2) { fill[i].position = sf::Vector2f(pss2[i], pss2[i + 1]); fill[i + 1].position = sf::Vector2f(pss2[52 - i - 2], pss2[52 - i - 1]); - fill[i].color = sf::Color(paw_r, paw_g, paw_b, 255); - fill[i + 1].color = sf::Color(paw_r, paw_g, paw_b, 255); + fill[i].color = sf::Color(paw_r, paw_g, paw_b, paw_a); + fill[i + 1].color = sf::Color(paw_r, paw_g, paw_b, paw_a); } window.draw(fill);