WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Disabling left click and right click on the chat edit box. (https://www.wowinterface.com/forums/showthread.php?t=58100)

HolyAA 07-15-20 06:27 PM

Disabling left click and right click on the chat edit box.
 
Hello there !

I've been writing my own UI last month to get rid of many addons. But here's my final boss.



I was set up like this before and got used by my edit box at center of the screen.
But sometimes i accidentally click on this space of the screen, opening chat box and writing "qqqqqqqqqqqqqqqdddddddddq" while being in raid. I'm looking for a way to disable clicking to open my edit chatbox and just using enter to do it.

I've been looking into this : https://github.com/Gethe/wow-ui-sour.../ChatFrame.lua

Found :

Quote:

function ChatFrame_OpenChat(text, chatFrame, desiredCursorPosition)
if chatFrame == nil and CHAT_FOCUS_OVERRIDE ~= nil then
if CHAT_FOCUS_OVERRIDE.supportsSlashCommands or not text or strsub(text, 0, 1) ~= "/" then
CHAT_FOCUS_OVERRIDE:SetFocus();
if text then
CHAT_FOCUS_OVERRIDE:SetText(text);
end
return;
end
end

local editBox = ChatEdit_ChooseBoxForSend(chatFrame);

ChatEdit_ActivateChat(editBox);
editBox.desiredCursorPosition = desiredCursorPosition;

if text then
editBox.text = text;
editBox.setText = 1;
end

if ( editBox:GetAttribute("chatType") == editBox:GetAttribute("stickyType") ) then
if ( (editBox:GetAttribute("stickyType") == "PARTY") and (not IsInGroup(LE_PARTY_CATEGORY_HOME)) or
(editBox:GetAttribute("stickyType") == "RAID") and (not IsInRaid(LE_PARTY_CATEGORY_HOME)) or
(editBox:GetAttribute("stickyType") == "INSTANCE_CHAT") and (not IsInGroup(LE_PARTY_CATEGORY_INSTANCE))) then
editBox:SetAttribute("chatType", "SAY");
end
end

ChatEdit_UpdateHeader(editBox);
return editBox;
end
But still, cannot find a way.

Hit me up if you have a hint.

kurapica.igas 07-15-20 08:05 PM

Try
Lua Code:
  1. ChatFrame1EditBox:EnableMouse(false)

HolyAA 07-15-20 08:21 PM

Quote:

Originally Posted by kurapica.igas (Post 336370)
Try
Lua Code:
  1. ChatFrame1EditBox:EnableMouse(false)

Thanks ! I didnt knew EnableMouse was a thing :o


All times are GMT -6. The time now is 01:52 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI