Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
XDG Integration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
JennaHuntsman
XDG Integration
Commits
9e8bfa60
Commit
9e8bfa60
authored
5 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Restore mouselook IFF
parent
6185fa58
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/newview/app_settings/settings_alchemy.xml
+22
-0
22 additions, 0 deletions
indra/newview/app_settings/settings_alchemy.xml
indra/newview/lltoolgun.cpp
+65
-13
65 additions, 13 deletions
indra/newview/lltoolgun.cpp
indra/newview/lltoolgun.h
+1
-0
1 addition, 0 deletions
indra/newview/lltoolgun.h
with
88 additions
and
13 deletions
indra/newview/app_settings/settings_alchemy.xml
+
22
−
0
View file @
9e8bfa60
...
...
@@ -266,6 +266,28 @@
<key>
Value
</key>
<integer>
0
</integer>
</map>
<key>
AlchemyMouselookIFF
</key>
<map>
<key>
Comment
</key>
<string>
Display user that is currently focused upon by crosshair in mouselook
</string>
<key>
Persist
</key>
<integer>
1
</integer>
<key>
Type
</key>
<string>
Boolean
</string>
<key>
Value
</key>
<integer>
1
</integer>
</map>
<key>
AlchemyMouselookIFFRange
</key>
<map>
<key>
Comment
</key>
<string>
Range of IFF display
</string>
<key>
Persist
</key>
<integer>
1
</integer>
<key>
Type
</key>
<string>
F32
</string>
<key>
Value
</key>
<real>
380.0
</real>
</map>
<key>
AlchemyRainbowEffects
</key>
<map>
<key>
Comment
</key>
...
...
This diff is collapsed.
Click to expand it.
indra/newview/lltoolgun.cpp
+
65
−
13
View file @
9e8bfa60
...
...
@@ -49,10 +49,16 @@
// Linden library includes
#include
"llwindow.h"
// setMouseClipping()
//#include "alavatarcolormgr.h"
#include
"llavatarnamecache.h"
#include
"llnetmap.h"
#include
"llworld.h"
LLToolGun
::
LLToolGun
(
LLToolComposite
*
composite
)
:
LLTool
(
std
::
string
(
"gun"
),
composite
),
mIsSelected
(
FALSE
)
{
mCrosshairp
=
LLUI
::
getUIImage
(
"crosshairs.tga"
);
}
void
LLToolGun
::
handleSelect
()
...
...
@@ -92,8 +98,8 @@ BOOL LLToolGun::handleHover(S32 x, S32 y, MASK mask)
{
const
F32
NOMINAL_MOUSE_SENSITIVITY
=
0.0025
f
;
F32
mouse_sensitivity
=
gSavedSettings
.
getF32
(
"MouseSensitivity"
);
mouse_sensitivity
=
clamp_rescale
(
mouse_sensitivity
,
0.
f
,
15.
f
,
0.5
f
,
2.75
f
)
*
NOMINAL_MOUSE_SENSITIVITY
;
static
LLCachedControl
<
F32
>
mouse_sensitivity
_setting
(
gSavedSettings
,
"MouseSensitivity"
);
F32
mouse_sensitivity
=
clamp_rescale
(
mouse_sensitivity
_setting
,
0.
f
,
15.
f
,
0.5
f
,
2.75
f
)
*
NOMINAL_MOUSE_SENSITIVITY
;
// ...move the view with the mouse
...
...
@@ -104,25 +110,29 @@ BOOL LLToolGun::handleHover(S32 x, S32 y, MASK mask)
if
(
dx
!=
0
||
dy
!=
0
)
{
// ...actually moved off center
if
(
gSavedSettings
.
getBOOL
(
"InvertMouse"
))
const
F32
fov
=
LLViewerCamera
::
getInstance
()
->
getView
()
/
DEFAULT_FIELD_OF_VIEW
;
static
LLCachedControl
<
bool
>
invert_mouse
(
gSavedSettings
,
"InvertMouse"
);
if
(
invert_mouse
)
{
gAgent
.
pitch
(
mouse_sensitivity
*
-
dy
);
gAgent
.
pitch
(
mouse_sensitivity
*
fov
*
-
dy
);
}
else
{
gAgent
.
pitch
(
mouse_sensitivity
*
dy
);
gAgent
.
pitch
(
mouse_sensitivity
*
fov
*
dy
);
}
LLVector3
skyward
=
gAgent
.
getReferenceUpVector
();
gAgent
.
rotate
(
mouse_sensitivity
*
dx
,
skyward
.
mV
[
VX
],
skyward
.
mV
[
VY
],
skyward
.
mV
[
VZ
]);
gAgent
.
rotate
(
mouse_sensitivity
*
fov
*
dx
,
skyward
.
mV
[
VX
],
skyward
.
mV
[
VY
],
skyward
.
mV
[
VZ
]);
if
(
gSavedSettings
.
getBOOL
(
"MouseSun"
))
static
LLCachedControl
<
bool
>
mouse_sun
(
gSavedSettings
,
"MouseSun"
);
if
(
mouse_sun
)
{
LLVector3
sunpos
=
LLViewerCamera
::
getInstance
()
->
getAtAxis
();
gSky
.
setSunDirectionCFR
(
sunpos
);
gSavedSettings
.
setVector3
(
"SkySunDefaultPosition"
,
LLViewerCamera
::
getInstance
()
->
getAtAxis
());
}
if
(
gSavedSettings
.
getBOOL
(
"MouseMoon"
))
static
LLCachedControl
<
bool
>
mouse_moon
(
gSavedSettings
,
"MouseMoon"
);
if
(
mouse_moon
)
{
LLVector3
moonpos
=
LLViewerCamera
::
getInstance
()
->
getAtAxis
();
gSky
.
setMoonDirectionCFR
(
moonpos
);
...
...
@@ -148,11 +158,53 @@ BOOL LLToolGun::handleHover(S32 x, S32 y, MASK mask)
void
LLToolGun
::
draw
()
{
if
(
gSavedSettings
.
getBOOL
(
"ShowCrosshairs"
)
)
static
LLCachedControl
<
bool
>
show_crosshairs
(
gSavedSettings
,
"ShowCrosshairs"
);
static
LLCachedControl
<
bool
>
show_iff
(
gSavedSettings
,
"AlchemyMouselookIFF"
,
true
);
static
LLCachedControl
<
F32
>
iff_range
(
gSavedSettings
,
"AlchemyMouselookIFFRange"
,
380.
f
);
if
(
show_crosshairs
)
{
LLUIImagePtr
crosshair
=
LLUI
::
getUIImage
(
"crosshairs.tga"
);
crosshair
->
draw
(
(
gViewerWindow
->
getWorldViewRectScaled
().
getWidth
()
-
crosshair
->
getWidth
()
)
/
2
,
(
gViewerWindow
->
getWorldViewRectScaled
().
getHeight
()
-
crosshair
->
getHeight
()
)
/
2
);
const
S32
windowWidth
=
gViewerWindow
->
getWorldViewRectScaled
().
getWidth
();
const
S32
windowHeight
=
gViewerWindow
->
getWorldViewRectScaled
().
getHeight
();
LLColor4
targetColor
=
LLColor4
::
white
;
targetColor
.
mV
[
VALPHA
]
=
0.5
f
;
if
(
show_iff
)
{
LLVector3d
myPosition
=
gAgentCamera
.
getCameraPositionGlobal
();
LLQuaternion
myRotation
=
LLViewerCamera
::
getInstance
()
->
getQuaternion
();
myRotation
.
set
(
-
myRotation
.
mQ
[
VX
],
-
myRotation
.
mQ
[
VY
],
-
myRotation
.
mQ
[
VZ
],
myRotation
.
mQ
[
VW
]);
LLWorld
::
pos_map_t
positions
;
LLWorld
::
getInstance
()
->
getAvatars
(
&
positions
,
gAgent
.
getPositionGlobal
(),
iff_range
);
for
(
const
auto
&
position
:
positions
)
{
const
auto
&
id
=
position
.
first
;
const
auto
&
targetPosition
=
position
.
second
;
if
(
id
==
gAgentID
||
targetPosition
.
isNull
())
{
continue
;
}
LLVector3d
magicVector
=
(
targetPosition
-
myPosition
)
*
myRotation
;
magicVector
.
setVec
(
-
magicVector
.
mdV
[
VY
],
magicVector
.
mdV
[
VZ
],
magicVector
.
mdV
[
VX
]);
if
(
magicVector
.
mdV
[
VX
]
>
-
0.75
&&
magicVector
.
mdV
[
VX
]
<
0.75
&&
magicVector
.
mdV
[
VZ
]
>
0.0
&&
magicVector
.
mdV
[
VY
]
>
-
1.5
&&
magicVector
.
mdV
[
VY
]
<
1.5
)
// Do not fuck with these, cheater. :(
{
LLAvatarName
avatarName
;
LLAvatarNameCache
::
get
(
id
,
&
avatarName
);
//targetColor = ALAvatarColorMgr::instance().getColor(id);
targetColor
.
mV
[
VALPHA
]
=
0.5
f
;
LLFontGL
::
getFontSansSerifBold
()
->
renderUTF8
(
llformat
(
"%s : %.2fm"
,
avatarName
.
getCompleteName
().
c_str
(),
(
targetPosition
-
myPosition
).
magVec
()),
0
,
(
windowWidth
/
2.
f
),
(
windowHeight
/
2.
f
)
-
25.
f
,
targetColor
,
LLFontGL
::
HCENTER
,
LLFontGL
::
TOP
,
LLFontGL
::
BOLD
,
LLFontGL
::
NO_SHADOW
);
break
;
}
}
}
mCrosshairp
->
draw
(
(
windowWidth
-
mCrosshairp
->
getWidth
())
/
2
,
(
windowHeight
-
mCrosshairp
->
getHeight
())
/
2
,
targetColor
);
}
}
This diff is collapsed.
Click to expand it.
indra/newview/lltoolgun.h
+
1
−
0
View file @
9e8bfa60
...
...
@@ -48,6 +48,7 @@ class LLToolGun : public LLTool
virtual
BOOL
clipMouseWhenDown
()
{
return
FALSE
;
}
private
:
BOOL
mIsSelected
;
LLUIImagePtr
mCrosshairp
;
};
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment