2020-11-20 04:08:38 +00:00
|
|
|
package balance
|
|
|
|
|
2023-02-18 20:45:36 +00:00
|
|
|
// Hard-coded feature flags.
|
|
|
|
const (
|
|
|
|
// Enable "v1.5" compression in the MapAccessor Chunker.
|
|
|
|
//
|
|
|
|
// The original MapAccessor encodes a chunk to json using syntax like
|
|
|
|
// {"x,y": index} mapping coordinates to palette swatches.
|
|
|
|
//
|
|
|
|
// With compression on, it is encoded to a byte stream of x,y,index
|
|
|
|
// triplets. The game can read both formats and will follow this flag
|
|
|
|
// on all saves. NOTE: this applies to when we still use JSON format.
|
|
|
|
// If BinaryChunkerEnabled, map accessors are always compressed as they
|
|
|
|
// are written to .bin files instead of .json.
|
|
|
|
CompressMapAccessor = true
|
|
|
|
|
|
|
|
// Enable "v2" binary storage of Chunk data in Zipfiles.
|
|
|
|
//
|
|
|
|
// This is a separate toggle to the CompressMapAccessor. Some possible
|
|
|
|
// variations of these flags includes:
|
|
|
|
//
|
|
|
|
// - CompressMapAccessor=true alone, will write the compressed bytes
|
|
|
|
// still wrapped in the JSON format as a Base64 encoded string.
|
|
|
|
// - With BinaryChunkerEnabled=true: all chunks are encoded to
|
|
|
|
// binary and put in the zip as .bin instead of as .json files.
|
|
|
|
// MapAccessor is always compressed in binary mode.
|
|
|
|
//
|
|
|
|
// If you set both flags to false, level zipfiles will use the classic
|
|
|
|
// json chunk format as before on save.
|
|
|
|
BinaryChunkerEnabled = true
|
2024-05-24 06:02:01 +00:00
|
|
|
|
|
|
|
// Enable "v3" Run-Length Encoding for level chunker.
|
|
|
|
//
|
|
|
|
// This only supports Zipfile levels and will use the ".bin" format
|
|
|
|
// enabled by the previous setting.
|
|
|
|
RLEBinaryChunkerEnabled = true
|
2023-02-18 20:45:36 +00:00
|
|
|
)
|
|
|
|
|
2020-11-20 04:08:38 +00:00
|
|
|
// Feature Flags to turn on/off experimental content.
|
|
|
|
var Feature = feature{
|
2021-09-12 04:18:22 +00:00
|
|
|
/////////
|
|
|
|
// Experimental features that are off by default
|
2022-03-26 20:55:06 +00:00
|
|
|
ViewportWindow: false, // Open new viewport into your level
|
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-12 04:18:22 +00:00
|
|
|
/////////
|
|
|
|
// Fully activated features
|
|
|
|
|
|
|
|
// Attach custom wallpaper img to levels
|
|
|
|
CustomWallpaper: true,
|
|
|
|
|
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
|
|
|
// Allow embedded doodads in levels.
|
|
|
|
EmbeddableDoodads: true,
|
2022-03-26 20:55:06 +00:00
|
|
|
|
|
|
|
// Enable the zoom in/out feature (kinda buggy still)
|
|
|
|
Zoom: true,
|
|
|
|
|
|
|
|
// Reassign an existing level's palette to a different builtin.
|
|
|
|
ChangePalette: true,
|
2022-04-10 19:39:27 +00:00
|
|
|
|
|
|
|
// LoadUnloadChunk feature to better optimize memory. Set it to false and the
|
|
|
|
// loadscreen will eager load all chunk bitmaps (stable, but uses a lot of
|
|
|
|
// memory), set true and the Canvas will load/unload bitmaps + free SDL textures
|
|
|
|
// for chunks falling outside the LoadingViewport (new, maybe unstable).
|
|
|
|
LoadUnloadChunk: true,
|
2020-11-20 04:08:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// FeaturesOn turns on all feature flags, from CLI --experimental option.
|
|
|
|
func FeaturesOn() {
|
2022-03-26 20:55:06 +00:00
|
|
|
Feature.ViewportWindow = true
|
2020-11-20 04:08:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type feature struct {
|
2021-09-12 04:18:22 +00:00
|
|
|
Zoom bool
|
|
|
|
CustomWallpaper bool
|
|
|
|
ChangePalette bool
|
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
|
|
|
EmbeddableDoodads bool
|
2022-03-26 20:55:06 +00:00
|
|
|
ViewportWindow bool
|
2022-04-10 19:39:27 +00:00
|
|
|
LoadUnloadChunk bool
|
2020-11-20 04:08:38 +00:00
|
|
|
}
|