diff --git a/build_waf.sh b/build_waf.sh new file mode 100644 index 00000000..880b2eae --- /dev/null +++ b/build_waf.sh @@ -0,0 +1,4 @@ +./waf configure -T release --destdir=E:/source_engine --prefix=E:/source_engine --build-game=hl1 && + ./waf install --strip + +# use can set --destdir and --prefix and set path , where you located source code \ No newline at end of file diff --git a/gameui/OptionsSubModification.cpp b/gameui/OptionsSubModification.cpp index c4ed753c..75c00732 100644 --- a/gameui/OptionsSubModification.cpp +++ b/gameui/OptionsSubModification.cpp @@ -15,7 +15,6 @@ #include #include -#include "tier1/convar.h" #include "vgui_controls/Controls.h" #include @@ -26,7 +25,6 @@ using namespace vgui; COptionsSubModification::COptionsSubModification(vgui::Panel *parent) : PropertyPage(parent, nullptr) { -// TODO: Android // Create the slider for aspect ratio adjustments m_pAspectRatioSlider = new CCvarSlider( this, @@ -37,31 +35,35 @@ COptionsSubModification::COptionsSubModification(vgui::Panel *parent) : Property true // Allow fractional values ); - m_aspectRatioLabel = new TextEntry(this, "AspectRatioLabel"); - m_aspectRatioLabel->AddActionSignalTarget(this); + m_pAspectRatioLabel = new TextEntry(this, "AspectRatioLabel"); + m_pAspectRatioLabel->AddActionSignalTarget(this); m_pChangeCheatFlag = new CCvarToggleCheckButton( this , "ChangeCheatFlag" , "Change Cheat Flag" , "sv_cheats" ); - m_giveWeaponButton = new Button(this, "GiveWeapon", "Give Weapon"); + m_pGiveWeaponButton = new Button(this, "GiveWeapon", "Give Weapon"); // Load settings from the associated resource file LoadControlSettings("Resource\\OptionsSubModification.res"); - m_giveWeaponButton->SetCommand("GiveWeapon"); - m_giveWeaponButton->AddActionSignalTarget(this); + m_pGiveWeaponButton->SetCommand("GiveWeapon"); + m_pGiveWeaponButton->AddActionSignalTarget(this); + + m_pGiveHealthKitButton = new Button(this, "GiveHealthKit", "Give Health Kit"); + m_pGiveHealthKitButton->SetCommand("GiveHealthKit"); + m_pGiveHealthKitButton->AddActionSignalTarget(this); - UpdateLabel(m_pAspectRatioSlider, m_aspectRatioLabel); + UpdateLabel(m_pAspectRatioSlider, m_pAspectRatioLabel); - m_giveWeaponButton->SetEnabled(true); + m_pGiveWeaponButton->SetEnabled(true); } COptionsSubModification::~COptionsSubModification() = default; void COptionsSubModification::OnTextChanged(Panel *panel) { - if (panel == m_aspectRatioLabel) + if (panel == m_pAspectRatioLabel) { char buf[64]; - m_aspectRatioLabel->GetText(buf, 64); + m_pAspectRatioLabel->GetText(buf, 64); float fValue; int numParsed = sscanf(buf, "%f", &fValue); @@ -101,7 +103,7 @@ void COptionsSubModification::OnControlModified(Panel *panel) // Update the label based on slider changes if (panel == m_pAspectRatioSlider && m_pAspectRatioSlider->HasBeenModified()) { - UpdateLabel(m_pAspectRatioSlider, m_aspectRatioLabel); + UpdateLabel(m_pAspectRatioSlider, m_pAspectRatioLabel); } } @@ -129,6 +131,11 @@ void COptionsSubModification::OnCommand(const char *command) engine->ExecuteClientCmd("impulse 101"); Msg("GiveWeapon command triggered\n"); // Debug message } + if(!stricmp(command, "GiveHealthKit")) + { + engine->ExecuteClientCmd("give item_healthkit"); + Msg("GiveHealthKit command triggered\n"); + } else { BaseClass::OnCommand(command); // Make sure to call the base class for any other commands diff --git a/gameui/OptionsSubModification.h b/gameui/OptionsSubModification.h index 3d70556c..57976437 100644 --- a/gameui/OptionsSubModification.h +++ b/gameui/OptionsSubModification.h @@ -55,8 +55,10 @@ protected: void UpdateLabel(CCvarSlider *slider, vgui::TextEntry *label); private: - vgui::TextEntry *m_aspectRatioLabel; - vgui::Button *m_giveWeaponButton; + vgui::TextEntry *m_pAspectRatioLabel; + vgui::Button *m_pGiveWeaponButton; + vgui::Button *m_pGiveHealthKitButton; + CCvarToggleCheckButton *m_pChangeCheatFlag; CCvarSlider *m_pAspectRatioSlider;