This commit is contained in:
Latif Khalifa
2013-11-29 16:24:36 +01:00
6 changed files with 65 additions and 27 deletions

View File

@@ -45,6 +45,7 @@
#include "llagentcamera.h"
#include "llbutton.h"
#include "llviewercontrol.h"
#include "llviewerkeyboard.h"
#include "lldrawable.h"
#include "llhoverview.h"
#include "llhudmanager.h"
@@ -312,9 +313,15 @@ BOOL LLToolCamera::handleMouseUp(S32 x, S32 y, MASK mask)
return TRUE;
}
static bool right_hold_mouse_walk=false;
BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
{
if(right_hold_mouse_walk)
{
agent_push_forward(KEYSTATE_LEVEL);
}
S32 dx = gViewerWindow->getCurrentMouseDX();
S32 dy = gViewerWindow->getCurrentMouseDY();
@@ -449,8 +456,36 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
return TRUE;
}
BOOL LLToolCamera::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
if(mMouseSteering)
{
agent_push_forward(KEYSTATE_DOWN);
right_hold_mouse_walk = true;
return TRUE;
}
else
{
return FALSE;
}
}
BOOL LLToolCamera::handleRightMouseUp(S32 x, S32 y, MASK mask)
{
if(mMouseSteering || right_hold_mouse_walk)
{
agent_push_forward(KEYSTATE_UP);
right_hold_mouse_walk = false;
return TRUE;
}
else
{
return FALSE;
}
}
void LLToolCamera::onMouseCaptureLost()
{
releaseMouse();
handleRightMouseUp(0,0,0);
}

View File

@@ -47,6 +47,8 @@ public:
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask);
virtual void onMouseCaptureLost();

View File

@@ -94,4 +94,5 @@ protected:
extern LLViewerKeyboard gViewerKeyboard;
extern bool isCrouch;
void agent_push_forward(EKeystate s);
#endif // LL_LLVIEWERKEYBOARD_H

View File

@@ -3,13 +3,13 @@
can_resize="true" enabled="true" follows="left|top" height="550" left="306"
min_height="271" min_width="290" mouse_opaque="true" name="script ed float"
rect_control="FloaterOpenObjectRect" title="Script: New Script" width="500" border_drop_shadow_visible="false" border_visible="false" bevel_style="none" border_style="line" border_thickness="0">
<button bottom="-545" enabled="true" follows="right|bottom" font="SansSerif"
halign="center" height="20" label="Reset" label_selected="Reset" left="362"
<button bottom="-538" enabled="true" follows="right|bottom" font="SansSerif"
halign="center" height="20" label="Reset" label_selected="Reset" left="358"
mouse_opaque="true" name="Reset" width="128" />
<check_box bottom="-545" enabled="false" follows="left|bottom" font="SansSerif"
<check_box bottom="-540" enabled="false" follows="left|bottom" font="SansSerif"
height="18" initial_value="true" label="Running" left="12"
mouse_opaque="true" name="running" radio_style="false" width="100" />
<check_box bottom="-545" enabled="false" follows="left|bottom" font="SansSerif"
<check_box bottom="-540" enabled="false" follows="left|bottom" font="SansSerif"
height="18" hidden="false" initial_value="true" label="Mono" left="82"
mouse_opaque="true" name="mono" radio_style="false" width="100" />
<panel bottom="-524" enabled="true" follows="left|top|right|bottom" height="506"

View File

@@ -1,46 +1,46 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater bottom="-197" can_close="true" can_drag_on_left="false" can_minimize="false"
can_resize="false" enabled="true" height="180" left="439" min_height="100"
can_resize="false" enabled="true" height="158" left="439" min_height="100"
min_width="100" mouse_opaque="true" name="Give Money"
rect_control="FloaterPayRectB" title="" width="300">
<button bottom="-74" enabled="true" font="SansSerif" halign="center" height="20"
<button bottom="-54" enabled="true" font="SansSerif" halign="center" height="20"
label="L$1" label_selected="L$1" left="108" mouse_opaque="true"
name="fastpay 1" scale_image="true" width="80" />
<button bottom="-74" enabled="true" font="SansSerif" halign="center" height="20"
<button bottom="-54" enabled="true" font="SansSerif" halign="center" height="20"
label="L$5" label_selected="L$5" left="203" mouse_opaque="true"
name="fastpay 5" scale_image="true" width="80" />
<button bottom="-98" enabled="true" font="SansSerif" halign="center" height="20"
<button bottom="-78" enabled="true" font="SansSerif" halign="center" height="20"
label="L$10" label_selected="L$10" left="108" mouse_opaque="true"
name="fastpay 10" scale_image="true" width="80" />
<button bottom="-98" enabled="true" font="SansSerif" halign="center" height="20"
<button bottom="-78" enabled="true" font="SansSerif" halign="center" height="20"
label="L$20" label_selected="L$20" left="203" mouse_opaque="true"
name="fastpay 20" scale_image="true" width="80" />
<button bottom="-162" enabled="false" font="SansSerif" halign="center" height="20"
<button bottom="-142" enabled="false" font="SansSerif" halign="center" height="20"
label="Pay" label_selected="Pay" left="140" mouse_opaque="true"
name="pay btn" scale_image="true" width="70" />
<button bottom="-162" enabled="true" font="SansSerif" halign="center" height="20"
<button bottom="-142" enabled="true" font="SansSerif" halign="center" height="20"
label="Cancel" label_selected="Cancel" left="213" mouse_opaque="true"
name="cancel btn" scale_image="true" width="70" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-25" drop_shadow_visible="true" enabled="true" follows="left|top"
font="SansSerif" h_pad="0" halign="left" height="18" left="8"
mouse_opaque="true" name="payee_label" v_pad="0" width="75">
name="payee_label" v_pad="0" width="75">
Pay resident:
</text>
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-25" drop_shadow_visible="true" enabled="true" follows="left|top"
font="SansSerif" h_pad="0" halign="left" height="18" left="85"
mouse_opaque="true" name="payee_name" v_pad="0" width="210">
name="payee_name" v_pad="0" width="210">
[NAME]
</text>
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-72" drop_shadow_visible="true" enabled="true" follows="left|top"
bottom="-52" drop_shadow_visible="true" enabled="true" follows="left|top"
font="SansSerif" h_pad="0" halign="right" height="18" left="5"
mouse_opaque="true" name="fastpay text" v_pad="0" width="95">
name="fastpay text" v_pad="0" width="95">
Fast Pay:
</text>
<text name="message text"
bottom="-130" left="12" height="18" width="60"
bottom="-110" left="12" height="18" width="60"
follows="left|top" font="SansSerif">
Message:
</text>
@@ -49,12 +49,12 @@
bevel_style="in" border_style="line" border_thickness="1"
follows="left|top|right" font="SansSerif" spell_check="true" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-162" drop_shadow_visible="true" enabled="true" follows="left|top"
bottom="-142" drop_shadow_visible="true" enabled="true" follows="left|top"
font="SansSerif" h_pad="0" halign="left" height="18" left="12"
mouse_opaque="true" name="amount text" v_pad="0" width="75">
name="amount text" v_pad="0" width="75">
Amount:
</text>
<line_editor bevel_style="in" border_style="line" border_thickness="1" bottom="-160"
<line_editor bevel_style="in" border_style="line" border_thickness="1" bottom="-140"
enabled="true" follows="left|top|right" font="SansSerif"
handle_edit_keys_directly="false" height="18" left="81" max_length="9"
mouse_opaque="true" name="amount" select_all_on_focus_received="false"

View File

@@ -1,48 +1,48 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater bottom="-521" can_close="true" can_drag_on_left="false" can_minimize="false"
can_resize="false" enabled="true" height="140" left="690" min_height="100"
can_resize="false" enabled="true" height="148" left="690" min_height="100"
min_width="100" mouse_opaque="true" name="Give Money"
rect_control="FloaterPayRectB" title="" width="300">
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-25" drop_shadow_visible="true" enabled="true" follows="left|top"
font="SansSerif" h_pad="0" halign="right" height="18" left="5"
mouse_opaque="true" name="payee_group" v_pad="0" width="75">
name="payee_group" v_pad="0" width="75">
Pay group:
</text>
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom_delta="0" drop_shadow_visible="true" enabled="true"
follows="left|top" font="SansSerif" h_pad="0" halign="right" height="18"
left="5" mouse_opaque="true" name="payee_resident" v_pad="0" width="75">
left="5" name="payee_resident" v_pad="0" width="75">
Pay resident:
</text>
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-25" drop_shadow_visible="true" enabled="true" follows="left|top"
font="SansSerif" h_pad="0" halign="left" height="18" left="85"
mouse_opaque="true" name="payee_name" v_pad="0" width="210">
name="payee_name" v_pad="0" width="210">
[NAME]
</text>
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-50" drop_shadow_visible="true" enabled="true" follows="left|top"
font="SansSerif" h_pad="0" halign="right" height="18" left="5"
mouse_opaque="true" name="object_name_label" v_pad="0" width="75">
name="object_name_label" v_pad="0" width="75">
Via object:
</text>
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-50" drop_shadow_visible="true" enabled="true" follows="left|top"
font="SansSerif" h_pad="0" halign="left" height="18" left="85"
mouse_opaque="true" name="object_name_text" v_pad="0" width="210">
name="object_name_text" v_pad="0" width="210">
...
</text>
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-72" drop_shadow_visible="true" enabled="true" follows="left|top"
font="SansSerif" h_pad="0" halign="right" height="18" left="5"
mouse_opaque="true" name="fastpay text" v_pad="0" width="75">
name="fastpay text" v_pad="0" width="75">
Fast Pay:
</text>
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-130" drop_shadow_visible="true" enabled="true" follows="left|top"
font="SansSerif" h_pad="0" halign="right" height="18" left="5"
mouse_opaque="true" name="amount text" v_pad="0" width="75">
name="amount text" v_pad="0" width="75">
Amount:
</text>
<button bottom="-74" enabled="true" font="SansSerif" halign="center" height="20"