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,334
Reaction score
483
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,334
Reaction score
483
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: 1)

Latest Threads

Latest Posts

Latest Profile Posts

The nick "Toeuia" that I'm using comes from a, idk, you okay the chess game while chit chatting them. The first two are students. Then you know, finally, the champion, and then the champion's sensei. I played like this so many times until suddenly there's another chess master. Very naive but super smart. After he lost, he kinda advised me not to give up on chest. Because the next one was never seen beaten. Touya.
I'm currently playing Ara Fell - I can see why it's had generally good reviews. The exploration aspect is pretty strong and the writing is passable.

The game auto-saves and offers an option to turn back just before each major combat, and immediately brings the player back to the last position saved when there's a TPK. Convenient at the very least.
This is Krizzirk Toeuia Aeslan, I'm picking up transmission. Draftwingeds on, duty on, exhaust ready. 310 Immulicationsers approaching. I'll take the cake and----hold it!!! My Cosvere Radar detected 3001 of them!!
11 hours of programming... Only to add two more zoom levels.
Well, that's what happens when you decide between minimap and zoom too late.

It's my cute little ghost~

Forum statistics

Threads
99,374
Messages
964,610
Members
130,989
Latest member
FerdiPanther
Top