summaryrefslogtreecommitdiffstats
path: root/tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.cpp
diff options
context:
space:
mode:
authorSvxy <aidan61605@gmail.com>2023-05-31 23:31:32 +0200
committerSvxy <aidan61605@gmail.com>2023-05-31 23:31:32 +0200
commiteb4b3404aa00220d659e532151dab13d642c17a3 (patch)
tree7e1107c4995489a26c4007e41b53ea8d00ab2134 /tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.cpp
downloadThe-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.gz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.bz2
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.lz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.xz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.zst
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.zip
Diffstat (limited to 'tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.cpp')
-rw-r--r--tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.cpp136
1 files changed, 136 insertions, 0 deletions
diff --git a/tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.cpp b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.cpp
new file mode 100644
index 0000000..0a508b4
--- /dev/null
+++ b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.cpp
@@ -0,0 +1,136 @@
+//---------------------------------------------------------------------------
+
+#include <vcl.h>
+#include <sp/interface.hpp>
+#pragma hdrstop
+
+#include "fcframe.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+
+extern bool g_IsDataSaved;
+extern bool g_ForceDataUpdate;
+
+TFrame1 *Frame1;
+//---------------------------------------------------------------------------
+__fastcall TFrame1::TFrame1(TComponent* Owner , int fcindex)
+ : TFrame(Owner) , m_FCIndex( fcindex )
+{
+}
+
+//---------------------------------------------------------------------------
+
+
+void __fastcall TFrame1::CyclicCheckBoxClick(TObject *Sender)
+{
+ SPSetCyclic( SPGetCurrentState() , m_FCIndex , this->CyclicCheckBox->State != cbUnchecked );
+ this->cycleForEditBox->Enabled = CyclicCheckBox->State != cbUnchecked;
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TFrame1::MaxFrameEditBoxChange(TObject *Sender)
+{
+ FrameControllerData fcData;
+ SPGetFrameControllerData( SPGetCurrentState() , m_FCIndex , &fcData );
+
+ AnsiString frame;
+ frame = this->MaxFrameEditBox->Text;
+ float f = 0.0f;
+ try
+ {
+ f = frame.ToDouble();
+ }
+ catch (Exception&)
+ {
+ f = fcData.maxFrame;
+ }
+
+ SPSetFrameRange( SPGetCurrentState() , m_FCIndex , fcData.minFrame , f );
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TFrame1::MinFrameEditBoxChange(TObject *Sender)
+{
+ FrameControllerData fcData;
+ SPGetFrameControllerData( SPGetCurrentState() , m_FCIndex , &fcData );
+
+ AnsiString frame;
+ frame = this->MinFrameEditBox->Text;
+ float f = 0.0f;
+
+ try
+ {
+ f = frame.ToDouble();
+
+ }
+ catch (Exception&)
+ {
+ f = fcData.minFrame;
+ }
+
+ SPSetFrameRange( SPGetCurrentState() , m_FCIndex , f , fcData.maxFrame );
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TFrame1::holdFrameCheckboxClick(TObject *Sender)
+{
+ SPSetHoldFrame( SPGetCurrentState() , m_FCIndex , holdFrameCheckbox->Checked );
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TFrame1::speedEditBoxChange(TObject *Sender)
+{
+ FrameControllerData fcData;
+ SPGetFrameControllerData( SPGetCurrentState() , m_FCIndex , &fcData );
+
+ AnsiString speed;
+ speed = this->speedEditBox->Text;
+ float fSpeed = 0.0f;
+
+ try
+ {
+ fSpeed = speed.ToDouble();
+ }
+ catch (Exception&)
+ {
+ fSpeed = fcData.relativeSpeed;
+ }
+
+ SPSetRelativeSpeed( SPGetCurrentState() , m_FCIndex , fSpeed );
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TFrame1::cycleForEditBoxChange(TObject *Sender)
+{
+ FrameControllerData fcData;
+ SPGetFrameControllerData( SPGetCurrentState() , m_FCIndex , &fcData );
+
+ AnsiString cycles;
+ cycles = cycleForEditBox->Text;
+ int iCycles = 0;
+ try
+ {
+ iCycles = cycles.ToInt();
+ }
+ catch (Exception&)
+ {
+ iCycles = fcData.numberOfCycles;
+ }
+
+ SPSetNumberOfCycles( SPGetCurrentState() , m_FCIndex , iCycles );
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TFrame1::EditBoxExit(TObject *Sender)
+{
+ //do something here
+ g_ForceDataUpdate = true;
+}
+//---------------------------------------------------------------------------
+