[XP] Chat Mouse Click Activation

Started by Aegisrox, November 07, 2013, 09:38:02 am

Previous topic - Next topic

Aegisrox

November 07, 2013, 09:38:02 am Last Edit: November 07, 2013, 10:55:35 am by Aegisrox
Chat Mouse Click Activation
Authors: Wizered67, Aegisrox
Version: 1.0
Type: Mouse Script
Key Term: RMX-OS Plugin



Introduction

This scripts allow to activate the chat when you click on the chat line input, such as alternative to press the key F6.


Features


  • Press inside the chat box input line to activate the chat

  • Press outside of the chat box to desactivate




Screenshots

No Screenshots.  Only click on the text input of the chat of RMX!  What can I say?


Demo

No Demo


Script

Requires Mouse Controller of Blizzard in order to work.

class Scene_Map
   CHATBOX_X = 0
   CHATBOX_Y = RMXOS::Data::SCREEN_HEIGHT - (RMXOS::Options::CHATBOX_LINES * RMXOS::Data::ChatFontHeight) - RMXOS::Data::ChatFontHeight
   CHATBOX_WIDTH = RMXOS::Options::CHATBOX_WIDTH
   CHATBOX_HEIGHT = (RMXOS::Options::CHATBOX_LINES * RMXOS::Data::ChatFontHeight)
   alias update_chatbox update
   def update
   if Input.trigger?(Input::Key['Mouse Left'])
       if $mouse.x >= CHATBOX_X && $mouse.x <= CHATBOX_X + CHATBOX_WIDTH && $mouse.y >= CHATBOX_Y && $mouse.y <= CHATBOX_Y + CHATBOX_HEIGHT
           $game_temp.chat_active = true
       else
           $game_temp.chat_active = false
       end
   end

   update_chatbox
   end
end




Instructions

Just create a new script a put below de Blizzard Mouse controller



Compatibility

I don't know of any scripts this wouldn't be compatible with. But i tried with others mouse scripts and works great.


Credits and Thanks


  • Wizered67 for doing

  • Aegisrox for setting constants





Author's Notes
Enjoy it ;).
Crushing girls in the vanishing point......

ForeverZer0

Nice work.  :)
If you could fix the "Key Term" to one of the terms specified here, we can move it to the database. 
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Aegisrox

Thanks! ForeverZer0

I Just changed the key term! ;)

Regards

Aegis
Crushing girls in the vanishing point......

chaucer

nice script man ^^ It's pretty neat but, there's a small problem. When the chat window is invisible, if you click where it should be it will activate the box without making it visible, and your buttons wont work. You can simply click anywhere the box isnt to make it inactive but, I changed your script a little so the chat doesnt activate when chatbox is hidden.

Spoiler: ShowHide
class Scene_Map
    CHATBOX_X = 0
    CHATBOX_Y = RMXOS::Data::SCREEN_HEIGHT - (RMXOS::Options::CHATBOX_LINES * RMXOS::Data::ChatFontHeight) - RMXOS::Data::ChatFontHeight
    CHATBOX_WIDTH = RMXOS::Options::CHATBOX_WIDTH
    CHATBOX_HEIGHT = (RMXOS::Options::CHATBOX_LINES * RMXOS::Data::ChatFontHeight)
    alias update_chatbox update
    def update
    if Input.trigger?(Input::Key['Mouse Left'])
      if !$game_temp.chat_visible
        elsif $mouse.x >= CHATBOX_X && $mouse.x <= CHATBOX_X + CHATBOX_WIDTH && $mouse.y >= CHATBOX_Y && $mouse.y <= CHATBOX_Y + CHATBOX_HEIGHT
            $game_temp.chat_active = true
          else
            $game_temp.chat_active = false
          end
        end

    update_chatbox
    end
end

Wizered67

Thanks Chaucer. I messaged Aegisrox about that, but he never wrote me back.