[RMXP] Rye's Collapsed CMS extra row?

Status
Not open for further replies.

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,842
Reaction score
5,225
First Language
Dutch
Primarily Uses
RMXP
I recently discovered Rye's Collapsed CMS and am editing it to fit my game better. I've run into a problem though: I have a lot more menu commands than this script uses, but they don't all fit on the first row. So I want to add an extra row, but how do I do that?
I have discovered how to make the height of the window longer, but not how to have the commands show up on this second row of the window.

Your help is much appreciated :)
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,960
First Language
English
Primarily Uses
RMMV
Code:
@column_max = commands.size
This is the line that determines that, as it basically just makes all the commands span one column. If you want it to cover multiple rows, change it so that it's a lower number than the number of commands there are and that should do the trick.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,842
Reaction score
5,225
First Language
Dutch
Primarily Uses
RMXP
@Trihan So I tried that out and changed it to 4 (I've got 8 commands, so 4 per row is what I'm aiming at), but it just shows the last 4 commands now and not the others. Is there anything else I need to change?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,960
First Language
English
Primarily Uses
RMMV
Is the window tall enough to show both rows and just not displaying one of them, or is it only tall enough for one row?
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,842
Reaction score
5,225
First Language
Dutch
Primarily Uses
RMXP
Yes, I doubled the height (and just to try it out now tripled it) and the window's tall enough, they just don't show up.

Just for clarity's sake, I changed the 64 to 128 in this line:
Code:
self.width, self.height = commands.size * width + 32, 64
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,960
First Language
English
Primarily Uses
RMMV
Ah, here.

Code:
def draw_item(i, color)
    self.contents.font.color = color
    w = (self.width - 32) / @column_max
    x = i % @column_max * w
    rect = Rect.new(x, 0, self.contents.width / @column_max, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.blt(x, 4, RPG::Cache.icon(@commands[i][0]),
          Rect.new(0, 0, 24, 24))
    self.contents.draw_text(rect, @commands[i][1], 1)
  end
Because it was originally intended to all be drawn on one row, the Y coordinate of the rect is hardcoded as 0. You'll have to change that to line_height * @column_max % [number of command you want on the first line]
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
281
Reaction score
106
First Language
English
Primarily Uses
RMXP
Think you meant
Code:
i / @column_max * line_height
where 32 is generally the default value for line_height.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,960
First Language
English
Primarily Uses
RMMV
Edit: I get you now. Yeah, that's probably right.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,842
Reaction score
5,225
First Language
Dutch
Primarily Uses
RMXP
Okay, so I changed the y to @KK20's snippet and that worked. But, the icons for the second row also appear on the first.
Screenshot for clarity:
1595320934466.png

EDIT: Okay, scratch that. I found it. Forgot every other y value (for the icon and the cursor) was also hardcoded. I changed it and now the icons are where they're supposed to be.

@Trihan and @KK20 Thanks for all the help! :D
 
Last edited:

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,960
First Language
English
Primarily Uses
RMMV
I was about to point that out but you seem to have caught it. Glad to be of assistance!
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,842
Reaction score
5,225
First Language
Dutch
Primarily Uses
RMXP
Thanks again. :D It's working perfectly.

Closing the thread now.
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,090
Members
137,587
Latest member
Usagiis
Top