Exemple #1
0
bool j1Console::OnCommand(const Command* command, const p2DynArray<p2SString>& arguments, p2SString& return_message)
{
	bool ret = true;

	if(command == quit)
	{
		App->Quit();
		return_message.create("Bye!");
	}
	else if(command == list)
	{
		return_message.create("Commands: ");
		uint size = commands.Count();
		for(uint i = 0; i < size; ++i)
		{
			return_message += commands[i].name;
			if(i < size - 1)
				return_message += ", ";
		}

		return_message += "\nCvars: ";
		size = cvars.Count();
		for(uint i = 0; i < size; ++i)
		{
			return_message += cvars[i].name;
			if(i < size - 1)
				return_message += ", ";
		}
	}
	
	return ret;
}
//GuiLabel Functions
void GuiLabel::SetText(p2SString t)
{
	if (tex)
		SDL_DestroyTexture(tex);

	text = t.GetString();
	tex = App->font->Print(text.GetString());
	
	uint w, h;
	App->tex->GetSize(tex, w, h);
	SetSize(w, h);
}
Exemple #3
0
void fCVar::SetValueToFloat(p2SString& value)
{
	fValue = atof(value.GetString());
}
Exemple #4
0
fCVar::fCVar(p2SString& sValue) : CVar(sValue)
{
	fValue = atof(sValue.GetString());
}
Exemple #5
0
CVar::CVar(const p2SString& nameIdentifier)
{
	sValue.create(nameIdentifier.GetString());
}
Exemple #6
0
void iCVar::SetValueToInt(p2SString& value)
{
	iValue = atoi(value.GetString());
}
Exemple #7
0
iCVar::iCVar(p2SString& sValue) : CVar(sValue)
{
	iValue = atoi(sValue.GetString());
}