Skip to content

Commit

Permalink
HID Light updates #612
Browse files Browse the repository at this point in the history
  • Loading branch information
Drewol committed Jul 26, 2022
2 parents 55c8c7a + d748c18 commit e8ede61
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
7 changes: 3 additions & 4 deletions Main/src/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1574,10 +1574,9 @@ class Game_Impl : public Game
g_application->SetButtonLights(g_input.GetButtonBits() & 0b111111);
}

float brightness = 1.0 - (m_playback.GetBeatTime() * 0.8);
brightness = Math::Clamp(brightness, 0.0f, 1.0f);


float brightness = 1.2 - (m_playback.GetBeatTime() * m_currentTiming->beatDuration) / 700.0;
brightness = Math::Clamp(brightness, 0.2f, 1.0f);

Color rgbColor = Color::FromHSV(180, 1.0, brightness);
for (size_t i = 0; i < 2; i++)
{
Expand Down
2 changes: 2 additions & 0 deletions Main/src/ScoreScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,8 @@ class ScoreScreen_Impl : public ScoreScreen
m_PushIntToTable("misses", score->miss);
m_PushIntToTable("timestamp", score->timestamp);
m_PushIntToTable("badge", static_cast<int>(Scoring::CalculateBadge(*score)));
m_PushStringToTable("playerName", *score->userName);
m_PushIntToTable("isLocal", score->localScore);
lua_pushstring(m_lua, "hitWindow");
HitWindow(score->hitWindowPerfect, score->hitWindowGood, score->hitWindowHold, score->hitWindowSlam).ToLuaTable(m_lua);
lua_settable(m_lua, -3);
Expand Down
2 changes: 2 additions & 0 deletions Main/src/SongSelect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,8 @@ class SelectionWheel : public SongItemSelectionWheel
m_PushIntToTable("combo", score->combo);
m_PushIntToTable("misses", score->miss);
m_PushIntToTable("timestamp", score->timestamp);
m_PushStringToTable("playerName", *score->userName);
m_PushIntToTable("isLocal", score->localScore);
m_PushIntToTable("badge", static_cast<int>(Scoring::CalculateBadge(*score)));
lua_settable(m_lua, -3);
}
Expand Down
Binary file modified bin/LightPlugins/usc-hid.dll
Binary file not shown.
3 changes: 2 additions & 1 deletion docs/source/scorescreen.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Note that, for multiplayer play every fields other than ``isSelf`` and ``uid`` m
float gaugeSamples[256] // gauge values sampled throughout the song
string grade // "S", "AAA+", "AAA", etc.
score[] highScores // Same as song wheel scores
string playerName // Only on multiplayer
string playerName
int displayIndex // Only on multiplayer; which player's score (not necessarily the viewer's) is being shown right not
string uid // Only on multiplayer; the UID of the viewer
HitWindow hitWindow // Same as gameplay HitWindow
Expand All @@ -51,6 +51,7 @@ Note that, for multiplayer play every fields other than ``isSelf`` and ``uid`` m
HitStat[] noteHitStats // Only when isSelf is true; contains HitStat for notes (excluding hold notes and lasers)
HitStat[] holdHitStats // Only when isSelf is true; contains HitStat for holds
HitStat[] laserHitStats // Only when isSelf is true; contains HitStat for lasers
bool isLocal // Whether this score was set locally
HitStat
*******
Expand Down
2 changes: 2 additions & 0 deletions docs/source/songwheel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ A score contains the following fields:
int misses
int badge
int timestamp //timestamp in POSIX time (seconds since Jan 1 1970 00:00:00 UTC)
string playerName
bool isLocal // Whether this score was set locally
Badge
*****
Expand Down

0 comments on commit e8ede61

Please sign in to comment.