Skip to content

Commit

Permalink
Merge pull request dan200#577 from SquidDev-CC/ComputerCraft/feature/…
Browse files Browse the repository at this point in the history
…get-blink

Add .getCursorBlink to monitors and terminals
  • Loading branch information
SquidDev committed Sep 28, 2018
2 parents ee4735c + 1ba7345 commit 33fad2d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/main/java/dan200/computercraft/core/apis/TermAPI.java
Expand Up @@ -64,7 +64,8 @@ public String[] getMethodNames()
"setPaletteColour",
"setPaletteColor",
"getPaletteColour",
"getPaletteColor"
"getPaletteColor",
"getCursorBlink",
};
}

Expand Down Expand Up @@ -284,6 +285,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 @@ -66,7 +66,8 @@ public String[] getMethodNames()
"setPaletteColor",
"getPaletteColour",
"getPaletteColor",
"getTextScale"
"getTextScale",
"getCursorBlink",
};
}

Expand Down Expand Up @@ -245,8 +246,12 @@ public Object[] callMethod( @Nonnull IComputerAccess computer, @Nonnull ILuaCont
// getTextScale
return new Object[] { monitor.getTextScale() / 2.0 };
}
case 25:
// getCursorBlink
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

0 comments on commit 33fad2d

Please sign in to comment.