Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Problems with MACL move method

Status
Not open for further replies.
Hey people,
I'm trying to make an animated CMS using the "move" method in "Method and Class Library", but I'm with this problem when trying to animate the equipment scene item window with this small script:
Code:
class Window_EquipItem
  alias_method :ozycth_cms_weqitem_init, :initialize
  def initialize(*args)
    ozycth_cms_weqitem_init(*args)
    self.x = -width
  end
  def visible=(value)
    # p "#{@equip_type} : #{value}"
    self.move(value ? 0 : -width, y, 16)
  end
end
the windows are moving correctly when I set visible = true but when I set visible = false the windows are not backing to the screen corner. I've already checked and the values are correct. Can someone help me?
 
Thanks, I believe it's upadting because I'm using all SDK parts...

Edit:I think I know what's happening... I think these item windows in equip scene are not updated automatically.

Edit again: I was right. I have added a flag to enable the SDK auto-update when then window is not active and it worked. This is how my script is now:
Code:
class Window_EquipItem
  alias_method :ozycth_cms_weqitem_init, :initialize
  def initialize(*args)
    ozycth_cms_weqitem_init(*args)
    self.x = -width
    [COLOR=Red]@disable_update = false[/COLOR]
  end
  def visible=(value)
    self.move_x(value ? 0 : -width, 16)
    [COLOR=Red]@disable_update = value[/COLOR]
  end
[COLOR=Red]  def disable_update?
    return @disable_update
  end[/COLOR]
end
Thanks Trickster, your question about if the window is being updated helped a lot. I'll report the thread now.
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top