geowar
07-28-2004, 01:26 AM
So how do i get it into Cosmos?
in <FrameXML/FriendsFrame.xml>:
<Button name="WhoFrameGroupInviteButton" inherits="UIPanelButtonTemplate" text="PARTY_INVITE">
<Size>
<AbsDimension x="55" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-40" y="82"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
InviteByName(WhoFrame.selectedName);
</OnClick>
</Scripts>
</Button>
<Button name="WhoFrameAddFriendButton" inherits="UIPanelButtonTemplate" text="ADD_FRIEND">
<Size>
<AbsDimension x="85" y="22"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="WhoFrameGroupInviteButton" relativePoint="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
AddFriend(WhoFrame.selectedName);
</OnClick>
</Scripts>
</Button>
<Button name="WhoFrameWhoButton" inherits="UIPanelButtonTemplate" text="REFRESH">
<Size>
<AbsDimension x="65" y="22"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="WhoFrameAddFriendButton" relativePoint="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
WhoFrameEditBox_OnEnterPressed();
</OnClick>
</Scripts>
</Button>
<Button name="WhoFrameSendMessageButton" inherits="UIPanelButtonTemplate" text="SEND_MESSAGE">
<Size>
<AbsDimension x="125" y="22"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="WhoFrameWhoButton" relativePoint="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
WhoFrame_SendMessage();
</OnClick>
</Scripts>
</Button>
and in <FrameXML/FriendsFrame.lua> added:
function WhoFrame_SendMessage()
local name = WhoFrame.selectedName;
if ( not ChatFrameEditBox:IsVisible() ) then
ChatFrame_OpenChat("/w "..name.." ");
else
ChatFrameEditBox:SetText("/w "..name.." ");
end
ChatEdit_ParseText(ChatFrame1.editBox, 0);
end
in <FrameXML/FriendsFrame.xml>:
<Button name="WhoFrameGroupInviteButton" inherits="UIPanelButtonTemplate" text="PARTY_INVITE">
<Size>
<AbsDimension x="55" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-40" y="82"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
InviteByName(WhoFrame.selectedName);
</OnClick>
</Scripts>
</Button>
<Button name="WhoFrameAddFriendButton" inherits="UIPanelButtonTemplate" text="ADD_FRIEND">
<Size>
<AbsDimension x="85" y="22"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="WhoFrameGroupInviteButton" relativePoint="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
AddFriend(WhoFrame.selectedName);
</OnClick>
</Scripts>
</Button>
<Button name="WhoFrameWhoButton" inherits="UIPanelButtonTemplate" text="REFRESH">
<Size>
<AbsDimension x="65" y="22"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="WhoFrameAddFriendButton" relativePoint="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
WhoFrameEditBox_OnEnterPressed();
</OnClick>
</Scripts>
</Button>
<Button name="WhoFrameSendMessageButton" inherits="UIPanelButtonTemplate" text="SEND_MESSAGE">
<Size>
<AbsDimension x="125" y="22"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="WhoFrameWhoButton" relativePoint="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
WhoFrame_SendMessage();
</OnClick>
</Scripts>
</Button>
and in <FrameXML/FriendsFrame.lua> added:
function WhoFrame_SendMessage()
local name = WhoFrame.selectedName;
if ( not ChatFrameEditBox:IsVisible() ) then
ChatFrame_OpenChat("/w "..name.." ");
else
ChatFrameEditBox:SetText("/w "..name.." ");
end
ChatEdit_ParseText(ChatFrame1.editBox, 0);
end