Skip to content

Ckan Mac version show a cross after "recommended mods" #2396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rbcsky5 opened this issue Mar 30, 2018 · 2 comments · Fixed by #2399
Closed

Ckan Mac version show a cross after "recommended mods" #2396

rbcsky5 opened this issue Mar 30, 2018 · 2 comments · Fixed by #2399
Assignees
Labels
GUI Issues affecting the interactive GUI macOS Issues specific for macOS

Comments

@rbcsky5
Copy link

rbcsky5 commented Mar 30, 2018

Background

CKAN Version:
1.24.0

(Link removed, get https://github.com/KSP-CKAN/CKAN/releases/latest) (Using this version since the original .DMG version didn't work)

KSP Version:
1.4.1

Operating System:
macOS 10.13.3 (17D102)

Have you made any manual changes to your GameData folder (i.e., not via CKAN)?
No

Problem

What steps did you take in CKAN?
Install KAS, KIS, Trajectories, Dmagic orbital science, Kerbal Alarm clock (basically all mods that has "recommended" page

What did you expect to happen?
Run normally

What happened instead?
It shows a big red cross after showing the dependency/recommended window

Screenshots:

screen shot 2018-03-31 at 01 25 01

CKAN error codes (if applicable):

@HebaruSan HebaruSan added GUI Issues affecting the interactive GUI macOS Issues specific for macOS labels Mar 30, 2018
@KSP-CKAN KSP-CKAN deleted a comment from rbcsky5 Mar 31, 2018
@HebaruSan
Copy link
Member

Apparently WinForms sometimes does this when an exception is thrown:

https://blogs.msdn.microsoft.com/shawnhar/2010/11/22/winforms-and-the-big-red-x-of-doom/

@HebaruSan
Copy link
Member

HebaruSan commented Apr 8, 2018

If that post is correct, then this would be caused by an exception in this block;

CKAN/GUI/MainModList.cs

Lines 427 to 444 in a495f43

public class MainModListGUI : DataGridView
{
protected override void OnPaint(PaintEventArgs e)
{
//Hacky workaround for https://bugzilla.xamarin.com/show_bug.cgi?id=24372
if (Platform.IsMono && !Platform.IsMonoFour)
{
var first_row_index = typeof (MainModListGUI).BaseType
.GetField("first_row_index", BindingFlags.NonPublic | BindingFlags.Instance);
var value = (int) first_row_index.GetValue(this);
if (value < 0 || value >= Rows.Count)
{
first_row_index.SetValue(this, 0);
}
}
base.OnPaint(e);
}

That Platform.IsMonoFour check looks suspicious. It's false on Mono 3, true on Mono 4, but false again on Mono 5. The intention was to run a workaround on Mono 3, but now it's also running on Mono 5. That's probably bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI Issues affecting the interactive GUI macOS Issues specific for macOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants