From a0510bd9f08531f32d4043b27612aafaad65bc50 Mon Sep 17 00:00:00 2001 From: Trung Dang Date: Wed, 1 Jan 2020 18:57:27 +0700 Subject: [PATCH] Add paw color configuration Applying #24 for #25. --- src/data.cpp | 1 + src/osu.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/data.cpp b/src/data.cpp index b13bf2e..d051448 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -26,6 +26,7 @@ void create_config() }, "osu": { "mouse": true, + "paw": [255, 255, 255], "key1": [90], "key2": [88], "smoke": [67], diff --git a/src/osu.cpp b/src/osu.cpp index b9265f4..b81b4af 100644 --- a/src/osu.cpp +++ b/src/osu.cpp @@ -6,6 +6,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; double scale; bool is_mouse, is_letterbox, is_left_handed; sf::Sprite bg, up, left, right, device, smoke, wave; @@ -40,6 +41,10 @@ bool init() // getting configs is_mouse = data::cfg["osu"]["mouse"].asBool(); + paw_r = data::cfg["osu"]["paw"][0].asInt(); + paw_g = data::cfg["osu"]["paw"][1].asInt(); + paw_b = data::cfg["osu"]["paw"][2].asInt(); + bool chk[256]; std::fill(chk, chk + 256, false); left_key_value = data::cfg["osu"]["key1"]; @@ -266,6 +271,8 @@ void draw() { 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); } window.draw(fill);