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

NETSCRIPT: Added changing tail font size through scripts #1852

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

G4mingJon4s
Copy link
Contributor

It is now possible to change the font size for each tail window through the API. The font size is stored on the RunningScript, also giving access to the current font size value through ns.self and other API functions.

This adds another function to the general netscript functions. Since there are a lot of tail specific functions, it would make sense to move them to their own interface. If this is desired, I would be more than happy to move them in this PR.

Test code:

export async function main(ns: NS) {
  ns.disableLog("ALL");
  ns.clearLog();
  ns.tail();

  ns.print("Test string");
  ns.print("Multi\nLine\nStuff");

  while (true) {
    await ns.asleep(1000);
    ns.setTailFontSize(); // omitting resets the font size to the default, set in the style editor

    await ns.asleep(1000);
    ns.setTailFontSize(20);

    await ns.asleep(1000);
    ns.setTailFontSize(16);

    await ns.asleep(1000);
    ns.setTailFontSize(12);
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant