diff --git a/_work/data/Scripts/Content/GFA/_intern/const.d b/_work/data/Scripts/Content/GFA/_intern/const.d index c6fc282..7f13f75 100644 --- a/_work/data/Scripts/Content/GFA/_intern/const.d +++ b/_work/data/Scripts/Content/GFA/_intern/const.d @@ -64,10 +64,9 @@ const int GFA_MAX_DIST = 5000; // Distance for shoo var int GFA_AimRayInterval; // Perform trace ray every x ms (change in ini-file) var int GFA_AimRayPrevCalcTime; // Time of last trace ray calculation var int GFA_NoAimNoFocus; // Remove focus when not aiming (change in ini-file) -var int GFA_ScaleReticleWithResolution; // Scale reticle relative to the screen resolution (ini) -const int GFA_RETICLE_MIN_SIZE = 200; // Smallest reticle size in virtual coordinates -const int GFA_RETICLE_MAX_SIZE = 400; // Biggest reticle size in virtual coordinates +const int GFA_RETICLE_MIN_SIZE = 32; // Reticle size in pixels (at its smallest) +const int GFA_RETICLE_MAX_SIZE = 64; // Reticle size in pixels (at its biggest) const int GFA_RETICLE_PTR = 0; // Reticle zCView var int GFA_AimVobHasFX; // For performance: check whether FX needs to be removed diff --git a/_work/data/Scripts/Content/GFA/_intern/init.d b/_work/data/Scripts/Content/GFA/_intern/init.d index 2adaf8c..d6bff98 100644 --- a/_work/data/Scripts/Content/GFA/_intern/init.d +++ b/_work/data/Scripts/Content/GFA/_intern/init.d @@ -157,9 +157,9 @@ func void GFA_InitFeatureFreeAiming() { MEM_SetGothOpt("GFA", "showFocusWhenNotAiming", "0"); }; - if (!MEM_GothOptExists("GFA", "scaleReticleWithResolution")) { - // Add INI-entry, if not set (enable by default) - MEM_SetGothOpt("GFA", "scaleReticleWithResolution", "1"); + if (!MEM_GothOptExists("GFA", "reticleSizePx")) { + // Add INI-entry, if not set + MEM_SetGothOpt("GFA", "reticleSizePx", IntToString(GFA_RETICLE_MAX_SIZE)); }; if (GOTHIC_BASE_VERSION == 2) { @@ -333,8 +333,13 @@ func void GFA_InitAlways() { // Remove focus when not aiming: Prevent using bow/spell as enemy detector GFA_NoAimNoFocus = !STR_ToInt(MEM_GetGothOpt("GFA", "showFocusWhenNotAiming")); - // Scale the reticle relative to the screen resolution - GFA_ScaleReticleWithResolution = STR_ToInt(MEM_GetGothOpt("GFA", "scaleReticleWithResolution")); + // Set the reticle size in pixels + GFA_RETICLE_MAX_SIZE = STR_ToInt(MEM_GetGothOpt("GFA", "reticleSizePx")); + if (GFA_RETICLE_MAX_SIZE < GFA_RETICLE_MIN_SIZE) { + GFA_RETICLE_MAX_SIZE = GFA_RETICLE_MIN_SIZE; + MEM_SetGothOpt("GFA", "reticleSizePx", IntToString(GFA_RETICLE_MAX_SIZE)); + }; + GFA_RETICLE_MIN_SIZE = GFA_RETICLE_MAX_SIZE/2; // Reset/reinitialize free aiming settings every time to prevent crashes if (GFA_Flags & GFA_RANGED) || (GFA_Flags & GFA_SPELLS) { diff --git a/_work/data/Scripts/Content/GFA/_intern/reticle.d b/_work/data/Scripts/Content/GFA/_intern/reticle.d index e75bb2e..1a8a1a1 100644 --- a/_work/data/Scripts/Content/GFA/_intern/reticle.d +++ b/_work/data/Scripts/Content/GFA/_intern/reticle.d @@ -56,12 +56,8 @@ func void GFA_InsertReticle(var int reticlePtr) { if (!GFA_RETICLE_PTR) { // Create reticle if it does not exist - Print_GetScreenSize(); // Necessary for Print_ToRatio - if (GFA_ScaleReticleWithResolution) { - GFA_RETICLE_PTR = ViewPtr_CreateCenter(PS_VMax/2, PS_VMax/2, size, Print_ToRatio(size, PS_Y)); - } else { - GFA_RETICLE_PTR = ViewPtr_CreateCenterPxl(Print_Screen[PS_X]/2, Print_Screen[PS_Y]/2, size/6, size/6); - }; + Print_GetScreenSize(); // Necessary for Print_Screen + GFA_RETICLE_PTR = ViewPtr_CreateCenterPxl(Print_Screen[PS_X]/2, Print_Screen[PS_Y]/2, size, size); ViewPtr_SetTexture(GFA_RETICLE_PTR, reticle.texture); ViewPtr_SetColor(GFA_RETICLE_PTR, reticle.color); ViewPtr_Open(GFA_RETICLE_PTR); @@ -79,17 +75,11 @@ func void GFA_InsertReticle(var int reticlePtr) { if (csize != size) || (Print_Screen[PS_X]/2 != centerX) { // Update its size and re-position it to center - Print_GetScreenSize(); // Necessary for Print_ToRatio + Print_GetScreenSize(); // Necessary for Print_Screen var int csize; csize = size; var int centerX; centerX = Print_Screen[PS_X]/2; - if (GFA_ScaleReticleWithResolution) { - var int sizey; sizey = Print_ToRatio(size, PS_Y); - ViewPtr_Resize(GFA_RETICLE_PTR, size, sizey); - ViewPtr_MoveTo(GFA_RETICLE_PTR, PS_VMax/2-size/2, PS_VMax/2-sizey/2); - } else { - ViewPtr_ResizePxl(GFA_RETICLE_PTR, size/6, size/6); - ViewPtr_MoveToPxl(GFA_RETICLE_PTR, Print_Screen[PS_X]/2-size/6/2, Print_Screen[PS_Y]/2-size/6/2); - }; + ViewPtr_ResizePxl(GFA_RETICLE_PTR, size, size); + ViewPtr_MoveToPxl(GFA_RETICLE_PTR, Print_Screen[PS_X]/2-size/2, Print_Screen[PS_Y]/2-size/2); }; var zCView crsHr; crsHr = _^(GFA_RETICLE_PTR); diff --git a/_work/data/Scripts/Content/GFA/config/criticalHit.d b/_work/data/Scripts/Content/GFA/config/criticalHit.d index 91412bf..5d25e33 100644 --- a/_work/data/Scripts/Content/GFA/config/criticalHit.d +++ b/_work/data/Scripts/Content/GFA/config/criticalHit.d @@ -149,14 +149,9 @@ func void GFA_GetCriticalHit(var C_Npc target, var string bone, var C_Item weapo // Shooter-like hit marker if (!GFA_HITMARKER) { // Create it (if it does not exist) in the center of the screen - Print_GetScreenSize(); // Necessary for Print_ToRatio - if (GFA_ScaleReticleWithResolution) { - GFA_HITMARKER = ViewPtr_CreateCenter(PS_VMax/2, PS_VMax/2, - GFA_RETICLE_MAX_SIZE, Print_ToRatio(GFA_RETICLE_MAX_SIZE, PS_Y)); - } else { - GFA_HITMARKER = ViewPtr_CreateCenterPxl(Print_Screen[PS_X]/2, Print_Screen[PS_Y]/2, - GFA_RETICLE_MAX_SIZE/6, GFA_RETICLE_MAX_SIZE/6); - }; + Print_GetScreenSize(); // Necessary for Print_Screen + GFA_HITMARKER = ViewPtr_CreateCenterPxl(Print_Screen[PS_X]/2, Print_Screen[PS_Y]/2, // Coordinates + GFA_RETICLE_MAX_SIZE, GFA_RETICLE_MAX_SIZE); // Size // Get 7th frame of animated texture as static texture ViewPtr_SetTexture(GFA_HITMARKER, GFA_AnimateReticleByPercent(RETICLE_TRI_IN, 100, 7));