Character Select Script
#3
Because Selwyn did not include redesigned versions of the 'top_row', the 'top_row=' and 'page_row_max' methods within Window_CharSelect. Couple that with a incorrectly designed 'update_cursor_rect' because he DID neglect to include reference to the redesiged methods.

So.... add the following methods to Window_CharSelect:
Code:
#--------------------------------------------------------------------------
  # * Get Top Row
  #--------------------------------------------------------------------------
  def top_row
    # Divide y-coordinate of window contents transfer origin by 1 row
    # height of 192
    return self.oy / 192
  end  
  #--------------------------------------------------------------------------
  # * Set Top Row
  #     row : row shown on top
  #--------------------------------------------------------------------------
  def top_row=(row)
    # If row is less than 0, change it to 0
    if row < 0
      row = 0
    end
    # If row exceeds row_max - 1, change it to row_max - 1
    if row > row_max - 1
      row = row_max - 1
    end
    # Multiply 1 row height by 32 for y-coordinate of window contents
    # transfer origin
    self.oy = row * 192
  end
  #--------------------------------------------------------------------------
  # * Get Number of Rows Displayable on 1 Page
  #--------------------------------------------------------------------------
  def page_row_max
    # Subtract a frame height of 32 from the window height, and divide it by
    # 1 row height of 32
    return (self.height - 32) / 192
  end

And replace the 'update_cursor_rect' in the class with THIS one:
Code:
#--------------------------------------------------------------------------
  # (>^_^)>   update_cursor_rect
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # Get current row
    row = @index / @column_max
    # If current row is before top row
    if row < self.top_row
      # Scroll so that current row becomes top row
      self.top_row = row
    end
    # If current row is more to back than back row
    if row > self.top_row + (self.page_row_max - 1)
      # Scroll so that current row becomes back row
      self.top_row = row - (self.page_row_max - 1)
    end    
    # Calculate cursor width
    cursor_width = self.width / @column_max - 32
    # Calculate cursor coordinates
    x = @index % @column_max * (148 + 1)
    y = @index / @column_max * 192 - self.oy
    # Update cursor rectangle
    self.cursor_rect.set(x, y, 149, 192)
  end

5 minutes bay bee.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }


Messages In This Thread
Character Select Script - by Selwyn - 03-03-2008, 06:20 AM
RE: Character Select Script - by JayRay - 02-25-2017, 11:51 PM
RE: Character Select Script - by DerVVulfman - 02-26-2017, 04:29 AM
RE: Character Select Script - by JayRay - 03-07-2017, 04:14 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Text Scroll Script - Enhanced DerVVulfman 23 34,324 02-18-2021, 04:16 AM
Last Post: DerVVulfman
   Cursor Script Selwyn 7 15,364 09-28-2019, 02:13 PM
Last Post: DerVVulfman
   ACBS FIX SCRIPT #2: Advanced Cry Correction DerVVulfman 1 4,776 08-09-2019, 03:42 PM
Last Post: aeliath
   ACBS FIX SCRIPT #1: Victory Cries Patch DerVVulfman 1 4,710 08-08-2019, 02:53 PM
Last Post: aeliath
   Spritesheet Generator Conversion Script DerVVulfman 0 4,254 11-21-2018, 04:48 AM
Last Post: DerVVulfman
   Neo Mode 7 Script by MGCaladtogel MGC 59 125,483 09-29-2017, 03:48 AM
Last Post: DerVVulfman
   Longer Script Calls LiTTleDRAgo 0 4,966 05-17-2017, 12:36 AM
Last Post: LiTTleDRAgo
   SLOLS: Snake Look-alike on Load Script Zeriab 3 11,273 05-14-2017, 06:25 PM
Last Post: LiTTleDRAgo
   ELSA (Event Layering Script Advance) JayRay 0 6,018 02-25-2015, 04:15 AM
Last Post: JayRay
   Random Map Generator Script Tonbi 30 54,960 02-13-2014, 06:47 PM
Last Post: ShadowIce



Users browsing this thread: 1 Guest(s)