Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lch revert, DO NOT MERGE #75

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ABCEnchance.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ $(FreeImageCheckRequirements)</Command>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_AVX2|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;GLEW_STATIC;VGUI_USE_SURFACE2;VGUI_USE_SCHEME2;VGUI_USE_INPUT2;NO_MALLOC_OVERRIDE;NO_TIER0_MINIDUMP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;GLEW_STATIC;VGUI_USE_SURFACE2;VGUI_USE_SCHEME2;VGUI_USE_INPUT2;NO_MALLOC_OVERRIDE;NO_TIER0_MINIDUMP;__HAS_NETEASE_API;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
Expand Down
3 changes: 3 additions & 0 deletions src/Header/HUD/vgui/textmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class CTextMenu : public vgui::EditablePanel, public IViewportPanel

CTextMenu();
virtual void ApplySchemeSettings(vgui::IScheme* pScheme) override;
void ApplySettings(KeyValues* inResourceData) override;
// IViewportPanel overrides
virtual const char* GetName() override;
virtual void Reset() override;
Expand All @@ -41,5 +42,7 @@ class CTextMenu : public vgui::EditablePanel, public IViewportPanel
std::string m_szMenuString;

float m_flShutoffTime;

float m_flFadeAnimateTime;
};
#endif
5 changes: 5 additions & 0 deletions src/Source/HUD/Viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,16 @@ vgui::HScheme GetViewPortBaseScheme() {
CViewport::CViewport(void) : Panel(nullptr, "ABCEnchanceViewport"){
int swide, stall;
surface()->GetScreenSize(swide, stall);

MakePopup(false, true);

SetScheme("ABCEnchanceScheme");
SetBounds(0, 0, swide, stall);
SetPaintBorderEnabled(false);
SetPaintBackgroundEnabled(false);
SetMouseInputEnabled(false);
SetKeyBoardInputEnabled(false);
SetProportional(true);

m_hBaseScheme = vgui::scheme()->LoadSchemeFromFile(VGUI2_ROOT_DIR "AbcScheme.res", "AbcScheme");
vgui::GetAnimationController()->SetScriptFile(GetVPanel(), "abcenchance/HudAnimations.txt", true);
Expand Down Expand Up @@ -114,6 +118,7 @@ void CViewport::Start(void){
AddNewPanel(m_pItemStack = new CItemStackPanel());
AddNewPanel(m_pWeaponStack = new CWeaponStackPanel());
AddNewPanel(m_pWeaponChoose = new CWeaponChoosePanel());
SetVisible(false);
}

void CViewport::SetParent(VPANEL vPanel){
Expand Down
14 changes: 13 additions & 1 deletion src/Source/HUD/vgui/textmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
extern vgui::HScheme GetViewPortBaseScheme();
CTextMenu::CTextMenu()
: BaseClass(nullptr, VIEWPORT_TEXTMENU_NAME) {
SetProportional(true);
SetKeyBoardInputEnabled(false);
SetMouseInputEnabled(false);
SetScheme(GetViewPortBaseScheme());
Expand All @@ -45,6 +46,10 @@ void CTextMenu::ApplySchemeSettings(vgui::IScheme* pScheme) {
SetBgColor(GetSchemeColor("TextMenu.BgColor", GetSchemeColor("Panel.BgColor", pScheme), pScheme));
m_pMenu->SetFgColor(GetSchemeColor("TextMenu.TextColor", GetSchemeColor("Label.FgColor", pScheme), pScheme));
}
void CTextMenu::ApplySettings(KeyValues* inResourceData) {
BaseClass::ApplySettings(inResourceData);
m_flFadeAnimateTime = inResourceData->GetFloat("fade_time");
}
void CTextMenu::ShowPanel(bool state) {
if (state == IsVisible())
return;
Expand All @@ -71,10 +76,16 @@ void CTextMenu::SetContent(const char* szMenu){


void CTextMenu::StartFade(bool state){
vgui::GetAnimationController()->StartAnimationSequence(GetParent(), state ? "TextMenuIn" : "TextMenuOut");
SetAlpha(state ? 0 : 255);
ShowPanel(true);
vgui::GetAnimationController()->RunAnimationCommand(this, "alpha", state ? 255 : 0, 0.0f, m_flFadeAnimateTime, vgui::AnimationController::INTERPOLATOR_LINEAR);
}

void CTextMenu::OnThink(){
if (GetAlpha() <= 0) {
ShowPanel(false);
return;
}
if (m_flShutoffTime >= 0 && gEngfuncs.GetClientTime() >= m_flShutoffTime) {
StartFade(false);
m_flShutoffTime = -1;
Expand Down Expand Up @@ -104,6 +115,7 @@ bool CTextMenu::MsgShowMenu(const char* pszName, int iSize, void* pbuf){
if (m_bitsValidSlots){
m_szMenuString += READ_STRING();
if (!iNeedMore) {

//Remove all \n from begin and end
//someone will send a bunch of \n\n\n\n\n\n\n\n\n\n\n\n\n\n in the beginning, wtf?????
const static auto searchFunc = [](char ch) {return ch != '\n';};
Expand Down
Loading