[C++]Movable CS:GO Menu.

Posts 1–8 of 8 · Page 1 of 1
[C++]Movable CS:GO Menu.
Basicly...
My copy pasted CSGO Menu is unmovable.. how do i make this movable?


please help.
You need to start thinking like a developer and actually learn the language instead of pasting your life together.
It's all about problem solving, once you've learnt the language, learnt how to solve problems and learnt how to search you wouldn't be asking this question.

I've written about how to implement an event system on my blog, but i'm pretty sure i'm not allowed to link it here as it can count as advertisement of my blog.

With a proper event system and a proper menu implementation, you can implement it fairly easy.

Code:
bool Form::OnMouseDown( POINT MousePosition, MouseButton MouseButton )
{
	if ( Active )
	{
		if ( MouseButton == MouseButton::MOUSE_LEFT )
		{
			
			if ( MousePosition.x >= X && MousePosition.x <= X + Width && MousePosition.y >= Y && MousePosition.y <= Y + TitleBarHeight )
			{
				IsBeingDragged = true;
				ClickedDeltaPosition = { MousePosition.x - static_cast< int >( X ), MousePosition.y - static_cast< int >( Y ) };
				return true;
			}
		}
	}

	return false;
}

bool Form::OnMouseUp( POINT MousePosition, MouseButton MouseButton )
{
	if ( MouseButton == MouseButton::MOUSE_LEFT )
	{
		if ( IsBeingDragged )
		{
			IsBeingDragged = false;
			ClickedDeltaPosition = { 0, 0 };
			return true;
		}
	}


	return false;	
}

bool Form::OnMouseMove( POINT MousePosition, MouseButton MouseButton )
{
	if ( Active )
	{
		if ( IsBeingDragged )
		{
			if ( MousePosition.x >= X && MousePosition.x <= X + Width && MousePosition.y >= Y && MousePosition.y <= Y + TitleBarHeight )
			{
				X = MousePosition.x - ClickedDeltaPosition.x;
				Y = MousePosition.y - ClickedDeltaPosition.y;

				UpdateVertecies( );
					
				for ( auto const &i : Childrens )
				{
					i->UpdateVertecies( );
				}

				return true;
			}
	return false;
}
Quote Originally Posted by WasserEsser View Post
You need to start thinking like a developer and actually learn the language instead of pasting your life together.
It's all about problem solving, once you've learnt the language, learnt how to solve problems and learnt how to search you wouldn't be asking this question.

I've written about how to implement an event system on my blog, but i'm pretty sure i'm not allowed to link it here as it can count as advertisement of my blog.

With a proper event system and a proper menu implementation, you can implement it fairly easy.

Code:
bool Form::OnMouseDown( POINT MousePosition, MouseButton MouseButton )
{
    if ( Active )
    {
        if ( MouseButton == MouseButton::MOUSE_LEFT )
        {
            
            if ( MousePosition.x >= X && MousePosition.x <= X + Width && MousePosition.y >= Y && MousePosition.y <= Y + TitleBarHeight )
            {
                IsBeingDragged = true;
                ClickedDeltaPosition = { MousePosition.x - static_cast< int >( X ), MousePosition.y - static_cast< int >( Y ) };
                return true;
            }
        }
    }

    return false;
}

bool Form::OnMouseUp( POINT MousePosition, MouseButton MouseButton )
{
    if ( MouseButton == MouseButton::MOUSE_LEFT )
    {
        if ( IsBeingDragged )
        {
            IsBeingDragged = false;
            ClickedDeltaPosition = { 0, 0 };
            return true;
        }
    }


    return false;    
}

bool Form::OnMouseMove( POINT MousePosition, MouseButton MouseButton )
{
    if ( Active )
    {
        if ( IsBeingDragged )
        {
            if ( MousePosition.x >= X && MousePosition.x <= X + Width && MousePosition.y >= Y && MousePosition.y <= Y + TitleBarHeight )
            {
                X = MousePosition.x - ClickedDeltaPosition.x;
                Y = MousePosition.y - ClickedDeltaPosition.y;

                UpdateVertecies( );
                    
                for ( auto const &i : Childrens )
                {
                    i->UpdateVertecies( );
                }

                return true;
            }
    return false;
}
it gives me an error that some of the things arent defined, example: "mousebutton" ..
what should i define?
Sorry i dont know alot of C++, if i code something its propably vb

- - - Updated - - -

no im not trolling

- - - Updated - - -

i have literally now idea how to make dis work
Quote Originally Posted by prolife200 View Post
it gives me an error that some of the things arent defined, example: "mousebutton" ..
what should i define?
Sorry i dont know alot of C++, if i code something its propably vb

- - - Updated - - -

no im not trolling

- - - Updated - - -

i have literally now idea how to make dis work
You can't just copy paste code
Quote Originally Posted by Yemiez View Post
You can't just copy paste code
ik i suck at C++
He was trolling actualy
i was gonna make that in my cheat today. but i couldnt be stuffed. how im gonna do it is have function called Init(); that sets everything to its place + menu.pos.x/y. so then im gonna set menu.pos to something different and recall Init();. probably not the best way but its easyest atm for me that i can think off, there is probably many better ways to do this. the init() also doulbes up as setting up the whole menus pos shit at the very start of the injection.
1 week has passed and no further replies have been made by the OP. Assuming solved.

/Closed.
Posts 1–8 of 8 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us