added bash script to use WAF build tools

This commit is contained in:
IOleg-sus 2025-01-21 16:06:09 +02:00
parent 8fba5a9979
commit 354089fe21
3 changed files with 27 additions and 14 deletions

4
build_waf.sh Normal file
View File

@ -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

View File

@ -15,7 +15,6 @@
#include <KeyValues.h> #include <KeyValues.h>
#include <vgui/IScheme.h> #include <vgui/IScheme.h>
#include "tier1/convar.h"
#include "vgui_controls/Controls.h" #include "vgui_controls/Controls.h"
#include <vgui_controls/TextEntry.h> #include <vgui_controls/TextEntry.h>
@ -26,7 +25,6 @@ using namespace vgui;
COptionsSubModification::COptionsSubModification(vgui::Panel *parent) : PropertyPage(parent, nullptr) COptionsSubModification::COptionsSubModification(vgui::Panel *parent) : PropertyPage(parent, nullptr)
{ {
// TODO: Android
// Create the slider for aspect ratio adjustments // Create the slider for aspect ratio adjustments
m_pAspectRatioSlider = new CCvarSlider( m_pAspectRatioSlider = new CCvarSlider(
this, this,
@ -37,31 +35,35 @@ COptionsSubModification::COptionsSubModification(vgui::Panel *parent) : Property
true // Allow fractional values true // Allow fractional values
); );
m_aspectRatioLabel = new TextEntry(this, "AspectRatioLabel"); m_pAspectRatioLabel = new TextEntry(this, "AspectRatioLabel");
m_aspectRatioLabel->AddActionSignalTarget(this); m_pAspectRatioLabel->AddActionSignalTarget(this);
m_pChangeCheatFlag = new CCvarToggleCheckButton( m_pChangeCheatFlag = new CCvarToggleCheckButton(
this , "ChangeCheatFlag" , "Change Cheat Flag" , "sv_cheats" 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 // Load settings from the associated resource file
LoadControlSettings("Resource\\OptionsSubModification.res"); LoadControlSettings("Resource\\OptionsSubModification.res");
m_giveWeaponButton->SetCommand("GiveWeapon"); m_pGiveWeaponButton->SetCommand("GiveWeapon");
m_giveWeaponButton->AddActionSignalTarget(this); 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; COptionsSubModification::~COptionsSubModification() = default;
void COptionsSubModification::OnTextChanged(Panel *panel) void COptionsSubModification::OnTextChanged(Panel *panel)
{ {
if (panel == m_aspectRatioLabel) if (panel == m_pAspectRatioLabel)
{ {
char buf[64]; char buf[64];
m_aspectRatioLabel->GetText(buf, 64); m_pAspectRatioLabel->GetText(buf, 64);
float fValue; float fValue;
int numParsed = sscanf(buf, "%f", &fValue); int numParsed = sscanf(buf, "%f", &fValue);
@ -101,7 +103,7 @@ void COptionsSubModification::OnControlModified(Panel *panel)
// Update the label based on slider changes // Update the label based on slider changes
if (panel == m_pAspectRatioSlider && m_pAspectRatioSlider->HasBeenModified()) 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"); engine->ExecuteClientCmd("impulse 101");
Msg("GiveWeapon command triggered\n"); // Debug message Msg("GiveWeapon command triggered\n"); // Debug message
} }
if(!stricmp(command, "GiveHealthKit"))
{
engine->ExecuteClientCmd("give item_healthkit");
Msg("GiveHealthKit command triggered\n");
}
else else
{ {
BaseClass::OnCommand(command); // Make sure to call the base class for any other commands BaseClass::OnCommand(command); // Make sure to call the base class for any other commands

View File

@ -55,8 +55,10 @@ protected:
void UpdateLabel(CCvarSlider *slider, vgui::TextEntry *label); void UpdateLabel(CCvarSlider *slider, vgui::TextEntry *label);
private: private:
vgui::TextEntry *m_aspectRatioLabel; vgui::TextEntry *m_pAspectRatioLabel;
vgui::Button *m_giveWeaponButton; vgui::Button *m_pGiveWeaponButton;
vgui::Button *m_pGiveHealthKitButton;
CCvarToggleCheckButton *m_pChangeCheatFlag; CCvarToggleCheckButton *m_pChangeCheatFlag;
CCvarSlider *m_pAspectRatioSlider; CCvarSlider *m_pAspectRatioSlider;