alyssabat

Villager
Member
Joined
Jul 19, 2016
Messages
21
Reaction score
8
First Language
English
Primarily Uses
RMVXA
Wow its been 5 years.. I'm getting into the program again. Only beginner level at coding.
I am organizing my menus and they work as they should except for one thing.
temp.PNG

Here you can see all is well, cursor is fine. But when I click equip this happens
temp2.png
Now the cursor is the wrong size. Ive been looking at the scripts since yesterday but I cant find the problem, no results on google. I will post my script, maybe someone can see the issue
Code:
$data_system = load_data("Data/System.rvdata2") if $data_system == nil
class Scene_Equip < Scene_MenuBase
  def start
    super
    create_help_window
    create_status_window
    create_command_window
    create_slot_window
    create_item_window
  end

  def create_status_window
    @status_window = Window_EquipStatus.new(0, @help_window.height)
    @status_window.viewport = @viewport
    @status_window.actor = @actor
    @status_window.x = 106
    @status_window.y = 193
    @status_window.height = 140
    @status_window.width = 140
  end

  def create_command_window
    wx = @status_window.width
    wy = @help_window.height
    ww = Graphics.width - @status_window.width
    @command_window = Window_EquipCommand.new(wx, wy, ww)
    @command_window.viewport = @viewport
    @command_window.help_window = @help_window
    @command_window.set_handler(:equip,    method(:command_equip))
    @command_window.set_handler(:optimize, method(:command_optimize))
    @command_window.set_handler(:clear,    method(:command_clear))
    @command_window.set_handler(:cancel,   method(:return_scene))
    @command_window.set_handler(:pagedown, method(:next_actor))
    @command_window.set_handler(:pageup,   method(:prev_actor))
    @command_window.x = 106
    @command_window.y = 72
    @command_window.height = 120
    @command_window.width = 140
  end
 
  def create_slot_window
    wx = @status_window.width
    wy = @command_window.y + @command_window.height
    ww = Graphics.width - @status_window.width
    @slot_window = Window_EquipSlot.new(wx, wy, ww)
    @slot_window.viewport = @viewport
    @slot_window.help_window = @help_window
    @slot_window.status_window = @status_window
    @slot_window.actor = @actor
    @slot_window.set_handler(:ok,       method(:on_slot_ok))
    @slot_window.set_handler(:cancel,   method(:on_slot_cancel))
    @slot_window.x = 247
    @slot_window.y = 72
    @slot_window.height = 164
    @slot_window.width = 290
    end
 
  def create_item_window
    wx = 0
    wy = @slot_window.y + @slot_window.height
    ww = Graphics.width
    wh = Graphics.height - wy
    @item_window = Window_EquipItem.new(wx, wy, ww, wh)
    @item_window.viewport = @viewport
    @item_window.help_window = @help_window
    @help_window.x = 106
    @help_window.y = 335
    @help_window.height = fitting_height(3)
    @help_window.width = 432
    @item_window.status_window = @status_window
    @item_window.actor = @actor
    @item_window.set_handler(:ok,     method(:on_item_ok))
    @item_window.set_handler(:cancel, method(:on_item_cancel))
    @slot_window.item_window = @item_window
    @item_window.x = 247
    @item_window.y = 237
    @item_window.height = 96
    @item_window.width = 290
  end

  def line_height
    return 24
  end

  def standard_padding
    return 3
  end

  def fitting_height(line_number)
    line_number * line_height + standard_padding * 2
  end
end


class Window_EquipStatus < Window_Base
  def initialize(x, y)
    super(x, y, window_width, window_height)
    @actor = nil
    @temp_actor = nil
    refresh
  end
    
  def visible_line_number
    return 6
  end
 
  def refresh
    contents.clear
    draw_actor_name(@actor, 0, 0) if @actor
    draw_item(0, 20, 2)
    draw_item(0, 40, 3)
    draw_item(0, 60, 6)
    draw_item(0, 80, 7) 
   end
 
   def draw_item(x, y, param_id)
    draw_param_name(x + 4, y, param_id)
    draw_current_param(x + 34, y, param_id) if @actor
    draw_right_arrow(x + 64, y)
    draw_new_param(x + 69, y, param_id) if @temp_actor
  end
end
I have other scripts like this for the other menus. Otherwise I just have a script that changes the font, one that changes game size and one that fixes a text bug.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,334
Reaction score
15,157
First Language
English
Primarily Uses
RMMV

I've moved this thread to RGSSx Script Support. Thank you.

 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
356
Reaction score
101
First Language
English
Primarily Uses
RMXP
Err, why do you set the @command_window's dimensions twice?
 

alyssabat

Villager
Member
Joined
Jul 19, 2016
Messages
21
Reaction score
8
First Language
English
Primarily Uses
RMVXA
the part with wx and wy? When I removed it it caused an error so I left it in. But I needed to set the dimensions with just plain numbers.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,213
Reaction score
728
First Language
English
Primarily Uses
RMVXA
It looks like you rearranged the windows.
You will have to either plan and figure out which window is to take information from another or use specific numbers in the values.
ww is getting the size from graphics.width - @status_window.width.
But your status window is below the command window not to the left as it is in the default configuration.
You will have to use specific numbers and keep changing it until it looks right. that would be easier than readjusting all the wx, wy and ww values for what window is getting make and in what order.

You set the dimensions because you moved the windows.
All you needed to do was change the wx and wy numbers to the values you set below for @command.x and y.
1627825627031.png
Ruby:
    wx = 106#@status_window.width
    wy = 72#@help_window.height
    ww = 140#Graphics.width - @status_window.width
 

alyssabat

Villager
Member
Joined
Jul 19, 2016
Messages
21
Reaction score
8
First Language
English
Primarily Uses
RMVXA
It looks like you rearranged the windows.
You will have to either plan and figure out which window is to take information from another or use specific numbers in the values.
ww is getting the size from graphics.width - @status_window.width.
But your status window is below the command window not to the left as it is in the default configuration.
You will have to use specific numbers and keep changing it until it looks right. that would be easier than readjusting all the wx, wy and ww values for what window is getting make and in what order.

You set the dimensions because you moved the windows.
All you needed to do was change the wx and wy numbers to the values you set below for @command.x and y.
View attachment 197456
Ruby:
    wx = 106#@status_window.width
    wy = 72#@help_window.height
    ww = 140#Graphics.width - @status_window.width
Thank you a lot, it works just right. I appreciate the help. I am a total beginner, so my codes are probably quite messy.
 

Latest Threads

Latest Profile Posts

Holy cow, I have made Row Formation work again with OTB!

Now, my devious machinations can finally be born...
finished the second chapter of deltarune today, I gotta say that the 3 years wait was worth it lol

Forum statistics

Threads
115,148
Messages
1,087,646
Members
149,678
Latest member
reidrd
Top