notpeelz / reshade-xhair

A customizable, fullscreen-compatible crosshair overlay for ReShade
GNU General Public License v3.0
224 stars 52 forks source link

Is it possible to have 2 crosshairs and right click to switch between? #15

Closed INeedABetterName2 closed 2 years ago

INeedABetterName2 commented 2 years ago

Trying to make the default one my hip-fire crosshair and the other one for my scope reticle.

notpeelz commented 2 years ago

I don't see a way to easily add that as setting. However, you can use two xhair shaders as a workaround:

  1. Open the folder containing the shader

image

  1. Duplicate the file and name it xhair2.fx
  2. Open the new file in a text editor
  3. Add ! in front of XOR (currently line 509 on the latest version):
float4 PS_Xhair(float4 pos : SV_Position, float2 texcoord : TEXCOORD) : SV_Targe
   float4 drawBackground = tex2D(ReShade::BackBuffer, texcoord);

   // Don't render if RMB hiding is activated
-  if (XOR(HideOnRMB == 0 && rightMouseDown || HideOnRMB == 1 && rightMouseToggle, InvertHideOnRMB)) {
+  if (!XOR(HideOnRMB == 0 && rightMouseDown || HideOnRMB == 1 && rightMouseToggle, InvertHideOnRMB)) {
     return drawBackground;
   }

This will invert the behavior of the "Hide on RMB" setting.

INeedABetterName2 commented 2 years ago

It worked, Thank you so much. :D

notpeelz commented 2 years ago

You're welcome :D