[AYYWARE] Save Configuration Fix

Posts 1–15 of 16 · Page 1 of 2
[AYYWARE] Save Configuration Fix
Replace SaveWindowState in GUI.cpp with this code

Code:
void CGUI::SaveWindowState(CWindow* window, std::string Filename)
{
	// Create a whole new document and we'll just save over top of the old one
	tinyxml2::XMLDocument Doc;

	// Root Element is called "PASTA"
	tinyxml2::XMLElement *Root = Doc.NewElement("PASTA");
	Doc.LinkEndChild(Root);

	Utilities::Log("Saving Window %s", window->Title.c_str());

	// If the window has some tabs..
	if (Root && window->Tabs.size() > 0)
	{
		for (auto Tab : window->Tabs)
		{
			// Add a new section for this tab
			tinyxml2::XMLElement *TabElement = Doc.NewElement(Tab->Title.c_str());
			Root->LinkEndChild(TabElement);

			Utilities::Log("Saving Tab %s", Tab->Title.c_str());

			// Now we itterate the controls this tab contains
			if (TabElement && Tab->Controls.size() > 0)
			{
				for (auto Control : Tab->Controls)
				{
					// If the control is ok to be saved
					if (Control && Control->Flag(UIFlags::UI_SaveFile) && Control->FileIdentifier.length() > 1 && Control->FileControlType && Control->FileIdentifier.c_str() != "Settings")
					{
						// Create an element for the control
						tinyxml2::XMLElement *ControlElement = Doc.NewElement(Control->FileIdentifier.c_str());
						TabElement->LinkEndChild(ControlElement);

						Utilities::Log("Saving control %s", Control->FileIdentifier.c_str());

						if (!ControlElement)
						{
							Utilities::Log("Error saving ControlElement");
							return;
						}

						CCheckBox* cbx = nullptr;
						CComboBox* cbo = nullptr;
						CKeyBind* key = nullptr;
						CSlider* sld = nullptr;

						// Figure out what kind of control and data this is
						switch (Control->FileControlType)
						{
						case UIControlTypes::UIC_CheckBox:
							cbx = (CCheckBox*)Control;
							ControlElement->SetText(cbx->GetState());
							break;
						case UIControlTypes::UIC_ComboBox:
							cbo = (CComboBox*)Control;
							ControlElement->SetText(cbo->GetIndex());
							break;
						case UIControlTypes::UIC_KeyBind:
							key = (CKeyBind*)Control;
							ControlElement->SetText(key->GetKey());
							break;
						case UIControlTypes::UIC_Slider:
							sld = (CSlider*)Control;
							ControlElement->SetText(sld->GetValue());
							break;
						}
					}
				}
			}
		}
	}

	//Save the file
	if (Doc.SaveFile(Filename.c_str()) != tinyxml2::XML_NO_ERROR)
	{
		MessageBox(NULL, "Failed To Save Config File!", "PASTA", MB_OK);
	}
}
i think anyone with half a brain would be able to fix ayyware
Quote Originally Posted by ic3w0lf22 View Post
Replace SaveWindowState in GUI.cpp with this code

Code:
void CGUI::SaveWindowState(CWindow* window, std::string Filename)
{
	// Create a whole new document and we'll just save over top of the old one
	tinyxml2::XMLDocument Doc;

	// Root Element is called "PASTA"
	tinyxml2::XMLElement *Root = Doc.NewElement("PASTA");
	Doc.LinkEndChild(Root);

	Utilities::Log("Saving Window %s", window->Title.c_str());

	// If the window has some tabs..
	if (Root && window->Tabs.size() > 0)
	{
		for (auto Tab : window->Tabs)
		{
			// Add a new section for this tab
			tinyxml2::XMLElement *TabElement = Doc.NewElement(Tab->Title.c_str());
			Root->LinkEndChild(TabElement);

			Utilities::Log("Saving Tab %s", Tab->Title.c_str());

			// Now we itterate the controls this tab contains
			if (TabElement && Tab->Controls.size() > 0)
			{
				for (auto Control : Tab->Controls)
				{
					// If the control is ok to be saved
					if (Control && Control->Flag(UIFlags::UI_SaveFile) && Control->FileIdentifier.length() > 1 && Control->FileControlType && Control->FileIdentifier.c_str() != "Settings")
					{
						// Create an element for the control
						tinyxml2::XMLElement *ControlElement = Doc.NewElement(Control->FileIdentifier.c_str());
						TabElement->LinkEndChild(ControlElement);

						Utilities::Log("Saving control %s", Control->FileIdentifier.c_str());

						if (!ControlElement)
						{
							Utilities::Log("Error saving ControlElement");
							return;
						}

						CCheckBox* cbx = nullptr;
						CComboBox* cbo = nullptr;
						CKeyBind* key = nullptr;
						CSlider* sld = nullptr;

						// Figure out what kind of control and data this is
						switch (Control->FileControlType)
						{
						case UIControlTypes::UIC_CheckBox:
							cbx = (CCheckBox*)Control;
							ControlElement->SetText(cbx->GetState());
							break;
						case UIControlTypes::UIC_ComboBox:
							cbo = (CComboBox*)Control;
							ControlElement->SetText(cbo->GetIndex());
							break;
						case UIControlTypes::UIC_KeyBind:
							key = (CKeyBind*)Control;
							ControlElement->SetText(key->GetKey());
							break;
						case UIControlTypes::UIC_Slider:
							sld = (CSlider*)Control;
							ControlElement->SetText(sld->GetValue());
							break;
						}
					}
				}
			}
		}
	}

	//Save the file
	if (Doc.SaveFile(Filename.c_str()) != tinyxml2::XML_NO_ERROR)
	{
		MessageBox(NULL, "Failed To Save Config File!", "PASTA", MB_OK);
	}
}
go back 2 unturned ! 👌ic3👌
I need a mouse driver plug-in to play the game, hoping to find an able hacker to negotiate the price。
It always worked?...
Quote Originally Posted by Joplin View Post
It always worked?...
I guess some people have a non-working version of it lmao
Quote Originally Posted by iTzMeM8 View Post
I guess some people have a non-working version of it lmao
I think this thread is a cry for attention
Quote Originally Posted by Joplin View Post
I think this thread is a cry for attention
Maybe, he probably wants his "Thanks" button smashed by skids xD
Quote Originally Posted by iTzMeM8 View Post
Maybe, he probably wants his "Thanks" button smashed by skids xD
Haha yea or just fame
Quote Originally Posted by Joplin View Post
Haha yea or just fame
If he wants fame like this... He won't get anywhere xD
Thanks for copying the working one from another ayyware source just because the other ayyware source was broken on purpose so that pasters can't do it properly and are motivated to actually try and solve the problem on their own

This is called Anti-Paste and half if not more of the community supports it...

Very appreciated... can't wait to see all the new P2C providers now that they finally fixed their no paste cheat and that their "save config" button is now working...
Quote Originally Posted by ImSavage View Post
Thanks for copying the working one from another ayyware source just because the other ayyware source was broken on purpose so that pasters can't do it properly and are motivated to actually try and solve the problem on their own

This is called Anti-Paste and half if not more of the community supports it...

Very appreciated... can't wait to see all the new P2C providers now that they finally fixed their no paste cheat and that their "save config" button is now working...
Shit posting is not allowed on the forum!
just some quick information, for all pasters (i think).

SetTitle("RageBot"); //What will be shown in Menu and cfg File for the different Tabs.
AimbotEnable.SetFileId("rage_enable"); //Set File ID text will show in the cfg file, so choose a text for every option.
AimbotGroup.PlaceLabledControl("Enable", this, &AimbotEnable); //what will be shown in menu
Quote Originally Posted by PastaKing View Post
just some quick information, for all pasters (i think).

SetTitle("RageBot"); //What will be shown in Menu and cfg File for the different Tabs.
AimbotEnable.SetFileId("rage_enable"); //Set File ID text will show in the cfg file, so choose a text for every option.
AimbotGroup.PlaceLabledControl("Enable", this, &AimbotEnable); //what will be shown in menu
A kid with brain cancer should even know that.
Quote Originally Posted by PastaKing View Post
just some quick information, for all pasters (i think).

SetTitle("RageBot"); //What will be shown in Menu and cfg File for the different Tabs.
AimbotEnable.SetFileId("rage_enable"); //Set File ID text will show in the cfg file, so choose a text for every option.
AimbotGroup.PlaceLabledControl("Enable", this, &AimbotEnable); //what will be shown in menu
If somebody wants to paste but doesn't know this much... the only option I recommend to them is quitting...
Posts 1–15 of 16 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?