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

Implement Support for cl_crosshair_t Command #2544

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JohnDeved
Copy link

@JohnDeved JohnDeved commented May 15, 2024

Goal of this PR

This PR aims to implement support for the cl_crosshair_t command from CS:GO. The cl_crosshair_t command allows players to customize their crosshair to a "T" style by removing the top line of the crosshair.

How is this PR achieving the goal

  • Command Implementation: Added the cl_crosshair_t command to toggle the "T" style crosshair.

    static ConVar<bool> cl_crosshair_t("cl_crosshair_t", ConVar_Archive, false);
  • Drawing Logic Update: Modified the DoCrosshairDraw function to conditionally skip drawing the top vertical line of the crosshair when cl_crosshair_t is enabled.

    // draw top vertical crosshair line if cl_crosshair_t is disabled
    if (!cl_crosshair_t.GetValue())
    {
        int iInnerTop = iCenterY - iInnerCrossDist - iBarThickness / 2;
        int iOuterTop = iInnerTop - iBarSizeInner;
        DrawCrosshairRect(r, g, b, flLineAlphaInner, x0, iOuterTop, x1, iInnerTop, bAdditive);
    }
  • Whitelist Update: Added cl_crosshair_t to the g_prodCommandsWhitelist to ensure the command is recognized and can be used.

    static std::vector<std::string> g_prodCommandsWhitelist{
        ...
        "cl_crosshair_t" // Added command
    };

This PR applies to the following area(s)

  • FiveM

Successfully tested on

Game builds:

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

@github-actions github-actions bot added the triage Needs a preliminary assessment to determine the urgency and required action label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant