How to make CAMouse Script compatible with two other script.

alexncf125

Villager
Member
Joined
Mar 21, 2016
Messages
20
Reaction score
0
First Language
English
Primarily Uses
The two scripts below cut a large window into several small windows.
Therefore, they cannot be used normally with mouse scripts.
Left-clicking and Scrolling on the choice list window and the selection of menu scenes will become invalid and confusing.

I tried to correct MouseCursor::oBSERVED_SUBJECT_WINDOW already.
But It doesn't make any better.

Can someone help me to improve them? Thanks you!

Galv’s Visual Novel Choices

メニュー画面-改3


CAMouse Script
 
Last edited:

alexncf125

Villager
Member
Joined
Mar 21, 2016
Messages
20
Reaction score
0
First Language
English
Primarily Uses
I just found that it seems that only a small modification to the def update_cursor part is needed to solve my problem. But the modification I tried is not correct, does anyone know how to modify it? Please help me.
 

alexncf125

Villager
Member
Joined
Mar 21, 2016
Messages
20
Reaction score
0
First Language
English
Primarily Uses
How did you find that?
After I commented the def update_cursor part,
when I click on the selection with the mouse,
it will become able to enter the next command as usual.
However, it will make an extra box on the selection.

Like this,
1.png

class xxxxxxx < xxxxxxx

.
.
.
.
.
.

alias galv_choice_call_ok_handler call_ok_handler
def call_ok_handler
galv_choice_call_ok_handler
dispose_bgs
end
alias galv_choice_call_cancel_handler call_cancel_handler
def call_cancel_handler
galv_choice_call_cancel_handler
dispose_bgs
end

#~ def update_cursor
#~ if $game_switches[Galv_Choice::DISABLE_SWITCH]
#~ super
#~ else
#~ cursor_rect.empty
#~ return if @cursor_sprite.nil? || @choice_sprite.nil?
#~ if @index < 0
#~ @cursor_sprite.opacity = 0
#~ else
#~ @cursor_sprite.opacity = Galv_Choice::CURSOR_OPACITY
#~ @cursor_sprite.x = @choice_sprite[@index].x + Galv_Choice::CURSOR_X_OFFSET
#~ @cursor_sprite.y = @choice_sprite[@index].y + Galv_Choice::CURSOR_Y_OFFSET
#~ @cursor_sprite.z = self.z - 1
#~ cursor_rect.y = (item_height * @index) + Galv_Choice::oTHER_Y_OFFSET
#~ end
#~ end
#~ end

end # Window_ChoiceList < Window_Command
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,207
Reaction score
448
First Language
English
Primarily Uses
RMVXA
Well if you are ok with the box. then this will work.

cursor_rect.set(item_rect(@index))

Ruby:
  def update_cursor
    if $game_switches[Galv_Choice::DISABLE_SWITCH]
      super
    else
      cursor_rect.empty
      return if @cursor_sprite.nil? || @choice_sprite.nil?
      if @index < 0
        @cursor_sprite.opacity = 0
      else
        @cursor_sprite.opacity = Galv_Choice::CURSOR_OPACITY
        @cursor_sprite.x = @choice_sprite[@index].x + Galv_Choice::CURSOR_X_OFFSET
        @cursor_sprite.y = @choice_sprite[@index].y + Galv_Choice::CURSOR_Y_OFFSET
        @cursor_sprite.z = self.z - 1
        cursor_rect.y = (item_height * @index) + Galv_Choice::OTHER_Y_OFFSET
      end
      cursor_rect.set(item_rect(@index))
    end
  end
 
end # Window_ChoiceList < Window_Command
 

alexncf125

Villager
Member
Joined
Mar 21, 2016
Messages
20
Reaction score
0
First Language
English
Primarily Uses
Well if you are ok with the box. then this will work.

cursor_rect.set(item_rect(@index))

Ruby:
  def update_cursor
    if $game_switches[Galv_Choice::DISABLE_SWITCH]
      super
    else
      cursor_rect.empty
      return if @cursor_sprite.nil? || @choice_sprite.nil?
      if @index < 0
        @cursor_sprite.opacity = 0
      else
        @cursor_sprite.opacity = Galv_Choice::CURSOR_OPACITY
        @cursor_sprite.x = @choice_sprite[@index].x + Galv_Choice::CURSOR_X_OFFSET
        @cursor_sprite.y = @choice_sprite[@index].y + Galv_Choice::CURSOR_Y_OFFSET
        @cursor_sprite.z = self.z - 1
        cursor_rect.y = (item_height * @index) + Galv_Choice::OTHER_Y_OFFSET
      end
      cursor_rect.set(item_rect(@index))
    end
  end

end # Window_ChoiceList < Window_Command
I am not ok with the box of course.

About your 'cursor_rect.set(item_rect(@index))'. What is it do?
The box will still show after I used it.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,207
Reaction score
448
First Language
English
Primarily Uses
RMVXA
I am not ok with the box of course.
A little more tinkering around and I have a solution. Not sure if it is the best but it works.

In Galv's script put after line 293
Code:
cursor_rect.width = item_width
In CAMouse on line 1789, change to
Code:
    return false unless cursor_y <= @mouse_y && @mouse_y < cursor_y + 20
The issue was that the cursor_rect width and height were not set for the mouse script or they are not used in galv's script.
Setting a width works fine, but as soon as you specify a height in galv's script the box shows up.
So putting in a number to simulate a cursor_rect height works.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Latest Threads

Latest Posts

Latest Profile Posts

Stream will be live shortly with some pixel art! Feel free to drop by!

Can't believe I forgot to put an image of my drawing pad! It looks kinda like this, maybe I'll get a better pic tomorrow...
Backup tip: If you don't want to back up your whole project every day, at least back up everything *except* your Image and Audio folders, which you can do weekly/as needed/etc.
The final version of our game is already available both in English and Spanish! ^___^
Can't believe this day has finally come... T_T
Im so happy that Dead By Daylight is getting a Silent Hill chapter! Cant wait to play as pyramid head

Forum statistics

Threads
97,815
Messages
947,152
Members
129,035
Latest member
Tauron7
Top