Solved Making options exclusive to the title screen options bar

Henry

Internet Clown
Member
Posts
9
#1
So I'm using a certain script that, when you're playing the game and you change the size of the window, crashes the game, so I'm wondering if it's possible to disable that option while playing the game, but not in the titlescreen? For context, this is what I mean:



Any help would be appreciated, thanks!
 
#2
Yeah, just go to PScreen Options and take this out of the code:
EnumOption.new(_INTL("Screen Size"),[_INTL("S"),_INTL("M"),_INTL("L"),_INTL("Full")],
proc { [$PokemonSystem.screensize,3].min },
proc {|value|
oldvalue = $PokemonSystem.screensize
$PokemonSystem.screensize = value
if value!=oldvalue
pbSetResizeFactor($PokemonSystem.screensize)
ObjectSpace.each_object(TilemapLoader){|o| o.updateClass if !o.disposed? }
end
}
),
 

Henry

Internet Clown
Member
Posts
9
#3
Yeah, just go to PScreen Options and take this out of the code:
EnumOption.new(_INTL("Screen Size"),[_INTL("S"),_INTL("M"),_INTL("L"),_INTL("Full")],
proc { [$PokemonSystem.screensize,3].min },
proc {|value|
oldvalue = $PokemonSystem.screensize
$PokemonSystem.screensize = value
if value!=oldvalue
pbSetResizeFactor($PokemonSystem.screensize)
ObjectSpace.each_object(TilemapLoader){|o| o.updateClass if !o.disposed? }
end
}
),
Sorry if it was confusing, but I meant making the option to change the screen size exclusive to the title screen, not removing it altogether. Thank you for trying though!
 

Henry

Internet Clown
Member
Posts
9
#5
That's what I'm thinking, but since I'm still a noob at scripting, I don't know what I would use for a conditional lol
 

Vendily

Trainer
Member
Posts
94
#6
you could check for the existence, or rather lack thereof, of a global variable only set up after the game loads (new or continue). i know $game_variables doesn't exist on the title screen.
 

Henry

Internet Clown
Member
Posts
9
#7
oh thats a good idea! while trying to see what i could do for that, i also realized i could probably add something to the option option in the pause menu, like it enabling a switch that disables it, so i'll test it out and get back here if anybody needs help with something like this in the future!
 

boonzeet

Developer of Pokemon: Secrets of the Ages
Member
Posts
33
#9
update: switches don't work no matter what i do so ig that wont work, f.
Remove the screen size option (the whole EnumOption.new segment for it) from the @PokemonOptions = section.

Immediately ABOVE the line @PokemonOptions = pbAddOnOptions(@PokemonOptions), insert:

Ruby:
if !defined?($game_variables)
      @PokemonOptions.push(EnumOption.new(_INTL("Screen Size"),[_INTL("S"),_INTL("M"),_INTL("L"),_INTL("Full")],
         proc { [$PokemonSystem.screensize,3].min },
         proc {|value|
           oldvalue = $PokemonSystem.screensize
           $PokemonSystem.screensize = value
           if value!=oldvalue
             pbSetResizeFactor($PokemonSystem.screensize)
             ObjectSpace.each_object(TilemapLoader){|o| o.updateClass if !o.disposed? }
           end
         }
       ))
    end
Credit to Vendily, who was right on the mark with checking for $game_variables.
 

Henry

Internet Clown
Member
Posts
9
#10
Remove the screen size option (the whole EnumOption.new segment for it) from the @PokemonOptions = section.

Immediately ABOVE the line @PokemonOptions = pbAddOnOptions(@PokemonOptions), insert:

Ruby:
if !defined?($game_variables)
      @PokemonOptions.push(EnumOption.new(_INTL("Screen Size"),[_INTL("S"),_INTL("M"),_INTL("L"),_INTL("Full")],
         proc { [$PokemonSystem.screensize,3].min },
         proc {|value|
           oldvalue = $PokemonSystem.screensize
           $PokemonSystem.screensize = value
           if value!=oldvalue
             pbSetResizeFactor($PokemonSystem.screensize)
             ObjectSpace.each_object(TilemapLoader){|o| o.updateClass if !o.disposed? }
           end
         }
       ))
    end
Credit to Vendily, who was right on the mark with checking for $game_variables.
It works! Ty so much! I'm still a complete newbie so I really appreciate it ^^
 
Top