Skip to content

Commit 97b3e66

Browse files
committed
alpha to work with range 0 to 255
1 parent f8e81e0 commit 97b3e66

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

Client/core/CModManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ void CModManager::Unload()
218218
CCore::GetSingleton().GetCommands()->SetExecuteHandler(NULL);
219219

220220
// Reset cursor color
221-
CCore::GetSingleton().GetGUI()->ResetCursorColor(255.f, 255.f, 255.f, 1.f);
221+
CCore::GetSingleton().GetGUI()->ResetCursorColor(255.f, 255.f, 255.f, 255.f);
222222

223223
// Reset the modules
224224
CCore::GetSingleton().GetGame()->Reset();

Client/gui/CGUI_Impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ void CGUI_Impl::GetCursorColor(float& r, float& g, float& b, float& alpha) noexc
521521

522522
void CGUI_Impl::ResetMenuCursorColor() noexcept
523523
{
524-
CEGUI::MouseCursor::getSingleton().setColor(255.0f, 255.0f, 255.0f, 1.0f);
524+
CEGUI::MouseCursor::getSingleton().setColor(255.0f, 255.0f, 255.0f, 255.0f);
525525
}
526526

527527
void CGUI_Impl::ResetCursorColor(float r, float g, float b, float alpha) noexcept

Client/gui/CGUI_Impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ class CGUI_Impl : public CGUI, public CGUITabList
316316

317317
CEGUI::DefaultWindow* m_pTop;
318318
const CEGUI::Image* m_pCursor;
319-
float m_fCurrentServerCursorAlpha = 1.0f;
319+
float m_fCurrentServerCursorAlpha = 255.0f;
320320
float m_fCurrentServerCursorRed = 255.0f;
321321
float m_fCurrentServerCursorGreen = 255.0f;
322322
float m_fCurrentServerCursorBlue = 255.0f;

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3445,7 +3445,7 @@ void CClientGame::Event_OnIngame()
34453445
g_pGame->SetWeaponRenderEnabled(true);
34463446

34473447
// Reset cursor color
3448-
g_pCore->GetGUI()->ResetCursorColor(255.f, 255.f, 255.f, 1.f);
3448+
g_pCore->GetGUI()->ResetCursorColor(255.f, 255.f, 255.f, 255.f);
34493449

34503450
// Make sure we can access all areas
34513451
g_pGame->GetStats()->ModifyStat(CITIES_PASSED, 2.0);

Client/mods/deathmatch/logic/luadefs/CLuaClientDefs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ bool CLuaClientDefs::IsCapsLockEnabled()
8686
bool CLuaClientDefs::SetCursorColor(std::optional<float> r, std::optional<float> g, std::optional<float> b, std::optional<float> alpha) noexcept
8787
{
8888
if (!g_pCore->IsMenuVisible())
89-
g_pCore->GetGUI()->SetCursorColor(r.value_or(255.0f), g.value_or(255.0f), b.value_or(255.0f), alpha.value_or(1.0f));
89+
g_pCore->GetGUI()->SetCursorColor(r.value_or(255.0f), g.value_or(255.0f), b.value_or(255.0f), alpha.value_or(255.0f));
9090
else
91-
g_pCore->GetGUI()->ResetCursorColor(r.value_or(255.0f), g.value_or(255.0f), b.value_or(255.0f), alpha.value_or(1.0f)); // Force variables to be updated when close the main menu it will set the new color
91+
g_pCore->GetGUI()->ResetCursorColor(r.value_or(255.0f), g.value_or(255.0f), b.value_or(255.0f), alpha.value_or(255.0f)); // Force variables to be updated when close the main menu it will set the new color
9292

9393
return true;
9494
}

vendor/cegui-0.4.0-custom/src/CEGUIMouseCursor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ void MouseCursor::setAlpha(float r, float g, float b, float alpha) noexcept
159159
*************************************************************************/
160160
void MouseCursor::setColor(float r, float g, float b, float alpha) noexcept
161161
{
162-
d_colourRect.setColours(colour(r/255.f, g/255.f, b/255.f, alpha));
162+
d_colourRect.setColours(colour(r/255.f, g/255.f, b/255.f, alpha/255.f));
163163
}
164164
/*************************************************************************
165165
Checks the mouse cursor position is within the current 'constrain'

0 commit comments

Comments
 (0)