Skip to content
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

Add .getCursorBlink to monitors and terminals #577

Merged
merged 1 commit into from May 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/main/java/dan200/computercraft/core/apis/TermAPI.java
Expand Up @@ -78,7 +78,8 @@ public String[] getMethodNames()
"setPaletteColour",
"setPaletteColor",
"getPaletteColour",
"getPaletteColor"
"getPaletteColor",
"getCursorBlink",
};
}

Expand Down Expand Up @@ -298,6 +299,9 @@ public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull O
}
return null;
}
case 23:
// getCursorBlink
return new Object[] { m_terminal.getCursorBlink() };
default:
{
return null;
Expand Down
Expand Up @@ -65,7 +65,8 @@ public String[] getMethodNames()
"setPaletteColour",
"setPaletteColor",
"getPaletteColour",
"getPaletteColor"
"getPaletteColor",
"getCursorBlink",
};
}

Expand Down Expand Up @@ -249,8 +250,13 @@ public Object[] callMethod( @Nonnull IComputerAccess computer, @Nonnull ILuaCont
}
return null;
}
case 24:
// getCursorBlink
Terminal terminal = m_monitor.getTerminal().getTerminal();
return new Object[] { terminal.getCursorBlink() };
default:
return null;
}
return null;
}

@Override
Expand Down
Expand Up @@ -258,6 +258,10 @@ function create( parent, nX, nY, nWidth, nHeight, bStartVisible )
end
end

function window.getCursorBlink()
return bCursorBlink
end

local function isColor()
return parent.isColor()
end
Expand Down