Skip to content

Commit

Permalink
Add cornerRadius and anchorMargin configuration, regenerate screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
nickavv committed Sep 13, 2020
1 parent f7e4863 commit b15eced
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 13 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ The following variables on the `obj_shell` object can be configured. They are de
| `width` | The width, in GUI pixels, of the shell | 500 |
| `height` | The height, in GUI pixels, of the shell | 96 |
| `screenAnchorPoint` | The location on the screen to anchor the console to, as a string. Possible values are `"top"` or `"bottom"`. | `"bottom"` |
| `anchorMargin` | The number of pixels away from the anchor point to draw the shell. In practice, the margin from the top or bottom of the screen, depending on how you have set `screenAnchorPoint` | 4
| `prompt` | A character or string to print as a command prompt | $ |
| `promptColor` | The font color to draw the prompt, as a GML expression | `make_color_rgb(237, 0, 54)` |
| `consoleColor` | The background color of the console itself, as a GML expression | `c_black` |
| `consoleAlpha` | The opacity of the console itself, 0.0 being fully transparent and 1.0 being fully opaque | 0.9 |
| `consoleFont` | The GML font resource to draw all the console text with. The default is included with the package, and uses the Raph Levien's "Inconsolata" font | `font_console` |
| `fontColor` | The font color to draw all console text with, as a GML expression | `make_color_rgb(255, 242, 245)` |
| `fontColorSecondary` | The font color to draw suggestions and history with, as a GML expression | `make_color_rgb(140, 118, 123)` |
| `cornerRadius` | The radius in pixels to round the corners of the shell. A value of 0 would result in perfectly squared corners | 12 |

You can see examples of various ways to customize the shell's appearance on the [Theme Gallery](THEMING.md) page!

Expand Down
32 changes: 22 additions & 10 deletions THEMING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ The default rt-shell theme<br>
obj_shell.consoleColor = c_black;
obj_shell.fontColor = make_color_rgb(255, 242, 245);
obj_shell.fontColorSecondary = make_color_rgb(140, 118, 123);
obj_shell.cornerRadius = 12;
obj_shell.anchorMargin = 4;
obj_shell.promptColor = make_color_rgb(237, 0, 54);
obj_shell.prompt = "$";</code></pre><br>
<td>
Expand All @@ -24,6 +26,8 @@ A light version of the default rt-shell theme<br>
obj_shell.consoleColor = make_color_rgb(235, 235, 235);
obj_shell.fontColor = make_color_rgb(40, 40, 45);
obj_shell.fontColorSecondary = make_color_rgb(120, 120, 128);
obj_shell.cornerRadius = 12;
obj_shell.anchorMargin = 4;
obj_shell.promptColor = make_color_rgb(29, 29, 196);
obj_shell.prompt = "$";</code></pre><br>
<tr>
Expand All @@ -35,6 +39,8 @@ A cobalt gray and ocean blue theme<br>
obj_shell.consoleColor = make_color_rgb(29, 31, 33);
obj_shell.fontColor = make_color_rgb(197, 200, 198);
obj_shell.fontColorSecondary = make_color_rgb(116, 127, 140);
obj_shell.cornerRadius = 0;
obj_shell.anchorMargin = 0;
obj_shell.promptColor = make_color_rgb(57, 113, 237);
obj_shell.prompt = "%";</code></pre><br>
<td>
Expand All @@ -45,26 +51,32 @@ The popular <a href="https://draculatheme.com/">Dracula theme</a>!<br>
obj_shell.consoleColor = make_color_rgb(40, 42, 54);
obj_shell.fontColor = make_color_rgb(248, 248, 242);
obj_shell.fontColorSecondary = make_color_rgb(98, 114, 164);
obj_shell.cornerRadius = 8;
obj_shell.anchorMargin = 4;
obj_shell.promptColor = make_color_rgb(80, 250, 123);
obj_shell.prompt = "->";</code></pre><br>
<tr>
<td>
<b>solarized-dark</b><br>
<img src="images/theme-solarized-dark.png" width="500" alt="solarized-dark theme" /><br><br>
The popular <a href="https://ethanschoonover.com/solarized/">Solarized Dark theme</a>!<br>
<pre><code>obj_shell.consoleAlpha = 1;
obj_shell.consoleColor = make_color_rgb(0, 43, 54);
obj_shell.fontColor = make_color_rgb(131, 148, 150);
obj_shell.fontColorSecondary = make_color_rgb(88, 110, 117);
obj_shell.promptColor = make_color_rgb(42, 161, 152);
obj_shell.prompt = "~";</code></pre><br>
<td>
<b>solarized-light</b><br>
<img src="images/theme-solarized-light.png" width="500" alt="solarized-light theme" /><br><br>
The popular <a href="https://ethanschoonover.com/solarized/">Solarized Light theme</a>!<br>
<pre><code>obj_shell.consoleAlpha = 1;
obj_shell.consoleColor = make_color_rgb(253, 246, 227);
obj_shell.fontColor = make_color_rgb(101, 123, 131);
obj_shell.fontColorSecondary = make_color_rgb(147, 161, 161);
obj_shell.cornerRadius = 2;
obj_shell.anchorMargin = 4;
obj_shell.promptColor = make_color_rgb(42, 161, 152);
obj_shell.prompt = "~";</code></pre><br>
<td>
<b>solarized-dark</b><br>
<img src="images/theme-solarized-dark.png" width="500" alt="solarized-dark theme" /><br><br>
The popular <a href="https://ethanschoonover.com/solarized/">Solarized Dark theme</a>!<br>
<pre><code>obj_shell.consoleAlpha = 1;
obj_shell.consoleColor = make_color_rgb(0, 43, 54);
obj_shell.fontColor = make_color_rgb(131, 148, 150);
obj_shell.fontColorSecondary = make_color_rgb(88, 110, 117);
obj_shell.cornerRadius = 2;
obj_shell.anchorMargin = 4;
obj_shell.promptColor = make_color_rgb(42, 161, 152);
obj_shell.prompt = "~";</code></pre><br>
Binary file modified images/theme-dracula.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/theme-ocean-blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/theme-rtshell-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/theme-rtshell-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/theme-solarized-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/theme-solarized-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions rt-shell/objects/obj_shell/Draw_64.gml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ surface_set_target(shellSurface);
draw_clear_alpha(c_black, 0.0);
draw_set_color(consoleColor);
draw_set_alpha(consoleAlpha);
draw_roundrect_ext(0, 0, width, height, 12, 12, false);
draw_roundrect_ext(0, 0, width, height, cornerRadius, cornerRadius, false);

draw_set_font(consoleFont);
var lineHeight = string_height(prompt);
Expand Down Expand Up @@ -49,8 +49,8 @@ surface_reset_target();
if (isOpen) {
var yPos = 0;
switch (screenAnchorPoint) {
case "top": yPos = 4; break;
case "bottom": yPos = (display_get_gui_height() - height - 4); break;
case "top": yPos = anchorMargin; break;
case "bottom": yPos = (display_get_gui_height() - height - anchorMargin); break;
}
draw_surface(shellSurface, (display_get_gui_width() - width) / 2, yPos);
}
2 changes: 2 additions & 0 deletions rt-shell/objects/obj_shell/obj_shell.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions rt-shell/scripts/scr_shell_scripts/scr_shell_scripts.gml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ function sh_theme_rtshell_dark() {
obj_shell.consoleColor = c_black;
obj_shell.fontColor = make_color_rgb(255, 242, 245);
obj_shell.fontColorSecondary = make_color_rgb(140, 118, 123);
obj_shell.cornerRadius = 12;
obj_shell.anchorMargin = 4;
obj_shell.promptColor = make_color_rgb(237, 0, 54);
obj_shell.prompt = "$";
}
Expand All @@ -81,6 +83,8 @@ function sh_theme_rtshell_light() {
obj_shell.consoleColor = make_color_rgb(235, 235, 235);
obj_shell.fontColor = make_color_rgb(40, 40, 45);
obj_shell.fontColorSecondary = make_color_rgb(120, 120, 128);
obj_shell.cornerRadius = 12;
obj_shell.anchorMargin = 4;
obj_shell.promptColor = make_color_rgb(29, 29, 196);
obj_shell.prompt = "$";
}
Expand All @@ -90,6 +94,8 @@ function sh_theme_ocean_blue() {
obj_shell.consoleColor = make_color_rgb(29, 31, 33);
obj_shell.fontColor = make_color_rgb(197, 200, 198);
obj_shell.fontColorSecondary = make_color_rgb(116, 127, 140);
obj_shell.cornerRadius = 0;
obj_shell.anchorMargin = 0;
obj_shell.promptColor = make_color_rgb(57, 113, 237);
obj_shell.prompt = "%";
}
Expand All @@ -99,6 +105,8 @@ function sh_theme_dracula() {
obj_shell.consoleColor = make_color_rgb(40, 42, 54);
obj_shell.fontColor = make_color_rgb(248, 248, 242);
obj_shell.fontColorSecondary = make_color_rgb(98, 114, 164);
obj_shell.cornerRadius = 8;
obj_shell.anchorMargin = 4;
obj_shell.promptColor = make_color_rgb(80, 250, 123);
obj_shell.prompt = "->";
}
Expand All @@ -108,6 +116,8 @@ function sh_theme_solarized_light() {
obj_shell.consoleColor = make_color_rgb(253, 246, 227);
obj_shell.fontColor = make_color_rgb(101, 123, 131);
obj_shell.fontColorSecondary = make_color_rgb(147, 161, 161);
obj_shell.cornerRadius = 2;
obj_shell.anchorMargin = 4;
obj_shell.promptColor = make_color_rgb(42, 161, 152);
obj_shell.prompt = "~";
}
Expand All @@ -117,6 +127,8 @@ function sh_theme_solarized_dark() {
obj_shell.consoleColor = make_color_rgb(0, 43, 54);
obj_shell.fontColor = make_color_rgb(131, 148, 150);
obj_shell.fontColorSecondary = make_color_rgb(88, 110, 117);
obj_shell.cornerRadius = 2;
obj_shell.anchorMargin = 4;
obj_shell.promptColor = make_color_rgb(42, 161, 152);
obj_shell.prompt = "~";
}

0 comments on commit b15eced

Please sign in to comment.