Menu Toolbar for Editor + Shell Prompts + Theme
* Added a "menu toolbar" to the top of the Edit Mode with useful buttons
that work: New Level, New Doodad (same thing), Save, Save as, Open.
* Added ability for the dev console to prompt the user for a question,
which opens the console automatically. "Save", "Save as" and "Load"
ask for their filenames this way.
* Started groundwork for theming the app. The palette window is a light
brown with an orange title bar, the Menu Toolbar has a black
background, etc.
* Added support for multiple fonts instead of just monospace. DejaVu
Sans (normal and bold) are used now for most labels and window titles,
respectively. The dev console uses DejaVu Sans Mono as before.
* Update ui.Label to accept PadX and PadY separately instead of only
having the Padding option which did both.
* Improvements to Frame packing algorithm.
* Set the SDL draw mode to BLEND so we can use alpha colors properly,
so now the dev console is semi-translucent.
2018-08-12 00:30:00 +00:00
|
|
|
package balance
|
|
|
|
|
|
|
|
import (
|
2022-09-24 22:17:25 +00:00
|
|
|
magicform "git.kirsle.net/SketchyMaze/doodle/pkg/uix/magic-form"
|
2019-12-23 02:21:58 +00:00
|
|
|
"git.kirsle.net/go/render"
|
2019-12-28 00:31:58 +00:00
|
|
|
"git.kirsle.net/go/ui"
|
WIP Publish Dialog + UI Improvements
* File->Publish Level in the Level Editor opens the Publish window,
where you can embed custom doodads into your level and export a
portable .level file you can share with others.
* Currently does not actually export a level file yet.
* The dialog lists all unique doodad names in use in your level, and
designates which are built-ins and which are custom (paginated).
* A checkbox would let the user embed built-in doodads into their level,
as well, locking it in to those versions and not using updated
versions from future game releases.
UI Improvements:
* Added styling for a "Primary" UI button, rendered in deep blue.
* Pop-up modals (Alert, Confirm) color their Ok button as Primary.
* The Enter key pressed during an Alert or Confirm modal will invoke its
default button and close the modal, corresponding to its Primary
button.
* The developer console is now opened with the tilde/grave key ` instead
of the Enter key, so that the Enter key is free to click through
modals.
* In the "Open/Edit Drawing" window, a "Browse..." button is added to
the level and doodad sections, spawning a native File Open dialog to
pick a .level or .doodad outside the config root.
2021-06-11 05:31:30 +00:00
|
|
|
"git.kirsle.net/go/ui/style"
|
Menu Toolbar for Editor + Shell Prompts + Theme
* Added a "menu toolbar" to the top of the Edit Mode with useful buttons
that work: New Level, New Doodad (same thing), Save, Save as, Open.
* Added ability for the dev console to prompt the user for a question,
which opens the console automatically. "Save", "Save as" and "Load"
ask for their filenames this way.
* Started groundwork for theming the app. The palette window is a light
brown with an orange title bar, the Menu Toolbar has a black
background, etc.
* Added support for multiple fonts instead of just monospace. DejaVu
Sans (normal and bold) are used now for most labels and window titles,
respectively. The dev console uses DejaVu Sans Mono as before.
* Update ui.Label to accept PadX and PadY separately instead of only
having the Padding option which did both.
* Improvements to Frame packing algorithm.
* Set the SDL draw mode to BLEND so we can use alpha colors properly,
so now the dev console is semi-translucent.
2018-08-12 00:30:00 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Theme and appearance variables.
|
|
|
|
var (
|
2022-01-03 00:28:43 +00:00
|
|
|
// Sprite filenames.
|
2021-12-31 00:31:45 +00:00
|
|
|
WindowIcon = "assets/icons/96.png"
|
2022-01-03 00:28:43 +00:00
|
|
|
GoldCoin = "assets/sprites/gold.png"
|
|
|
|
SilverCoin = "assets/sprites/silver.png"
|
|
|
|
LockIcon = "assets/sprites/padlock.png"
|
Doodad/Actor Runtime Options
* Add "Options" support for Doodads: these allow for individual Actor instances
on your level to customize properties about the doodad. They're like "Tags"
except the player can customize them on a per-actor basis.
* Doodad Editor: you can specify the Options in the Doodad Properties window.
* Level Editor: when the Actor Tool is selected, on mouse-over of an actor,
clicking on the gear icon will open a new "Actor Properties" window which
shows metadata (title, author, ID, position) and an Options tab to configure
the actor's options.
Updates to the scripting API:
* Self.Options() returns a list of option names defined on the Doodad.
* Self.GetOption(name) returns the value for the named option, or nil if
neither the actor nor its doodad have the option defined. The return type
will be correctly a string, boolean or integer type.
Updates to the doodad command-line tool:
* `doodad show` will print the Options on a .doodad file and, when showing a
.level file with --actors, prints any customized Options with the actors.
* `doodad edit-doodad` adds a --option parameter to define options.
Options added to the game's built-in doodads:
* Warp Doors: "locked (exit only)" will make it so the door can not be opened
by the player, giving the "locked" message (as if it had no linked door),
but the player may still exit from the door if sent by another warp door.
* Electric Door & Electric Trapdoor: "opened" can make the door be opened by
default when the level begins instead of closed. A switch or a button that
removes power will close the door as normal.
* Colored Doors & Small Key Door: "unlocked" will make the door unlocked at
level start, not requiring a key to open it.
* Colored Keys & Small Key: "has gravity" will make the key subject to gravity
and set its Mobile flag so that if it falls onto a button, it will activate.
* Gemstones: they had gravity by default; you can now uncheck "has gravity" to
remove their Gravity and IsMobile status.
* Gemstone Totems: "has gemstone" will set the totem to its unlocked status by
default with the gemstone inserted. No power signal will be emitted; it is
cosmetic only.
* Fire Region: "name" can let you set a name for the fire region similarly to
names for fire pixels: "Watch out for ${name}!"
* Invisible Warp Door: "locked (exit only)" added as well.
2022-10-10 00:41:24 +00:00
|
|
|
GearIcon = "assets/sprites/gear.png"
|
2022-05-05 05:38:26 +00:00
|
|
|
|
|
|
|
// Cursors
|
|
|
|
CursorIcon = "assets/sprites/pointer.png"
|
|
|
|
PencilIcon = "assets/sprites/pencil.png"
|
|
|
|
FloodCursor = "assets/sprites/flood-cursor.png"
|
2021-12-31 00:31:45 +00:00
|
|
|
|
2022-10-10 04:39:43 +00:00
|
|
|
// Pixel attributes
|
|
|
|
AttrSolid = "assets/sprites/attr-solid.png"
|
|
|
|
AttrFire = "assets/sprites/attr-fire.png"
|
|
|
|
AttrWater = "assets/sprites/attr-water.png"
|
|
|
|
AttrSemiSolid = "assets/sprites/attr-semisolid.png"
|
|
|
|
AttrSlippery = "assets/sprites/attr-slippery.png"
|
|
|
|
|
2020-04-22 06:50:45 +00:00
|
|
|
// Title Screen Font
|
|
|
|
TitleScreenFont = render.Text{
|
|
|
|
Size: 46,
|
|
|
|
Color: render.Pink,
|
|
|
|
Stroke: render.SkyBlue,
|
|
|
|
Shadow: render.Black,
|
|
|
|
}
|
2021-07-12 04:54:28 +00:00
|
|
|
TitleScreenSubtitleFont = render.Text{
|
2022-03-06 06:44:54 +00:00
|
|
|
FontFilename: SansSerifFont,
|
2021-07-12 04:54:28 +00:00
|
|
|
Size: 18,
|
|
|
|
Color: render.SkyBlue,
|
|
|
|
Shadow: render.SkyBlue.Darken(128),
|
|
|
|
// Color: render.RGBA(255, 153, 0, 255),
|
|
|
|
// Shadow: render.RGBA(200, 80, 0, 255),
|
|
|
|
}
|
|
|
|
TitleScreenVersionFont = render.Text{
|
|
|
|
Size: 14,
|
|
|
|
Color: render.Grey,
|
|
|
|
Shadow: render.Black,
|
|
|
|
}
|
2020-04-22 06:50:45 +00:00
|
|
|
|
2021-07-19 03:04:24 +00:00
|
|
|
// Loading Screen fonts.
|
|
|
|
LoadScreenFont = render.Text{
|
|
|
|
Size: 46,
|
|
|
|
Color: render.Pink,
|
|
|
|
Stroke: render.SkyBlue,
|
|
|
|
Shadow: render.Black,
|
|
|
|
}
|
|
|
|
LoadScreenSecondaryFont = render.Text{
|
2022-03-06 06:44:54 +00:00
|
|
|
FontFilename: SansSerifFont,
|
2021-07-19 03:04:24 +00:00
|
|
|
Size: 18,
|
|
|
|
Color: render.SkyBlue,
|
|
|
|
Shadow: render.SkyBlue.Darken(128),
|
|
|
|
// Color: render.RGBA(255, 153, 0, 255),
|
|
|
|
// Shadow: render.RGBA(200, 80, 0, 255),
|
|
|
|
}
|
|
|
|
|
2021-10-05 02:51:31 +00:00
|
|
|
// Play Mode Touch UI Hints Font
|
|
|
|
TouchHintsFont = render.Text{
|
2022-03-06 06:44:54 +00:00
|
|
|
FontFilename: SansSerifFont,
|
2021-10-05 02:51:31 +00:00
|
|
|
Size: 14,
|
|
|
|
Color: render.SkyBlue,
|
|
|
|
Shadow: render.SkyBlue.Darken(128),
|
|
|
|
Padding: 8,
|
|
|
|
PadY: 12,
|
|
|
|
}
|
|
|
|
|
Menu Toolbar for Editor + Shell Prompts + Theme
* Added a "menu toolbar" to the top of the Edit Mode with useful buttons
that work: New Level, New Doodad (same thing), Save, Save as, Open.
* Added ability for the dev console to prompt the user for a question,
which opens the console automatically. "Save", "Save as" and "Load"
ask for their filenames this way.
* Started groundwork for theming the app. The palette window is a light
brown with an orange title bar, the Menu Toolbar has a black
background, etc.
* Added support for multiple fonts instead of just monospace. DejaVu
Sans (normal and bold) are used now for most labels and window titles,
respectively. The dev console uses DejaVu Sans Mono as before.
* Update ui.Label to accept PadX and PadY separately instead of only
having the Padding option which did both.
* Improvements to Frame packing algorithm.
* Set the SDL draw mode to BLEND so we can use alpha colors properly,
so now the dev console is semi-translucent.
2018-08-12 00:30:00 +00:00
|
|
|
// Window and panel styles.
|
|
|
|
TitleConfig = ui.Config{
|
|
|
|
Background: render.MustHexColor("#FF9900"),
|
|
|
|
OutlineSize: 1,
|
|
|
|
OutlineColor: render.Black,
|
|
|
|
}
|
|
|
|
TitleFont = render.Text{
|
2022-03-06 06:44:54 +00:00
|
|
|
FontFilename: SansBoldFont,
|
2020-07-10 02:38:37 +00:00
|
|
|
Size: 9,
|
Menu Toolbar for Editor + Shell Prompts + Theme
* Added a "menu toolbar" to the top of the Edit Mode with useful buttons
that work: New Level, New Doodad (same thing), Save, Save as, Open.
* Added ability for the dev console to prompt the user for a question,
which opens the console automatically. "Save", "Save as" and "Load"
ask for their filenames this way.
* Started groundwork for theming the app. The palette window is a light
brown with an orange title bar, the Menu Toolbar has a black
background, etc.
* Added support for multiple fonts instead of just monospace. DejaVu
Sans (normal and bold) are used now for most labels and window titles,
respectively. The dev console uses DejaVu Sans Mono as before.
* Update ui.Label to accept PadX and PadY separately instead of only
having the Padding option which did both.
* Improvements to Frame packing algorithm.
* Set the SDL draw mode to BLEND so we can use alpha colors properly,
so now the dev console is semi-translucent.
2018-08-12 00:30:00 +00:00
|
|
|
Padding: 4,
|
|
|
|
Color: render.White,
|
|
|
|
Stroke: render.Red,
|
|
|
|
}
|
|
|
|
WindowBackground = render.MustHexColor("#cdb689")
|
|
|
|
WindowBorder = render.Grey
|
|
|
|
|
2021-10-08 01:24:18 +00:00
|
|
|
// Developer Shell and Flashed Messages styles.
|
|
|
|
FlashStrokeDarken = 60
|
|
|
|
FlashShadowDarken = 120
|
|
|
|
FlashFont = func(text string) render.Text {
|
|
|
|
return render.Text{
|
|
|
|
Text: text,
|
|
|
|
Size: 18,
|
|
|
|
Color: render.SkyBlue,
|
|
|
|
Stroke: render.SkyBlue.Darken(FlashStrokeDarken),
|
|
|
|
Shadow: render.SkyBlue.Darken(FlashShadowDarken),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FlashErrorColor = render.MustHexColor("#FF9900")
|
|
|
|
|
Menu Toolbar for Editor + Shell Prompts + Theme
* Added a "menu toolbar" to the top of the Edit Mode with useful buttons
that work: New Level, New Doodad (same thing), Save, Save as, Open.
* Added ability for the dev console to prompt the user for a question,
which opens the console automatically. "Save", "Save as" and "Load"
ask for their filenames this way.
* Started groundwork for theming the app. The palette window is a light
brown with an orange title bar, the Menu Toolbar has a black
background, etc.
* Added support for multiple fonts instead of just monospace. DejaVu
Sans (normal and bold) are used now for most labels and window titles,
respectively. The dev console uses DejaVu Sans Mono as before.
* Update ui.Label to accept PadX and PadY separately instead of only
having the Padding option which did both.
* Improvements to Frame packing algorithm.
* Set the SDL draw mode to BLEND so we can use alpha colors properly,
so now the dev console is semi-translucent.
2018-08-12 00:30:00 +00:00
|
|
|
// Menu bar styles.
|
|
|
|
MenuBackground = render.Black
|
|
|
|
MenuFont = render.Text{
|
|
|
|
Size: 12,
|
|
|
|
PadX: 4,
|
|
|
|
}
|
2020-07-10 02:38:37 +00:00
|
|
|
MenuFontBold = render.Text{
|
2022-03-06 06:44:54 +00:00
|
|
|
FontFilename: SansBoldFont,
|
2020-07-10 02:38:37 +00:00
|
|
|
Size: 12,
|
|
|
|
PadX: 4,
|
|
|
|
}
|
Menu Toolbar for Editor + Shell Prompts + Theme
* Added a "menu toolbar" to the top of the Edit Mode with useful buttons
that work: New Level, New Doodad (same thing), Save, Save as, Open.
* Added ability for the dev console to prompt the user for a question,
which opens the console automatically. "Save", "Save as" and "Load"
ask for their filenames this way.
* Started groundwork for theming the app. The palette window is a light
brown with an orange title bar, the Menu Toolbar has a black
background, etc.
* Added support for multiple fonts instead of just monospace. DejaVu
Sans (normal and bold) are used now for most labels and window titles,
respectively. The dev console uses DejaVu Sans Mono as before.
* Update ui.Label to accept PadX and PadY separately instead of only
having the Padding option which did both.
* Improvements to Frame packing algorithm.
* Set the SDL draw mode to BLEND so we can use alpha colors properly,
so now the dev console is semi-translucent.
2018-08-12 00:30:00 +00:00
|
|
|
|
2021-07-26 04:46:55 +00:00
|
|
|
// TabFrame styles.
|
|
|
|
TabFont = render.Text{
|
|
|
|
Size: 12,
|
|
|
|
PadX: 8,
|
|
|
|
PadY: 4,
|
|
|
|
}
|
|
|
|
|
2020-11-17 07:20:24 +00:00
|
|
|
// Modal backdrop color.
|
|
|
|
ModalBackdrop = render.RGBA(1, 1, 1, 42)
|
|
|
|
|
Menu Toolbar for Editor + Shell Prompts + Theme
* Added a "menu toolbar" to the top of the Edit Mode with useful buttons
that work: New Level, New Doodad (same thing), Save, Save as, Open.
* Added ability for the dev console to prompt the user for a question,
which opens the console automatically. "Save", "Save as" and "Load"
ask for their filenames this way.
* Started groundwork for theming the app. The palette window is a light
brown with an orange title bar, the Menu Toolbar has a black
background, etc.
* Added support for multiple fonts instead of just monospace. DejaVu
Sans (normal and bold) are used now for most labels and window titles,
respectively. The dev console uses DejaVu Sans Mono as before.
* Update ui.Label to accept PadX and PadY separately instead of only
having the Padding option which did both.
* Improvements to Frame packing algorithm.
* Set the SDL draw mode to BLEND so we can use alpha colors properly,
so now the dev console is semi-translucent.
2018-08-12 00:30:00 +00:00
|
|
|
// StatusFont is the font for the status bar.
|
|
|
|
StatusFont = render.Text{
|
|
|
|
Size: 12,
|
|
|
|
Padding: 4,
|
|
|
|
Color: render.Black,
|
|
|
|
}
|
2018-10-20 22:42:49 +00:00
|
|
|
|
2019-06-25 21:57:11 +00:00
|
|
|
// UIFont is the main font for UI labels.
|
|
|
|
UIFont = render.Text{
|
|
|
|
Size: 12,
|
|
|
|
Padding: 4,
|
|
|
|
Color: render.Black,
|
|
|
|
}
|
|
|
|
|
|
|
|
// LabelFont is the font for strong labels in UI.
|
|
|
|
LabelFont = render.Text{
|
|
|
|
Size: 12,
|
2022-03-06 06:44:54 +00:00
|
|
|
FontFilename: SansBoldFont,
|
2019-06-25 21:57:11 +00:00
|
|
|
Padding: 4,
|
|
|
|
Color: render.Black,
|
|
|
|
}
|
|
|
|
|
2022-01-03 00:28:43 +00:00
|
|
|
// A New Record! Label (Gold/Perfect and Silver/Normal)
|
|
|
|
NewRecordPerfectFont = LabelFont.Update(render.Text{
|
|
|
|
Color: render.Yellow,
|
|
|
|
Stroke: render.Orange,
|
|
|
|
})
|
|
|
|
NewRecordFont = LabelFont.Update(render.Text{
|
|
|
|
Color: render.White,
|
|
|
|
Stroke: render.Grey,
|
|
|
|
})
|
|
|
|
|
2021-09-03 04:26:55 +00:00
|
|
|
LargeLabelFont = render.Text{
|
|
|
|
Size: 18,
|
2022-03-06 06:44:54 +00:00
|
|
|
FontFilename: SansBoldFont,
|
2021-09-03 04:26:55 +00:00
|
|
|
Padding: 4,
|
|
|
|
Color: render.Black,
|
|
|
|
}
|
|
|
|
|
Eraser Tool, Brush Sizes
* Implement Brush Sizes for drawtool.Stroke and add a UI to the tools panel
to control the brush size.
* Brush sizes: 1, 2, 4, 8, 16, 24, 32, 48, 64
* Add the Eraser Tool to editor mode. It uses a default brush size of 16
and a max size of 32 due to some performance issues.
* The Undo/Redo system now remembers the original color of pixels when
you change them, so that Undo will set them back how they were instead
of deleting the pixel entirely. Due to performance issues, this only
happens when your Brush Size is 0 (drawing single-pixel shapes).
* UI: Add an IntVariable option to ui.Label to bind showing the value of
an int reference.
Aforementioned performance issues:
* When we try to remember whole rects of pixels for drawing thick
shapes, it requires a ton of scanning for each step of the shape. Even
de-duplicating pixel checks, tons of extra reads are constantly
checked.
* The Eraser is the only tool that absolutely needs to be able to
remember wiped pixels AND have large brush sizes. The performance
sucks and lags a bit if you erase a lot all at once, but it's a
trade-off for now.
* So pixels aren't remembered when drawing lines in your level with
thick brushes, so the Undo action will simply delete your pixels and not
reset them. Only the Eraser can bring back pixels.
2019-07-12 02:07:46 +00:00
|
|
|
// SmallMonoFont for cramped spaces like the +/- buttons on Toolbar.
|
|
|
|
SmallMonoFont = render.Text{
|
|
|
|
Size: 14,
|
|
|
|
PadX: 3,
|
2022-03-06 06:44:54 +00:00
|
|
|
FontFilename: MonospaceFont,
|
Eraser Tool, Brush Sizes
* Implement Brush Sizes for drawtool.Stroke and add a UI to the tools panel
to control the brush size.
* Brush sizes: 1, 2, 4, 8, 16, 24, 32, 48, 64
* Add the Eraser Tool to editor mode. It uses a default brush size of 16
and a max size of 32 due to some performance issues.
* The Undo/Redo system now remembers the original color of pixels when
you change them, so that Undo will set them back how they were instead
of deleting the pixel entirely. Due to performance issues, this only
happens when your Brush Size is 0 (drawing single-pixel shapes).
* UI: Add an IntVariable option to ui.Label to bind showing the value of
an int reference.
Aforementioned performance issues:
* When we try to remember whole rects of pixels for drawing thick
shapes, it requires a ton of scanning for each step of the shape. Even
de-duplicating pixel checks, tons of extra reads are constantly
checked.
* The Eraser is the only tool that absolutely needs to be able to
remember wiped pixels AND have large brush sizes. The performance
sucks and lags a bit if you erase a lot all at once, but it's a
trade-off for now.
* So pixels aren't remembered when drawing lines in your level with
thick brushes, so the Undo action will simply delete your pixels and not
reset them. Only the Eraser can bring back pixels.
2019-07-12 02:07:46 +00:00
|
|
|
Color: render.Black,
|
|
|
|
}
|
|
|
|
|
2021-06-20 05:14:41 +00:00
|
|
|
// CodeLiteralFont for rendering <code>-like text.
|
|
|
|
CodeLiteralFont = render.Text{
|
|
|
|
Size: 11,
|
|
|
|
PadX: 3,
|
2022-03-06 06:44:54 +00:00
|
|
|
FontFilename: MonospaceFont,
|
2021-06-20 05:14:41 +00:00
|
|
|
Color: render.Magenta,
|
|
|
|
}
|
|
|
|
|
2022-09-25 04:58:01 +00:00
|
|
|
// ExceptionFont for showing JavaScript errors to the user.
|
|
|
|
ExceptionFont = render.Text{
|
|
|
|
Size: 12,
|
|
|
|
PadX: 3,
|
|
|
|
FontFilename: MonospaceFont,
|
|
|
|
Color: render.Black,
|
|
|
|
}
|
|
|
|
|
2021-06-13 23:03:32 +00:00
|
|
|
// Small font
|
|
|
|
SmallFont = render.Text{
|
|
|
|
Size: 10,
|
2021-10-07 05:22:34 +00:00
|
|
|
Padding: 2,
|
2021-06-13 23:03:32 +00:00
|
|
|
Color: render.Black,
|
|
|
|
}
|
|
|
|
|
2018-10-20 22:42:49 +00:00
|
|
|
// Color for draggable doodad.
|
|
|
|
DragColor = render.MustHexColor("#0099FF")
|
2019-06-26 01:36:53 +00:00
|
|
|
|
2019-07-05 23:04:36 +00:00
|
|
|
// Link lines drawn between connected doodads.
|
|
|
|
LinkLineColor = render.Magenta
|
|
|
|
LinkLighten = 128
|
|
|
|
LinkAnimSpeed uint64 = 30 // ticks
|
|
|
|
|
2019-06-26 01:36:53 +00:00
|
|
|
PlayButtonFont = render.Text{
|
2022-03-06 06:44:54 +00:00
|
|
|
FontFilename: SansBoldFont,
|
2019-06-26 01:36:53 +00:00
|
|
|
Size: 16,
|
|
|
|
Padding: 4,
|
|
|
|
Color: render.RGBA(255, 255, 0, 255),
|
|
|
|
Stroke: render.RGBA(100, 100, 0, 255),
|
|
|
|
}
|
2020-07-10 02:38:37 +00:00
|
|
|
|
2022-01-03 00:28:43 +00:00
|
|
|
// In-game level timer font.
|
|
|
|
TimerFont = render.Text{
|
2022-03-06 06:44:54 +00:00
|
|
|
FontFilename: MonospaceFont,
|
2022-01-03 00:28:43 +00:00
|
|
|
Size: 16,
|
|
|
|
Color: render.Cyan,
|
|
|
|
Stroke: render.DarkCyan,
|
|
|
|
}
|
|
|
|
|
2020-07-10 02:38:37 +00:00
|
|
|
// Doodad Dropper Window settings.
|
|
|
|
DoodadButtonBackground = render.RGBA(255, 255, 200, 255)
|
|
|
|
DoodadButtonSize = 64
|
|
|
|
DoodadDropperCols = 6 // rows/columns of buttons
|
|
|
|
DoodadDropperRows = 3
|
WIP Publish Dialog + UI Improvements
* File->Publish Level in the Level Editor opens the Publish window,
where you can embed custom doodads into your level and export a
portable .level file you can share with others.
* Currently does not actually export a level file yet.
* The dialog lists all unique doodad names in use in your level, and
designates which are built-ins and which are custom (paginated).
* A checkbox would let the user embed built-in doodads into their level,
as well, locking it in to those versions and not using updated
versions from future game releases.
UI Improvements:
* Added styling for a "Primary" UI button, rendered in deep blue.
* Pop-up modals (Alert, Confirm) color their Ok button as Primary.
* The Enter key pressed during an Alert or Confirm modal will invoke its
default button and close the modal, corresponding to its Primary
button.
* The developer console is now opened with the tilde/grave key ` instead
of the Enter key, so that the Enter key is free to click through
modals.
* In the "Open/Edit Drawing" window, a "Browse..." button is added to
the level and doodad sections, spawning a native File Open dialog to
pick a .level or .doodad outside the config root.
2021-06-11 05:31:30 +00:00
|
|
|
|
2023-01-02 20:36:12 +00:00
|
|
|
// CheatsMenu window settings.
|
|
|
|
CheatsMenuBackground = render.RGBA(0, 153, 153, 255)
|
|
|
|
|
WIP Publish Dialog + UI Improvements
* File->Publish Level in the Level Editor opens the Publish window,
where you can embed custom doodads into your level and export a
portable .level file you can share with others.
* Currently does not actually export a level file yet.
* The dialog lists all unique doodad names in use in your level, and
designates which are built-ins and which are custom (paginated).
* A checkbox would let the user embed built-in doodads into their level,
as well, locking it in to those versions and not using updated
versions from future game releases.
UI Improvements:
* Added styling for a "Primary" UI button, rendered in deep blue.
* Pop-up modals (Alert, Confirm) color their Ok button as Primary.
* The Enter key pressed during an Alert or Confirm modal will invoke its
default button and close the modal, corresponding to its Primary
button.
* The developer console is now opened with the tilde/grave key ` instead
of the Enter key, so that the Enter key is free to click through
modals.
* In the "Open/Edit Drawing" window, a "Browse..." button is added to
the level and doodad sections, spawning a native File Open dialog to
pick a .level or .doodad outside the config root.
2021-06-11 05:31:30 +00:00
|
|
|
// Button styles, customized in init().
|
2021-06-14 04:23:26 +00:00
|
|
|
ButtonPrimary = style.DefaultButton
|
|
|
|
ButtonDanger = style.DefaultButton
|
|
|
|
ButtonBabyBlue = style.DefaultButton
|
|
|
|
ButtonPink = style.DefaultButton
|
|
|
|
ButtonLightRed = style.DefaultButton
|
2021-10-11 22:57:33 +00:00
|
|
|
|
|
|
|
DefaultCrosshairColor = render.RGBA(0, 153, 255, 255)
|
2022-05-01 22:18:23 +00:00
|
|
|
|
|
|
|
// Default built-in wallpapers.
|
|
|
|
Wallpapers = []magicform.Option{
|
|
|
|
{
|
|
|
|
Label: "Notebook",
|
|
|
|
Value: "notebook.png",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Label: "Legal Pad",
|
|
|
|
Value: "legal.png",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Label: "Graph paper",
|
|
|
|
Value: "graph.png",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Label: "Dotted paper",
|
|
|
|
Value: "dots.png",
|
|
|
|
},
|
2022-05-04 04:15:39 +00:00
|
|
|
{
|
|
|
|
Label: "Dotted paper (dark)",
|
|
|
|
Value: "dots-dark.png",
|
|
|
|
},
|
2022-05-01 22:18:23 +00:00
|
|
|
{
|
|
|
|
Label: "Blueprint",
|
|
|
|
Value: "blueprint.png",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Label: "Red parchment",
|
|
|
|
Value: "red-parchment.png",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Label: "Green parchment",
|
|
|
|
Value: "green-parchment.png",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Label: "Blue parchment",
|
|
|
|
Value: "blue-parchment.png",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Label: "Yellow parchment",
|
|
|
|
Value: "yellow-parchment.png",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Label: "White parchment",
|
|
|
|
Value: "white-parchment.png",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Label: "Pure white",
|
|
|
|
Value: "white.png",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Separator: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Label: "Custom wallpaper...",
|
|
|
|
Value: CustomWallpaperFilename,
|
|
|
|
},
|
|
|
|
}
|
Menu Toolbar for Editor + Shell Prompts + Theme
* Added a "menu toolbar" to the top of the Edit Mode with useful buttons
that work: New Level, New Doodad (same thing), Save, Save as, Open.
* Added ability for the dev console to prompt the user for a question,
which opens the console automatically. "Save", "Save as" and "Load"
ask for their filenames this way.
* Started groundwork for theming the app. The palette window is a light
brown with an orange title bar, the Menu Toolbar has a black
background, etc.
* Added support for multiple fonts instead of just monospace. DejaVu
Sans (normal and bold) are used now for most labels and window titles,
respectively. The dev console uses DejaVu Sans Mono as before.
* Update ui.Label to accept PadX and PadY separately instead of only
having the Padding option which did both.
* Improvements to Frame packing algorithm.
* Set the SDL draw mode to BLEND so we can use alpha colors properly,
so now the dev console is semi-translucent.
2018-08-12 00:30:00 +00:00
|
|
|
)
|
WIP Publish Dialog + UI Improvements
* File->Publish Level in the Level Editor opens the Publish window,
where you can embed custom doodads into your level and export a
portable .level file you can share with others.
* Currently does not actually export a level file yet.
* The dialog lists all unique doodad names in use in your level, and
designates which are built-ins and which are custom (paginated).
* A checkbox would let the user embed built-in doodads into their level,
as well, locking it in to those versions and not using updated
versions from future game releases.
UI Improvements:
* Added styling for a "Primary" UI button, rendered in deep blue.
* Pop-up modals (Alert, Confirm) color their Ok button as Primary.
* The Enter key pressed during an Alert or Confirm modal will invoke its
default button and close the modal, corresponding to its Primary
button.
* The developer console is now opened with the tilde/grave key ` instead
of the Enter key, so that the Enter key is free to click through
modals.
* In the "Open/Edit Drawing" window, a "Browse..." button is added to
the level and doodad sections, spawning a native File Open dialog to
pick a .level or .doodad outside the config root.
2021-06-11 05:31:30 +00:00
|
|
|
|
2021-09-11 23:52:22 +00:00
|
|
|
// Customize the various button styles.
|
WIP Publish Dialog + UI Improvements
* File->Publish Level in the Level Editor opens the Publish window,
where you can embed custom doodads into your level and export a
portable .level file you can share with others.
* Currently does not actually export a level file yet.
* The dialog lists all unique doodad names in use in your level, and
designates which are built-ins and which are custom (paginated).
* A checkbox would let the user embed built-in doodads into their level,
as well, locking it in to those versions and not using updated
versions from future game releases.
UI Improvements:
* Added styling for a "Primary" UI button, rendered in deep blue.
* Pop-up modals (Alert, Confirm) color their Ok button as Primary.
* The Enter key pressed during an Alert or Confirm modal will invoke its
default button and close the modal, corresponding to its Primary
button.
* The developer console is now opened with the tilde/grave key ` instead
of the Enter key, so that the Enter key is free to click through
modals.
* In the "Open/Edit Drawing" window, a "Browse..." button is added to
the level and doodad sections, spawning a native File Open dialog to
pick a .level or .doodad outside the config root.
2021-06-11 05:31:30 +00:00
|
|
|
func init() {
|
2021-09-11 23:52:22 +00:00
|
|
|
// Primary: white on rich blue color
|
WIP Publish Dialog + UI Improvements
* File->Publish Level in the Level Editor opens the Publish window,
where you can embed custom doodads into your level and export a
portable .level file you can share with others.
* Currently does not actually export a level file yet.
* The dialog lists all unique doodad names in use in your level, and
designates which are built-ins and which are custom (paginated).
* A checkbox would let the user embed built-in doodads into their level,
as well, locking it in to those versions and not using updated
versions from future game releases.
UI Improvements:
* Added styling for a "Primary" UI button, rendered in deep blue.
* Pop-up modals (Alert, Confirm) color their Ok button as Primary.
* The Enter key pressed during an Alert or Confirm modal will invoke its
default button and close the modal, corresponding to its Primary
button.
* The developer console is now opened with the tilde/grave key ` instead
of the Enter key, so that the Enter key is free to click through
modals.
* In the "Open/Edit Drawing" window, a "Browse..." button is added to
the level and doodad sections, spawning a native File Open dialog to
pick a .level or .doodad outside the config root.
2021-06-11 05:31:30 +00:00
|
|
|
ButtonPrimary.Background = render.RGBA(0, 60, 153, 255)
|
|
|
|
ButtonPrimary.Foreground = render.RGBA(255, 255, 254, 255)
|
|
|
|
ButtonPrimary.HoverBackground = render.RGBA(0, 153, 255, 255)
|
|
|
|
ButtonPrimary.HoverForeground = ButtonPrimary.Foreground
|
2021-06-13 23:03:32 +00:00
|
|
|
|
2021-09-11 23:52:22 +00:00
|
|
|
// Danger: white on red
|
2021-06-13 23:03:32 +00:00
|
|
|
ButtonDanger.Background = render.RGBA(153, 30, 30, 255)
|
|
|
|
ButtonDanger.Foreground = render.RGBA(255, 255, 254, 255)
|
|
|
|
ButtonDanger.HoverBackground = render.RGBA(255, 30, 30, 255)
|
|
|
|
ButtonDanger.HoverForeground = ButtonPrimary.Foreground
|
2021-06-14 04:23:26 +00:00
|
|
|
|
2021-09-11 23:52:22 +00:00
|
|
|
ButtonBabyBlue.Background = render.RGBA(40, 200, 255, 255)
|
|
|
|
ButtonBabyBlue.Foreground = render.Black
|
2021-06-14 04:23:26 +00:00
|
|
|
ButtonBabyBlue.HoverBackground = render.RGBA(0, 220, 255, 255)
|
2021-09-11 23:52:22 +00:00
|
|
|
ButtonBabyBlue.HoverForeground = render.Black
|
2021-06-14 04:23:26 +00:00
|
|
|
|
|
|
|
ButtonPink.Background = render.RGBA(255, 153, 255, 255)
|
|
|
|
ButtonPink.HoverBackground = render.RGBA(255, 220, 255, 255)
|
|
|
|
|
|
|
|
ButtonLightRed.Background = render.RGBA(255, 90, 90, 255)
|
|
|
|
ButtonLightRed.HoverBackground = render.RGBA(255, 128, 128, 255)
|
WIP Publish Dialog + UI Improvements
* File->Publish Level in the Level Editor opens the Publish window,
where you can embed custom doodads into your level and export a
portable .level file you can share with others.
* Currently does not actually export a level file yet.
* The dialog lists all unique doodad names in use in your level, and
designates which are built-ins and which are custom (paginated).
* A checkbox would let the user embed built-in doodads into their level,
as well, locking it in to those versions and not using updated
versions from future game releases.
UI Improvements:
* Added styling for a "Primary" UI button, rendered in deep blue.
* Pop-up modals (Alert, Confirm) color their Ok button as Primary.
* The Enter key pressed during an Alert or Confirm modal will invoke its
default button and close the modal, corresponding to its Primary
button.
* The developer console is now opened with the tilde/grave key ` instead
of the Enter key, so that the Enter key is free to click through
modals.
* In the "Open/Edit Drawing" window, a "Browse..." button is added to
the level and doodad sections, spawning a native File Open dialog to
pick a .level or .doodad outside the config root.
2021-06-11 05:31:30 +00:00
|
|
|
}
|