vegastrike / Assets-Masters

Vega Strike Upon The Coldest Sea Original Game Data Art Sources (e.g. hi-poly/hi-res source models/images)
8 stars 6 forks source link

On Intro Monologue screen, scrolling down past the end of the monologue causes a crash #30

Closed stephengtuggy closed 2 years ago

stephengtuggy commented 3 years ago

The error appears to be coming from the Python asset code:

TypeError: list indices must be integers or slices, not float
P-D-E commented 2 years ago

In modules/GUI.py, replacing line 1659

        self.firstVisible = max(0,min(len(self.items)-1-len(self._listitems)/2,self.firstVisible + lines))

with

        self.firstVisible = max(0,min(len(self.items)-1-len(self._listitems)//2,self.firstVisible + lines))

solves the issue, evaluating to 202 instead of 201.5 for the last intro page.

stephengtuggy commented 2 years ago

@P-D-E Cool! Thanks for figuring that out

stephengtuggy commented 2 years ago

@P-D-E Can you submit that fix as a pull request?

P-D-E commented 2 years ago

You're welcome, PR right above.

stephengtuggy commented 2 years ago

PR merged. Now we just need the same fix applied to the 0.8.x branch, and we'll be good to go.

P-D-E commented 2 years ago

@stephengtuggy Can you backport it or should I issue a separate PR on 0.8.x?

stephengtuggy commented 2 years ago

@stephengtuggy Can you backport it or should I issue a separate PR on 0.8.x?

@P-D-E Please do.

P-D-E commented 2 years ago

@stephengtuggy Done, PR above.

stephengtuggy commented 2 years ago

Issue fixed for both 0.8.x and master. Closing.