Compare commits

..

1 Commits

Author SHA1 Message Date
I#Oleg
d0cd258663
Merge 8fba5a9979 into 29985681a1 2025-01-19 14:12:38 +00:00
3 changed files with 14 additions and 27 deletions

View File

@ -1,4 +0,0 @@
./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,6 +15,7 @@
#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>
@ -25,6 +26,7 @@ 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,
@ -35,35 +37,31 @@ COptionsSubModification::COptionsSubModification(vgui::Panel *parent) : Property
true // Allow fractional values true // Allow fractional values
); );
m_pAspectRatioLabel = new TextEntry(this, "AspectRatioLabel"); m_aspectRatioLabel = new TextEntry(this, "AspectRatioLabel");
m_pAspectRatioLabel->AddActionSignalTarget(this); m_aspectRatioLabel->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_pGiveWeaponButton = new Button(this, "GiveWeapon", "Give Weapon"); m_giveWeaponButton = 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_pGiveWeaponButton->SetCommand("GiveWeapon"); m_giveWeaponButton->SetCommand("GiveWeapon");
m_pGiveWeaponButton->AddActionSignalTarget(this); m_giveWeaponButton->AddActionSignalTarget(this);
m_pGiveHealthKitButton = new Button(this, "GiveHealthKit", "Give Health Kit");
m_pGiveHealthKitButton->SetCommand("GiveHealthKit");
m_pGiveHealthKitButton->AddActionSignalTarget(this);
UpdateLabel(m_pAspectRatioSlider, m_pAspectRatioLabel); UpdateLabel(m_pAspectRatioSlider, m_aspectRatioLabel);
m_pGiveWeaponButton->SetEnabled(true); m_giveWeaponButton->SetEnabled(true);
} }
COptionsSubModification::~COptionsSubModification() = default; COptionsSubModification::~COptionsSubModification() = default;
void COptionsSubModification::OnTextChanged(Panel *panel) void COptionsSubModification::OnTextChanged(Panel *panel)
{ {
if (panel == m_pAspectRatioLabel) if (panel == m_aspectRatioLabel)
{ {
char buf[64]; char buf[64];
m_pAspectRatioLabel->GetText(buf, 64); m_aspectRatioLabel->GetText(buf, 64);
float fValue; float fValue;
int numParsed = sscanf(buf, "%f", &fValue); int numParsed = sscanf(buf, "%f", &fValue);
@ -103,7 +101,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_pAspectRatioLabel); UpdateLabel(m_pAspectRatioSlider, m_aspectRatioLabel);
} }
} }
@ -131,11 +129,6 @@ 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,10 +55,8 @@ protected:
void UpdateLabel(CCvarSlider *slider, vgui::TextEntry *label); void UpdateLabel(CCvarSlider *slider, vgui::TextEntry *label);
private: private:
vgui::TextEntry *m_pAspectRatioLabel; vgui::TextEntry *m_aspectRatioLabel;
vgui::Button *m_pGiveWeaponButton; vgui::Button *m_giveWeaponButton;
vgui::Button *m_pGiveHealthKitButton;
CCvarToggleCheckButton *m_pChangeCheatFlag; CCvarToggleCheckButton *m_pChangeCheatFlag;
CCvarSlider *m_pAspectRatioSlider; CCvarSlider *m_pAspectRatioSlider;