Project

General

Profile

Feedback #18434

Requesting permission to release mod with Reflection to work around stock bug

Added by linuxgurugamer about 6 years ago. Updated about 4 years ago.

Status:
Closed
Severity:
Low
Assignee:
-
Category:
Application
Target version:
Version:
Platform:
Windows
Expansion:
Core Game
Language:
English (US)
Mod Related:
No
Votes:
Arrow u r green
Arrow d r red

Description

There is a bug on the stock Settings screen which shows up if you have too many mods installed which add their own pages to the Settings screen. This can break a game if you happen to go into the settings screen when you have too many mods. The left scrolllist simply extends and doesn't properly limit itself, the OK and Cancel buttons are aligned with the bottom of the scrollist, so if you have too many, the OK and Cancel buttons are inaccessable, thereby breaking the game.

This mod is designed to work around the bug by disabling some of the settings pages before you go there.

The mod uses the public field GameParameters.ParameterTypes for most of the work. By trial and error I found that removing entries removed them from the settings screen.

The problem comes when going back to the game, apparently there is a private dictionary:

HighLogic.CurrentGame.Parameters.customParams

which seems to have entries removed when they aren't there in the ParameterTypes field. I wrote a little bit of Reflection to get this field which I was then able to repopulate properly.

If this field doesn't get repopulated, then mods can't find their settings pages

I wrote this because this bug has been around since at least 1.3.1, if not earlier.

Only issue I have seen so far is that when returning from the settings page to the game, there will be a short period when errors will be shown in the log because the field hasn't yet been repopulated. Once returned to the game, the errors go away.

The EULA and forum rules state that no private fields are to be used. I'm asking for permission to release this so that those people who have heavily modded games can use the settings pages without breaking the game.

I did an early release (before I knew about the reflection issue) which I pulled, but you can see the page here: https://forum.kerbalspaceprogram.com/index.php?/topic/173489-131-141-settings-master/

Thanks


Related issues

Related to Kerbal Space Program - Bug #17073: Too many mods for settings page to displayClosed01/22/2018

History

#1 Updated by Squelch about 6 years ago

  • Tracker changed from Bug to Feedback

#2 Updated by Squelch about 6 years ago

  • Related to Bug #17073: Too many mods for settings page to display added

#3 Updated by linuxgurugamer about 6 years ago

while this will be resolved for 1.4.3, it's still a problem for 1.3.1

So, I'd still like permission, if possible

#4 Updated by linuxgurugamer about 6 years ago

  • Version changed from 1.4.1 to 1.3.1

Changed version to 1.3.1, but really, it's for 1.3.1, 1.4.0, 1.4.1, 1.4.2

#5 Updated by nestor over 4 years ago

  • Status changed from New to Ready to Test
  • Target version set to 1.8.1

#6 Updated by nestor over 4 years ago

  • Status changed from Ready to Test to Resolved

#7 Updated by chris.fulton about 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF