Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions to set in game Cursor Color for client #3558

Open
wants to merge 39 commits into
base: master
Choose a base branch
from

Conversation

Proxy-99
Copy link
Contributor

@Proxy-99 Proxy-99 commented Jul 7, 2024

add new client functions

setCursorColor(0,255,30,255)
setCursorAlpha(100)
r,g,b,a = getCursorColor()
print(r)
print(g)
print(b)
print(a)

part of #3555

@Proxy-99 Proxy-99 marked this pull request as draft July 7, 2024 19:04
@Proxy-99 Proxy-99 marked this pull request as ready for review July 8, 2024 13:56
@Proxy-99 Proxy-99 changed the title in game cursor color function Add functions to set in game Cursor Color Jul 8, 2024
Client/core/CGUI.cpp Outdated Show resolved Hide resolved
Client/gui/CGUI_Impl.cpp Outdated Show resolved Hide resolved
Client/gui/CGUI_Impl.h Outdated Show resolved Hide resolved
Client/gui/CGUI_Impl.h Outdated Show resolved Hide resolved
Client/mods/deathmatch/logic/luadefs/CLuaClientDefs.cpp Outdated Show resolved Hide resolved
@tederis
Copy link
Member

tederis commented Jul 9, 2024

Will the colors be reset after a disconnect?

@tederis tederis added the enhancement New feature or request label Jul 9, 2024
@Proxy-99
Copy link
Contributor Author

Proxy-99 commented Jul 9, 2024

Will the colors be reset after a disconnect?

I will try to put the function within onClientPlayerQuit event

@tederis
Copy link
Member

tederis commented Jul 9, 2024

Will the colors be reset after a disconnect?

I will try to put the function within onClientPlayerQuit event

There is the special place for it: CClientGame::Event_OnIngame

Proxy-99 added 3 commits July 9, 2024 15:57
…efresh i

setCursorAlpha(150) when you open up the F8 and start the resource it won't refresh the image due to a check if F8 console is open it or not
@Proxy-99 Proxy-99 requested a review from tederis July 9, 2024 14:09
@Proxy-99
Copy link
Contributor Author

@tederis
I have refactor part of setCursorAlpha() function to set the color correctly

here is my test
https://youtu.be/svReSqdAcdg?si=ElnAsBf23XYHhrue
seems all good

@lopezloo
Copy link
Member

lopezloo commented Jul 10, 2024

I don't think it should be possible to set this for pause menu since it could be abused to hide cursor.

@Proxy-99
Copy link
Contributor Author

Proxy-99 commented Jul 11, 2024

I don't think it should be possible to set this for pause menu since it could be abused to hide cursor.

now fixed
when you open up the main menu it will reset the color to the deafult one
when you close it it will set the server color back again
when you disconnect it will reset the values and color to deafult

Client/gui/CGUI_Impl.h Outdated Show resolved Hide resolved
Client/mods/deathmatch/logic/CClientGame.cpp Outdated Show resolved Hide resolved
Client/mods/deathmatch/logic/luadefs/CLuaClientDefs.cpp Outdated Show resolved Hide resolved
Client/mods/deathmatch/logic/luadefs/CLuaClientDefs.cpp Outdated Show resolved Hide resolved
Client/gui/CGUI_Impl.cpp Outdated Show resolved Hide resolved
Client/core/CGUI.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@Fernando-A-Rocha Fernando-A-Rocha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. I tested: it works fine.

image

addCommandHandler("cursorcolor", function(cmd, arg)
    if arg == "green" then
        setCursorColor(0,255,30,1)
    else
        setCursorColor(255,255,255,1)
    end
    iprint(getCursorColor())
end)

Copy link
Contributor

@znvjder znvjder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make please range (0-255) also for alpha color?

@Proxy-99
Copy link
Contributor Author

Proxy-99 commented Jan 5, 2025

Can you make please range (0-255) also for alpha color?

I will rewrite it soon

@Fernando-A-Rocha
Copy link
Contributor

Ok, good :D

@Proxy-99
Copy link
Contributor Author

Proxy-99 commented Jan 5, 2025

Since I think it looks all good now and reviews by many can you merge this @botder @tederis

Copy link
Contributor

@Fernando-A-Rocha Fernando-A-Rocha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

vendor/cegui-0.4.0-custom/src/CEGUIMouseCursor.cpp Outdated Show resolved Hide resolved
vendor/cegui-0.4.0-custom/src/CEGUIMouseCursor.cpp Outdated Show resolved Hide resolved
Client/gui/CGUI_Impl.h Outdated Show resolved Hide resolved
Client/gui/CGUI_Impl.h Outdated Show resolved Hide resolved
Client/gui/CGUI_Impl.cpp Show resolved Hide resolved
Client/gui/CGUI_Impl.cpp Outdated Show resolved Hide resolved
Client/gui/CGUI_Impl.cpp Show resolved Hide resolved
Client/gui/CGUI_Impl.cpp Outdated Show resolved Hide resolved
Client/mods/deathmatch/logic/CClientGame.cpp Outdated Show resolved Hide resolved
fix noexcept and Hungarian notation
@Proxy-99 Proxy-99 requested a review from FileEX January 5, 2025 16:06
Client/gui/CGUI_Impl.h Outdated Show resolved Hide resolved
@Proxy-99 Proxy-99 requested a review from FileEX January 6, 2025 07:04
Copy link
Contributor

@Nico8340 Nico8340 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some skins, even the default ones, the cursor isn't white, so using a white cursor would either look out of place or be completely irrelevant

@Proxy-99
Copy link
Contributor Author

Proxy-99 commented Jan 6, 2025

In some skins, even the default ones, the cursor isn't white, so using a white cursor would either look out of place or be completely irrelevant

I test it with others themes it works normally

@Fernando-A-Rocha
Copy link
Contributor

In some skins, even the default ones, the cursor isn't white, so using a white cursor would either look out of place or be completely irrelevant

I test it with others themes it works normally

Would it be possible to reset the color to the color set by the current theme?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants