From 416c9bd2fe6cc226fb054226c8a49516cd2f3503 Mon Sep 17 00:00:00 2001 From: TrainWrack <120750885+TrainWrack@users.noreply.github.com> Date: Mon, 19 Jan 2026 21:16:37 -0500 Subject: [PATCH 1/8] Sound checkbox --- TombEditor/Forms/FormSoundSource.Designer.cs | 236 +++++++++--------- TombEditor/Forms/FormSoundSource.cs | 5 + TombEditor/Forms/FormSoundSource.resx | 54 ++-- .../TombEngine/LevelCompilerTombEngine.cs | 3 + TombLib/TombLib/LevelData/IO/Prj2Loader.cs | 1 + TombLib/TombLib/LevelData/IO/Prj2Writer.cs | 1 + .../Instances/SoundSourceInstance.cs | 5 +- 7 files changed, 161 insertions(+), 144 deletions(-) diff --git a/TombEditor/Forms/FormSoundSource.Designer.cs b/TombEditor/Forms/FormSoundSource.Designer.cs index 8142630bbe..4530ae6760 100644 --- a/TombEditor/Forms/FormSoundSource.Designer.cs +++ b/TombEditor/Forms/FormSoundSource.Designer.cs @@ -28,151 +28,156 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.butOK = new DarkUI.Controls.DarkButton(); - this.butCancel = new DarkUI.Controls.DarkButton(); - this.optionPlaySoundFromWadGroupBox = new DarkUI.Controls.DarkGroupBox(); - this.butSearch = new DarkUI.Controls.DarkButton(); - this.tbSearch = new DarkUI.Controls.DarkTextBox(); - this.comboPlayMode = new DarkUI.Controls.DarkComboBox(); - this.darkLabel2 = new DarkUI.Controls.DarkLabel(); - this.butPlaySound = new DarkUI.Controls.DarkButton(); - this.lstSounds = new DarkUI.Controls.DarkListView(); - this.optionPlaySoundFromWadGroupBox.SuspendLayout(); - this.SuspendLayout(); + butOK = new DarkUI.Controls.DarkButton(); + butCancel = new DarkUI.Controls.DarkButton(); + optionPlaySoundFromWadGroupBox = new DarkUI.Controls.DarkGroupBox(); + cbSoundEnabled = new DarkUI.Controls.DarkCheckBox(); + butSearch = new DarkUI.Controls.DarkButton(); + tbSearch = new DarkUI.Controls.DarkTextBox(); + comboPlayMode = new DarkUI.Controls.DarkComboBox(); + darkLabel2 = new DarkUI.Controls.DarkLabel(); + butPlaySound = new DarkUI.Controls.DarkButton(); + lstSounds = new DarkUI.Controls.DarkListView(); + optionPlaySoundFromWadGroupBox.SuspendLayout(); + SuspendLayout(); // // butOK // - this.butOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.butOK.Location = new System.Drawing.Point(306, 535); - this.butOK.Name = "butOK"; - this.butOK.Size = new System.Drawing.Size(80, 23); - this.butOK.TabIndex = 0; - this.butOK.Text = "OK"; - this.butOK.Click += new System.EventHandler(this.butOK_Click); + butOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + butOK.Checked = false; + butOK.Location = new System.Drawing.Point(306, 535); + butOK.Name = "butOK"; + butOK.Size = new System.Drawing.Size(80, 23); + butOK.TabIndex = 0; + butOK.Text = "OK"; + butOK.Click += butOK_Click; // // butCancel // - this.butCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.butCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.butCancel.Location = new System.Drawing.Point(392, 535); - this.butCancel.Name = "butCancel"; - this.butCancel.Size = new System.Drawing.Size(80, 23); - this.butCancel.TabIndex = 1; - this.butCancel.Text = "Cancel"; - this.butCancel.Click += new System.EventHandler(this.butCancel_Click); + butCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + butCancel.Checked = false; + butCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + butCancel.Location = new System.Drawing.Point(392, 535); + butCancel.Name = "butCancel"; + butCancel.Size = new System.Drawing.Size(80, 23); + butCancel.TabIndex = 1; + butCancel.Text = "Cancel"; + butCancel.Click += butCancel_Click; // // optionPlaySoundFromWadGroupBox // - this.optionPlaySoundFromWadGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.optionPlaySoundFromWadGroupBox.Controls.Add(this.butSearch); - this.optionPlaySoundFromWadGroupBox.Controls.Add(this.tbSearch); - this.optionPlaySoundFromWadGroupBox.Controls.Add(this.comboPlayMode); - this.optionPlaySoundFromWadGroupBox.Controls.Add(this.darkLabel2); - this.optionPlaySoundFromWadGroupBox.Controls.Add(this.butPlaySound); - this.optionPlaySoundFromWadGroupBox.Controls.Add(this.lstSounds); - this.optionPlaySoundFromWadGroupBox.Location = new System.Drawing.Point(12, 12); - this.optionPlaySoundFromWadGroupBox.Name = "optionPlaySoundFromWadGroupBox"; - this.optionPlaySoundFromWadGroupBox.Size = new System.Drawing.Size(460, 517); - this.optionPlaySoundFromWadGroupBox.TabIndex = 66; - this.optionPlaySoundFromWadGroupBox.TabStop = false; - this.optionPlaySoundFromWadGroupBox.Text = "Sound to play"; + optionPlaySoundFromWadGroupBox.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + optionPlaySoundFromWadGroupBox.Controls.Add(butSearch); + optionPlaySoundFromWadGroupBox.Controls.Add(tbSearch); + optionPlaySoundFromWadGroupBox.Controls.Add(comboPlayMode); + optionPlaySoundFromWadGroupBox.Controls.Add(darkLabel2); + optionPlaySoundFromWadGroupBox.Controls.Add(butPlaySound); + optionPlaySoundFromWadGroupBox.Controls.Add(lstSounds); + optionPlaySoundFromWadGroupBox.Location = new System.Drawing.Point(12, 12); + optionPlaySoundFromWadGroupBox.Name = "optionPlaySoundFromWadGroupBox"; + optionPlaySoundFromWadGroupBox.Size = new System.Drawing.Size(460, 517); + optionPlaySoundFromWadGroupBox.TabIndex = 66; + optionPlaySoundFromWadGroupBox.TabStop = false; + optionPlaySoundFromWadGroupBox.Text = "Sound to play"; + // + // cbSoundEnabled + // + cbSoundEnabled.AutoSize = true; + cbSoundEnabled.Location = new System.Drawing.Point(12, 541); + cbSoundEnabled.Name = "cbSoundEnabled"; + cbSoundEnabled.Size = new System.Drawing.Size(68, 17); + cbSoundEnabled.TabIndex = 110; + cbSoundEnabled.Text = "Enabled"; // // butSearch // - this.butSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.butSearch.Image = global::TombEditor.Properties.Resources.general_search_16; - this.butSearch.Location = new System.Drawing.Point(428, 21); - this.butSearch.Name = "butSearch"; - this.butSearch.Selectable = false; - this.butSearch.Size = new System.Drawing.Size(24, 23); - this.butSearch.TabIndex = 109; - this.butSearch.Click += new System.EventHandler(this.butSearch_Click); + butSearch.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + butSearch.Checked = false; + butSearch.Image = Properties.Resources.general_search_16; + butSearch.Location = new System.Drawing.Point(428, 21); + butSearch.Name = "butSearch"; + butSearch.Selectable = false; + butSearch.Size = new System.Drawing.Size(24, 23); + butSearch.TabIndex = 109; + butSearch.Click += butSearch_Click; // // tbSearch // - this.tbSearch.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tbSearch.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.tbSearch.Location = new System.Drawing.Point(8, 21); - this.tbSearch.Name = "tbSearch"; - this.tbSearch.Size = new System.Drawing.Size(421, 23); - this.tbSearch.TabIndex = 0; - this.tbSearch.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tbSearch_KeyDown); + tbSearch.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + tbSearch.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + tbSearch.Location = new System.Drawing.Point(8, 21); + tbSearch.Name = "tbSearch"; + tbSearch.Size = new System.Drawing.Size(421, 23); + tbSearch.TabIndex = 0; + tbSearch.KeyDown += tbSearch_KeyDown; // // comboPlayMode // - this.comboPlayMode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.comboPlayMode.FormattingEnabled = true; - this.comboPlayMode.Items.AddRange(new object[] { - "Always", - "Only when flipmaps are off", - "Only when flipmaps are on", - "Auto-decide based on room type"}); - this.comboPlayMode.Location = new System.Drawing.Point(77, 486); - this.comboPlayMode.Name = "comboPlayMode"; - this.comboPlayMode.Size = new System.Drawing.Size(277, 23); - this.comboPlayMode.TabIndex = 2; + comboPlayMode.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + comboPlayMode.FormattingEnabled = true; + comboPlayMode.Items.AddRange(new object[] { "Always", "Only when flipmaps are off", "Only when flipmaps are on", "Auto-decide based on room type" }); + comboPlayMode.Location = new System.Drawing.Point(77, 486); + comboPlayMode.Name = "comboPlayMode"; + comboPlayMode.Size = new System.Drawing.Size(277, 23); + comboPlayMode.TabIndex = 2; // // darkLabel2 // - this.darkLabel2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.darkLabel2.AutoSize = true; - this.darkLabel2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.darkLabel2.Location = new System.Drawing.Point(9, 489); - this.darkLabel2.Name = "darkLabel2"; - this.darkLabel2.Size = new System.Drawing.Size(62, 13); - this.darkLabel2.TabIndex = 63; - this.darkLabel2.Text = "Play mode:"; + darkLabel2.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + darkLabel2.AutoSize = true; + darkLabel2.ForeColor = System.Drawing.Color.FromArgb(220, 220, 220); + darkLabel2.Location = new System.Drawing.Point(9, 489); + darkLabel2.Name = "darkLabel2"; + darkLabel2.Size = new System.Drawing.Size(62, 13); + darkLabel2.TabIndex = 63; + darkLabel2.Text = "Play mode:"; // // butPlaySound // - this.butPlaySound.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.butPlaySound.Image = global::TombEditor.Properties.Resources.actions_play_16; - this.butPlaySound.Location = new System.Drawing.Point(360, 486); - this.butPlaySound.Name = "butPlaySound"; - this.butPlaySound.Size = new System.Drawing.Size(92, 23); - this.butPlaySound.TabIndex = 3; - this.butPlaySound.Text = "Play sound"; - this.butPlaySound.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; - this.butPlaySound.Click += new System.EventHandler(this.butPlay_Click); + butPlaySound.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + butPlaySound.Checked = false; + butPlaySound.Image = Properties.Resources.actions_play_16; + butPlaySound.Location = new System.Drawing.Point(360, 486); + butPlaySound.Name = "butPlaySound"; + butPlaySound.Size = new System.Drawing.Size(92, 23); + butPlaySound.TabIndex = 3; + butPlaySound.Text = "Play sound"; + butPlaySound.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; + butPlaySound.Click += butPlay_Click; // // lstSounds // - this.lstSounds.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lstSounds.Location = new System.Drawing.Point(8, 50); - this.lstSounds.Name = "lstSounds"; - this.lstSounds.Size = new System.Drawing.Size(444, 430); - this.lstSounds.TabIndex = 1; - this.lstSounds.Text = "darkListView1"; - this.lstSounds.Click += new System.EventHandler(this.lstSounds_Click); - this.lstSounds.DoubleClick += new System.EventHandler(this.lstSounds_DoubleClick); + lstSounds.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + lstSounds.Location = new System.Drawing.Point(8, 50); + lstSounds.Name = "lstSounds"; + lstSounds.Size = new System.Drawing.Size(444, 430); + lstSounds.TabIndex = 1; + lstSounds.Text = "darkListView1"; + lstSounds.Click += lstSounds_Click; + lstSounds.DoubleClick += lstSounds_DoubleClick; // // FormSoundSource // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.butCancel; - this.ClientSize = new System.Drawing.Size(484, 570); - this.Controls.Add(this.butOK); - this.Controls.Add(this.butCancel); - this.Controls.Add(this.optionPlaySoundFromWadGroupBox); - this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(500, 520); - this.Name = "FormSoundSource"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Sound source"; - this.optionPlaySoundFromWadGroupBox.ResumeLayout(false); - this.optionPlaySoundFromWadGroupBox.PerformLayout(); - this.ResumeLayout(false); - + AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + CancelButton = butCancel; + ClientSize = new System.Drawing.Size(484, 570); + Controls.Add(cbSoundEnabled); + Controls.Add(butOK); + Controls.Add(butCancel); + Controls.Add(optionPlaySoundFromWadGroupBox); + MinimizeBox = false; + MinimumSize = new System.Drawing.Size(500, 520); + Name = "FormSoundSource"; + ShowIcon = false; + ShowInTaskbar = false; + SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + Text = "Sound source"; + optionPlaySoundFromWadGroupBox.ResumeLayout(false); + optionPlaySoundFromWadGroupBox.PerformLayout(); + ResumeLayout(false); + PerformLayout(); } #endregion @@ -185,5 +190,6 @@ private void InitializeComponent() private DarkUI.Controls.DarkLabel darkLabel2; private DarkUI.Controls.DarkButton butSearch; private DarkUI.Controls.DarkTextBox tbSearch; + private DarkUI.Controls.DarkCheckBox cbSoundEnabled; } } \ No newline at end of file diff --git a/TombEditor/Forms/FormSoundSource.cs b/TombEditor/Forms/FormSoundSource.cs index 0256e5a1cf..96b12e7a5a 100644 --- a/TombEditor/Forms/FormSoundSource.cs +++ b/TombEditor/Forms/FormSoundSource.cs @@ -33,6 +33,10 @@ public FormSoundSource(SoundSourceInstance soundSource) lstSounds.Items.Add(new DarkUI.Controls.DarkListItem(sound.Id.ToString().PadLeft(4, '0') + ": " + sound.Name) { Tag = sound }); SelectSound(_soundSource.SoundId); + + bool isTEN = _editor.Level.Settings.GameVersion is TRVersion.Game.TombEngine; + cbSoundEnabled.Enabled = isTEN; + cbSoundEnabled.Visible = isTEN; } private void SelectSound(int id) @@ -70,6 +74,7 @@ private void butOK_Click(object sender, EventArgs e) { _soundSource.SoundId = _soundId; _soundSource.PlayMode = (SoundSourcePlayMode)comboPlayMode.SelectedIndex; + _soundSource.Enabled = cbSoundEnabled.Checked; DialogResult = DialogResult.OK; WadSoundPlayer.StopSample(); diff --git a/TombEditor/Forms/FormSoundSource.resx b/TombEditor/Forms/FormSoundSource.resx index 1af7de150c..8b2ff64a11 100644 --- a/TombEditor/Forms/FormSoundSource.resx +++ b/TombEditor/Forms/FormSoundSource.resx @@ -1,17 +1,17 @@  - diff --git a/TombLib/TombLib/LevelData/Compilers/TombEngine/LevelCompilerTombEngine.cs b/TombLib/TombLib/LevelData/Compilers/TombEngine/LevelCompilerTombEngine.cs index 3da0cda49d..7da404889e 100644 --- a/TombLib/TombLib/LevelData/Compilers/TombEngine/LevelCompilerTombEngine.cs +++ b/TombLib/TombLib/LevelData/Compilers/TombEngine/LevelCompilerTombEngine.cs @@ -204,6 +204,9 @@ private void PrepareSoundSources() flags |= 0x2000; break; } + + if (instance.Enabled) + flags |= 0x1000; Vector3 position = instance.Room.WorldPos + instance.Position; _soundSources.Add(new TombEngineSoundSource diff --git a/TombLib/TombLib/LevelData/IO/Prj2Loader.cs b/TombLib/TombLib/LevelData/IO/Prj2Loader.cs index d861e9374b..108b95e59b 100644 --- a/TombLib/TombLib/LevelData/IO/Prj2Loader.cs +++ b/TombLib/TombLib/LevelData/IO/Prj2Loader.cs @@ -1550,6 +1550,7 @@ private static bool LoadObjects(ChunkReader chunkIO, ChunkId idOuter, LevelSetti instance.Position = chunkIO.Raw.ReadVector3(); instance.SoundId = chunkIO.Raw.ReadInt32(); instance.PlayMode = (SoundSourcePlayMode)chunkIO.Raw.ReadInt32(); + instance.Enabled = chunkIO.Raw.ReadBoolean(); instance.LuaName = chunkIO.Raw.ReadStringUTF8(); addObject(instance); newObjects.TryAdd(objectID, instance); diff --git a/TombLib/TombLib/LevelData/IO/Prj2Writer.cs b/TombLib/TombLib/LevelData/IO/Prj2Writer.cs index 4be3054842..cf2ab4e546 100644 --- a/TombLib/TombLib/LevelData/IO/Prj2Writer.cs +++ b/TombLib/TombLib/LevelData/IO/Prj2Writer.cs @@ -736,6 +736,7 @@ private static void WriteObjects(ChunkWriter chunkIO, IEnumerable SoundId == -1; public WadSoundInfo GetSoundInfo(Level level) From 79d4a060f81006fc674cfee637df3e789d4bb78d Mon Sep 17 00:00:00 2001 From: TrainWrack <120750885+TrainWrack@users.noreply.github.com> Date: Fri, 23 Jan 2026 20:11:55 -0500 Subject: [PATCH 2/8] Revert "Sound checkbox" This reverts commit cc5d70168423c9415b22b358f97ef7933e3fa811. --- TombEditor/Forms/FormSoundSource.Designer.cs | 236 +++++++++--------- TombEditor/Forms/FormSoundSource.cs | 5 - TombEditor/Forms/FormSoundSource.resx | 54 ++-- .../TombEngine/LevelCompilerTombEngine.cs | 3 - TombLib/TombLib/LevelData/IO/Prj2Loader.cs | 1 - TombLib/TombLib/LevelData/IO/Prj2Writer.cs | 1 - .../Instances/SoundSourceInstance.cs | 5 +- 7 files changed, 144 insertions(+), 161 deletions(-) diff --git a/TombEditor/Forms/FormSoundSource.Designer.cs b/TombEditor/Forms/FormSoundSource.Designer.cs index 4530ae6760..8142630bbe 100644 --- a/TombEditor/Forms/FormSoundSource.Designer.cs +++ b/TombEditor/Forms/FormSoundSource.Designer.cs @@ -28,156 +28,151 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - butOK = new DarkUI.Controls.DarkButton(); - butCancel = new DarkUI.Controls.DarkButton(); - optionPlaySoundFromWadGroupBox = new DarkUI.Controls.DarkGroupBox(); - cbSoundEnabled = new DarkUI.Controls.DarkCheckBox(); - butSearch = new DarkUI.Controls.DarkButton(); - tbSearch = new DarkUI.Controls.DarkTextBox(); - comboPlayMode = new DarkUI.Controls.DarkComboBox(); - darkLabel2 = new DarkUI.Controls.DarkLabel(); - butPlaySound = new DarkUI.Controls.DarkButton(); - lstSounds = new DarkUI.Controls.DarkListView(); - optionPlaySoundFromWadGroupBox.SuspendLayout(); - SuspendLayout(); + this.butOK = new DarkUI.Controls.DarkButton(); + this.butCancel = new DarkUI.Controls.DarkButton(); + this.optionPlaySoundFromWadGroupBox = new DarkUI.Controls.DarkGroupBox(); + this.butSearch = new DarkUI.Controls.DarkButton(); + this.tbSearch = new DarkUI.Controls.DarkTextBox(); + this.comboPlayMode = new DarkUI.Controls.DarkComboBox(); + this.darkLabel2 = new DarkUI.Controls.DarkLabel(); + this.butPlaySound = new DarkUI.Controls.DarkButton(); + this.lstSounds = new DarkUI.Controls.DarkListView(); + this.optionPlaySoundFromWadGroupBox.SuspendLayout(); + this.SuspendLayout(); // // butOK // - butOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; - butOK.Checked = false; - butOK.Location = new System.Drawing.Point(306, 535); - butOK.Name = "butOK"; - butOK.Size = new System.Drawing.Size(80, 23); - butOK.TabIndex = 0; - butOK.Text = "OK"; - butOK.Click += butOK_Click; + this.butOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.butOK.Location = new System.Drawing.Point(306, 535); + this.butOK.Name = "butOK"; + this.butOK.Size = new System.Drawing.Size(80, 23); + this.butOK.TabIndex = 0; + this.butOK.Text = "OK"; + this.butOK.Click += new System.EventHandler(this.butOK_Click); // // butCancel // - butCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; - butCancel.Checked = false; - butCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - butCancel.Location = new System.Drawing.Point(392, 535); - butCancel.Name = "butCancel"; - butCancel.Size = new System.Drawing.Size(80, 23); - butCancel.TabIndex = 1; - butCancel.Text = "Cancel"; - butCancel.Click += butCancel_Click; + this.butCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.butCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.butCancel.Location = new System.Drawing.Point(392, 535); + this.butCancel.Name = "butCancel"; + this.butCancel.Size = new System.Drawing.Size(80, 23); + this.butCancel.TabIndex = 1; + this.butCancel.Text = "Cancel"; + this.butCancel.Click += new System.EventHandler(this.butCancel_Click); // // optionPlaySoundFromWadGroupBox // - optionPlaySoundFromWadGroupBox.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; - optionPlaySoundFromWadGroupBox.Controls.Add(butSearch); - optionPlaySoundFromWadGroupBox.Controls.Add(tbSearch); - optionPlaySoundFromWadGroupBox.Controls.Add(comboPlayMode); - optionPlaySoundFromWadGroupBox.Controls.Add(darkLabel2); - optionPlaySoundFromWadGroupBox.Controls.Add(butPlaySound); - optionPlaySoundFromWadGroupBox.Controls.Add(lstSounds); - optionPlaySoundFromWadGroupBox.Location = new System.Drawing.Point(12, 12); - optionPlaySoundFromWadGroupBox.Name = "optionPlaySoundFromWadGroupBox"; - optionPlaySoundFromWadGroupBox.Size = new System.Drawing.Size(460, 517); - optionPlaySoundFromWadGroupBox.TabIndex = 66; - optionPlaySoundFromWadGroupBox.TabStop = false; - optionPlaySoundFromWadGroupBox.Text = "Sound to play"; - // - // cbSoundEnabled - // - cbSoundEnabled.AutoSize = true; - cbSoundEnabled.Location = new System.Drawing.Point(12, 541); - cbSoundEnabled.Name = "cbSoundEnabled"; - cbSoundEnabled.Size = new System.Drawing.Size(68, 17); - cbSoundEnabled.TabIndex = 110; - cbSoundEnabled.Text = "Enabled"; + this.optionPlaySoundFromWadGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.optionPlaySoundFromWadGroupBox.Controls.Add(this.butSearch); + this.optionPlaySoundFromWadGroupBox.Controls.Add(this.tbSearch); + this.optionPlaySoundFromWadGroupBox.Controls.Add(this.comboPlayMode); + this.optionPlaySoundFromWadGroupBox.Controls.Add(this.darkLabel2); + this.optionPlaySoundFromWadGroupBox.Controls.Add(this.butPlaySound); + this.optionPlaySoundFromWadGroupBox.Controls.Add(this.lstSounds); + this.optionPlaySoundFromWadGroupBox.Location = new System.Drawing.Point(12, 12); + this.optionPlaySoundFromWadGroupBox.Name = "optionPlaySoundFromWadGroupBox"; + this.optionPlaySoundFromWadGroupBox.Size = new System.Drawing.Size(460, 517); + this.optionPlaySoundFromWadGroupBox.TabIndex = 66; + this.optionPlaySoundFromWadGroupBox.TabStop = false; + this.optionPlaySoundFromWadGroupBox.Text = "Sound to play"; // // butSearch // - butSearch.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; - butSearch.Checked = false; - butSearch.Image = Properties.Resources.general_search_16; - butSearch.Location = new System.Drawing.Point(428, 21); - butSearch.Name = "butSearch"; - butSearch.Selectable = false; - butSearch.Size = new System.Drawing.Size(24, 23); - butSearch.TabIndex = 109; - butSearch.Click += butSearch_Click; + this.butSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.butSearch.Image = global::TombEditor.Properties.Resources.general_search_16; + this.butSearch.Location = new System.Drawing.Point(428, 21); + this.butSearch.Name = "butSearch"; + this.butSearch.Selectable = false; + this.butSearch.Size = new System.Drawing.Size(24, 23); + this.butSearch.TabIndex = 109; + this.butSearch.Click += new System.EventHandler(this.butSearch_Click); // // tbSearch // - tbSearch.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; - tbSearch.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - tbSearch.Location = new System.Drawing.Point(8, 21); - tbSearch.Name = "tbSearch"; - tbSearch.Size = new System.Drawing.Size(421, 23); - tbSearch.TabIndex = 0; - tbSearch.KeyDown += tbSearch_KeyDown; + this.tbSearch.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbSearch.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.tbSearch.Location = new System.Drawing.Point(8, 21); + this.tbSearch.Name = "tbSearch"; + this.tbSearch.Size = new System.Drawing.Size(421, 23); + this.tbSearch.TabIndex = 0; + this.tbSearch.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tbSearch_KeyDown); // // comboPlayMode // - comboPlayMode.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; - comboPlayMode.FormattingEnabled = true; - comboPlayMode.Items.AddRange(new object[] { "Always", "Only when flipmaps are off", "Only when flipmaps are on", "Auto-decide based on room type" }); - comboPlayMode.Location = new System.Drawing.Point(77, 486); - comboPlayMode.Name = "comboPlayMode"; - comboPlayMode.Size = new System.Drawing.Size(277, 23); - comboPlayMode.TabIndex = 2; + this.comboPlayMode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboPlayMode.FormattingEnabled = true; + this.comboPlayMode.Items.AddRange(new object[] { + "Always", + "Only when flipmaps are off", + "Only when flipmaps are on", + "Auto-decide based on room type"}); + this.comboPlayMode.Location = new System.Drawing.Point(77, 486); + this.comboPlayMode.Name = "comboPlayMode"; + this.comboPlayMode.Size = new System.Drawing.Size(277, 23); + this.comboPlayMode.TabIndex = 2; // // darkLabel2 // - darkLabel2.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; - darkLabel2.AutoSize = true; - darkLabel2.ForeColor = System.Drawing.Color.FromArgb(220, 220, 220); - darkLabel2.Location = new System.Drawing.Point(9, 489); - darkLabel2.Name = "darkLabel2"; - darkLabel2.Size = new System.Drawing.Size(62, 13); - darkLabel2.TabIndex = 63; - darkLabel2.Text = "Play mode:"; + this.darkLabel2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.darkLabel2.AutoSize = true; + this.darkLabel2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.darkLabel2.Location = new System.Drawing.Point(9, 489); + this.darkLabel2.Name = "darkLabel2"; + this.darkLabel2.Size = new System.Drawing.Size(62, 13); + this.darkLabel2.TabIndex = 63; + this.darkLabel2.Text = "Play mode:"; // // butPlaySound // - butPlaySound.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; - butPlaySound.Checked = false; - butPlaySound.Image = Properties.Resources.actions_play_16; - butPlaySound.Location = new System.Drawing.Point(360, 486); - butPlaySound.Name = "butPlaySound"; - butPlaySound.Size = new System.Drawing.Size(92, 23); - butPlaySound.TabIndex = 3; - butPlaySound.Text = "Play sound"; - butPlaySound.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; - butPlaySound.Click += butPlay_Click; + this.butPlaySound.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.butPlaySound.Image = global::TombEditor.Properties.Resources.actions_play_16; + this.butPlaySound.Location = new System.Drawing.Point(360, 486); + this.butPlaySound.Name = "butPlaySound"; + this.butPlaySound.Size = new System.Drawing.Size(92, 23); + this.butPlaySound.TabIndex = 3; + this.butPlaySound.Text = "Play sound"; + this.butPlaySound.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; + this.butPlaySound.Click += new System.EventHandler(this.butPlay_Click); // // lstSounds // - lstSounds.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; - lstSounds.Location = new System.Drawing.Point(8, 50); - lstSounds.Name = "lstSounds"; - lstSounds.Size = new System.Drawing.Size(444, 430); - lstSounds.TabIndex = 1; - lstSounds.Text = "darkListView1"; - lstSounds.Click += lstSounds_Click; - lstSounds.DoubleClick += lstSounds_DoubleClick; + this.lstSounds.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lstSounds.Location = new System.Drawing.Point(8, 50); + this.lstSounds.Name = "lstSounds"; + this.lstSounds.Size = new System.Drawing.Size(444, 430); + this.lstSounds.TabIndex = 1; + this.lstSounds.Text = "darkListView1"; + this.lstSounds.Click += new System.EventHandler(this.lstSounds_Click); + this.lstSounds.DoubleClick += new System.EventHandler(this.lstSounds_DoubleClick); // // FormSoundSource // - AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - CancelButton = butCancel; - ClientSize = new System.Drawing.Size(484, 570); - Controls.Add(cbSoundEnabled); - Controls.Add(butOK); - Controls.Add(butCancel); - Controls.Add(optionPlaySoundFromWadGroupBox); - MinimizeBox = false; - MinimumSize = new System.Drawing.Size(500, 520); - Name = "FormSoundSource"; - ShowIcon = false; - ShowInTaskbar = false; - SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - Text = "Sound source"; - optionPlaySoundFromWadGroupBox.ResumeLayout(false); - optionPlaySoundFromWadGroupBox.PerformLayout(); - ResumeLayout(false); - PerformLayout(); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.butCancel; + this.ClientSize = new System.Drawing.Size(484, 570); + this.Controls.Add(this.butOK); + this.Controls.Add(this.butCancel); + this.Controls.Add(this.optionPlaySoundFromWadGroupBox); + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(500, 520); + this.Name = "FormSoundSource"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Sound source"; + this.optionPlaySoundFromWadGroupBox.ResumeLayout(false); + this.optionPlaySoundFromWadGroupBox.PerformLayout(); + this.ResumeLayout(false); + } #endregion @@ -190,6 +185,5 @@ private void InitializeComponent() private DarkUI.Controls.DarkLabel darkLabel2; private DarkUI.Controls.DarkButton butSearch; private DarkUI.Controls.DarkTextBox tbSearch; - private DarkUI.Controls.DarkCheckBox cbSoundEnabled; } } \ No newline at end of file diff --git a/TombEditor/Forms/FormSoundSource.cs b/TombEditor/Forms/FormSoundSource.cs index 96b12e7a5a..0256e5a1cf 100644 --- a/TombEditor/Forms/FormSoundSource.cs +++ b/TombEditor/Forms/FormSoundSource.cs @@ -33,10 +33,6 @@ public FormSoundSource(SoundSourceInstance soundSource) lstSounds.Items.Add(new DarkUI.Controls.DarkListItem(sound.Id.ToString().PadLeft(4, '0') + ": " + sound.Name) { Tag = sound }); SelectSound(_soundSource.SoundId); - - bool isTEN = _editor.Level.Settings.GameVersion is TRVersion.Game.TombEngine; - cbSoundEnabled.Enabled = isTEN; - cbSoundEnabled.Visible = isTEN; } private void SelectSound(int id) @@ -74,7 +70,6 @@ private void butOK_Click(object sender, EventArgs e) { _soundSource.SoundId = _soundId; _soundSource.PlayMode = (SoundSourcePlayMode)comboPlayMode.SelectedIndex; - _soundSource.Enabled = cbSoundEnabled.Checked; DialogResult = DialogResult.OK; WadSoundPlayer.StopSample(); diff --git a/TombEditor/Forms/FormSoundSource.resx b/TombEditor/Forms/FormSoundSource.resx index 8b2ff64a11..1af7de150c 100644 --- a/TombEditor/Forms/FormSoundSource.resx +++ b/TombEditor/Forms/FormSoundSource.resx @@ -1,17 +1,17 @@  - diff --git a/TombLib/TombLib/LevelData/Compilers/TombEngine/LevelCompilerTombEngine.cs b/TombLib/TombLib/LevelData/Compilers/TombEngine/LevelCompilerTombEngine.cs index 7da404889e..3da0cda49d 100644 --- a/TombLib/TombLib/LevelData/Compilers/TombEngine/LevelCompilerTombEngine.cs +++ b/TombLib/TombLib/LevelData/Compilers/TombEngine/LevelCompilerTombEngine.cs @@ -204,9 +204,6 @@ private void PrepareSoundSources() flags |= 0x2000; break; } - - if (instance.Enabled) - flags |= 0x1000; Vector3 position = instance.Room.WorldPos + instance.Position; _soundSources.Add(new TombEngineSoundSource diff --git a/TombLib/TombLib/LevelData/IO/Prj2Loader.cs b/TombLib/TombLib/LevelData/IO/Prj2Loader.cs index 108b95e59b..d861e9374b 100644 --- a/TombLib/TombLib/LevelData/IO/Prj2Loader.cs +++ b/TombLib/TombLib/LevelData/IO/Prj2Loader.cs @@ -1550,7 +1550,6 @@ private static bool LoadObjects(ChunkReader chunkIO, ChunkId idOuter, LevelSetti instance.Position = chunkIO.Raw.ReadVector3(); instance.SoundId = chunkIO.Raw.ReadInt32(); instance.PlayMode = (SoundSourcePlayMode)chunkIO.Raw.ReadInt32(); - instance.Enabled = chunkIO.Raw.ReadBoolean(); instance.LuaName = chunkIO.Raw.ReadStringUTF8(); addObject(instance); newObjects.TryAdd(objectID, instance); diff --git a/TombLib/TombLib/LevelData/IO/Prj2Writer.cs b/TombLib/TombLib/LevelData/IO/Prj2Writer.cs index cf2ab4e546..4be3054842 100644 --- a/TombLib/TombLib/LevelData/IO/Prj2Writer.cs +++ b/TombLib/TombLib/LevelData/IO/Prj2Writer.cs @@ -736,7 +736,6 @@ private static void WriteObjects(ChunkWriter chunkIO, IEnumerable SoundId == -1; public WadSoundInfo GetSoundInfo(Level level) From cbef7f2abfd2fbb0ff28598aef4f299c12db5fa5 Mon Sep 17 00:00:00 2001 From: TrainWrack <120750885+TrainWrack@users.noreply.github.com> Date: Sat, 11 Apr 2026 17:28:05 -0400 Subject: [PATCH 3/8] Add statistics nodes Add slot for sprites --- .../Engines/TombEngine/SpriteSequences.xml | 1 + .../Catalogs/TEN Node Catalogs/Statistics.lua | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua diff --git a/TombLib/TombLib/Catalogs/Engines/TombEngine/SpriteSequences.xml b/TombLib/TombLib/Catalogs/Engines/TombEngine/SpriteSequences.xml index b694d11201..8ce502789e 100644 --- a/TombLib/TombLib/Catalogs/Engines/TombEngine/SpriteSequences.xml +++ b/TombLib/TombLib/Catalogs/Engines/TombEngine/SpriteSequences.xml @@ -32,4 +32,5 @@ + \ No newline at end of file diff --git a/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua b/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua new file mode 100644 index 0000000000..339da3f43c --- /dev/null +++ b/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua @@ -0,0 +1,43 @@ +local Statistics = require("Engine.RingInventory.Statistics") +local count = 0 + +-- !Name "Shows end of level statistics" +-- !Section "User interface" +-- !Description "Show end of level statistics." +-- !Arguments "NewLine, Numerical, 20, [ 0 | 256 ], Next level" +-- !Arguments "80, SoundTracks, Name of the audiotrack to play" +LevelFuncs.Engine.Node.ShowStatistics = function(level, track) + + if count == 0 then + Statistics.SetType(false) + TEN.Sound.PlayAudioTrack(track) + Statistics.SetEndStatistics(true) + end + + count = count + 1 + if count == 3 then + count = 0 + TEN.Flow.EndLevel(level) + end + +end + +-- !Name "Shows end of game statistics" +-- !Section "User interface" +-- !Description "Show end of game statistics." +-- !Arguments "NewLine, 100, SoundTracks, Name of the audiotrack to play" +LevelFuncs.Engine.Node.ShowEndGameStatistics = function(track) + + if count == 0 then + Statistics.SetType(true) + TEN.Sound.PlayAudioTrack(track) + Statistics.SetEndStatistics(true) + end + + count = count + 1 + if count == 3 then + count = 0 + TEN.Flow.EndLevel(999) + end + +end \ No newline at end of file From c434c40ba8a22e05278a8d876ef6c827ca1dd880 Mon Sep 17 00:00:00 2001 From: TrainWrack <120750885+TrainWrack@users.noreply.github.com> Date: Sat, 11 Apr 2026 17:41:00 -0400 Subject: [PATCH 4/8] Update Statistics.lua --- TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua b/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua index 339da3f43c..c738e15274 100644 --- a/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua +++ b/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua @@ -6,7 +6,7 @@ local count = 0 -- !Description "Show end of level statistics." -- !Arguments "NewLine, Numerical, 20, [ 0 | 256 ], Next level" -- !Arguments "80, SoundTracks, Name of the audiotrack to play" -LevelFuncs.Engine.Node.ShowStatistics = function(level, track) +LevelFuncs.Engine.Node.ShowEndLevelStatistics = function(level, track) if count == 0 then Statistics.SetType(false) @@ -40,4 +40,4 @@ LevelFuncs.Engine.Node.ShowEndGameStatistics = function(track) TEN.Flow.EndLevel(999) end -end \ No newline at end of file +end From 265be9c587e76bdff45a4b926010be40ae9fbd17 Mon Sep 17 00:00:00 2001 From: TrainWrack <120750885+TrainWrack@users.noreply.github.com> Date: Fri, 24 Apr 2026 14:36:48 -0400 Subject: [PATCH 5/8] Update Nodes --- .../Catalogs/TEN Node Catalogs/Statistics.lua | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua b/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua index c738e15274..37effa0893 100644 --- a/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua +++ b/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua @@ -11,13 +11,7 @@ LevelFuncs.Engine.Node.ShowEndLevelStatistics = function(level, track) if count == 0 then Statistics.SetType(false) TEN.Sound.PlayAudioTrack(track) - Statistics.SetEndStatistics(true) - end - - count = count + 1 - if count == 3 then - count = 0 - TEN.Flow.EndLevel(level) + Statistics.SetEndStatistics(true, level) end end @@ -31,13 +25,7 @@ LevelFuncs.Engine.Node.ShowEndGameStatistics = function(track) if count == 0 then Statistics.SetType(true) TEN.Sound.PlayAudioTrack(track) - Statistics.SetEndStatistics(true) + Statistics.SetEndStatistics(true, 999) end - count = count + 1 - if count == 3 then - count = 0 - TEN.Flow.EndLevel(999) - end - -end +end \ No newline at end of file From 5a1d8b13ec2edc0b63865dde65cc27642684d1c3 Mon Sep 17 00:00:00 2001 From: TrainWrack <120750885+TrainWrack@users.noreply.github.com> Date: Fri, 24 Apr 2026 14:37:47 -0400 Subject: [PATCH 6/8] Fix Nodes --- .../Catalogs/TEN Node Catalogs/Statistics.lua | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua b/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua index 37effa0893..ad9fa307b3 100644 --- a/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua +++ b/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua @@ -1,5 +1,4 @@ local Statistics = require("Engine.RingInventory.Statistics") -local count = 0 -- !Name "Shows end of level statistics" -- !Section "User interface" @@ -7,13 +6,9 @@ local count = 0 -- !Arguments "NewLine, Numerical, 20, [ 0 | 256 ], Next level" -- !Arguments "80, SoundTracks, Name of the audiotrack to play" LevelFuncs.Engine.Node.ShowEndLevelStatistics = function(level, track) - - if count == 0 then - Statistics.SetType(false) - TEN.Sound.PlayAudioTrack(track) - Statistics.SetEndStatistics(true, level) - end - + Statistics.SetType(false) + TEN.Sound.PlayAudioTrack(track) + Statistics.SetEndStatistics(true, level) end -- !Name "Shows end of game statistics" @@ -21,11 +16,9 @@ end -- !Description "Show end of game statistics." -- !Arguments "NewLine, 100, SoundTracks, Name of the audiotrack to play" LevelFuncs.Engine.Node.ShowEndGameStatistics = function(track) - - if count == 0 then - Statistics.SetType(true) - TEN.Sound.PlayAudioTrack(track) - Statistics.SetEndStatistics(true, 999) - end + + Statistics.SetType(true) + TEN.Sound.PlayAudioTrack(track) + Statistics.SetEndStatistics(true, 999) end \ No newline at end of file From d516a115cc43dc20e634f6764938151b7fb1b3ec Mon Sep 17 00:00:00 2001 From: TrainWrack <120750885+TrainWrack@users.noreply.github.com> Date: Fri, 24 Apr 2026 14:49:17 -0400 Subject: [PATCH 7/8] Aligned with EndLevel node --- TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua b/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua index ad9fa307b3..34e94ffd90 100644 --- a/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua +++ b/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua @@ -3,7 +3,7 @@ local Statistics = require("Engine.RingInventory.Statistics") -- !Name "Shows end of level statistics" -- !Section "User interface" -- !Description "Show end of level statistics." --- !Arguments "NewLine, Numerical, 20, [ 0 | 256 ], Next level" +-- !Arguments "NewLine, Numerical, 20, [ 0 | 99 ], Next level" -- !Arguments "80, SoundTracks, Name of the audiotrack to play" LevelFuncs.Engine.Node.ShowEndLevelStatistics = function(level, track) Statistics.SetType(false) From 5130d4a7d0f3ede19a2d21227c3f6cc7da0ac509 Mon Sep 17 00:00:00 2001 From: TrainWrack <120750885+TrainWrack@users.noreply.github.com> Date: Fri, 24 Apr 2026 14:50:19 -0400 Subject: [PATCH 8/8] Update Statistics.lua --- TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua b/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua index 34e94ffd90..623ed90f50 100644 --- a/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua +++ b/TombLib/TombLib/Catalogs/TEN Node Catalogs/Statistics.lua @@ -16,9 +16,7 @@ end -- !Description "Show end of game statistics." -- !Arguments "NewLine, 100, SoundTracks, Name of the audiotrack to play" LevelFuncs.Engine.Node.ShowEndGameStatistics = function(track) - Statistics.SetType(true) TEN.Sound.PlayAudioTrack(track) Statistics.SetEndStatistics(true, 999) - -end \ No newline at end of file +end