mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-28 23:57:13 +09:00
Send every value, register protected entities, fix the pattern offset
- The instance sends every value of a feature, defaults included, so update_config is one loop which sets each field and compares. The stored table is the last set of values, and _apply is gone. - values_equal compares table sizes before the contents. - Protected entities are registered with register_on_object_destroyed and forgotten in on_object_destroyed, which covers every way an entity can go. The four removal handlers and the validity checks are gone. Entities destroyed while the feature is disabled are swept when it is enabled again. Saves from before the registrations table get it through the Storage on_init callback. - Spawn area applied the water offset twice and the pattern offset never. The pattern tiles now move with the entities above them. - pruneFeatureValues reads a validation result instead of catching an error, and FeaturesPage hands its pending state and unsaved bar to helpers. - Shorter comments throughout. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
f90b8fcee1
commit
2959d7476b
11 files changed
+300
-350
No files matched your search
@@ -16,12 +16,7 @@ export class SeedRequest {
|
||||
|
||||
const FeatureValueSchema = Type.Union([Type.Boolean(), Type.Number(), Type.String(), Type.Array(Type.String()), Type.Null()]);
|
||||
|
||||
/**
|
||||
* The config of one scenario feature, see features.ts.
|
||||
*
|
||||
* Only values which differ from the default are stored, so a changed default
|
||||
* applies to every cluster which did not set that value.
|
||||
*/
|
||||
/** The config of one feature, see features.ts. Only values which differ from the default are stored. */
|
||||
export class FeatureRecord {
|
||||
constructor(
|
||||
/** Name of the feature in features.ts */
|
||||
@@ -105,7 +100,7 @@ export class FeatureListRequest {
|
||||
static Response = lib.jsonArray(FeatureRecord);
|
||||
}
|
||||
|
||||
/** Enable or disable a feature and replace its values, values left out go back to their default. */
|
||||
/** Replace the config of a feature, values left out go back to their default. */
|
||||
export class FeatureUpdateRequest {
|
||||
declare ["constructor"]: typeof FeatureUpdateRequest;
|
||||
static plugin = "exp_scenario" as const;
|
||||
|
||||
Reference in new issue
Block a user