示例#1
0
void process_player_menu()
{
	const int lineCount = 17;
	
	std::string caption = "Player Options";

	StandardOrToggleMenuDef lines[lineCount] = {
		{"Player Skin", NULL, NULL, false},
		{"Heal Player", NULL, NULL, true},
		{"Add Cash", NULL, NULL, true, CASH},
		{"Wanted Level", NULL, NULL, true, WANTED},
		{ "Freeze Wanted Level", &featureWantedLevelFrozen, &featureWantedLevelFrozenUpdated, true },
		{ "Never Wanted", &featurePlayerNeverWanted, &featurePlayerNeverWantedUpdated, true },
		{"Invincible", &featurePlayerInvincible, &featurePlayerInvincibleUpdated, true},
		{"Police Ignore You", &featurePlayerIgnoredByPolice, &featurePlayerIgnoredByPoliceUpdated, true },
		{ "Everyone Ignores You", &featurePlayerIgnoredByAll, &featurePlayerIgnoredByAllUpdated, true },
		{"Unlimited Ability", &featurePlayerUnlimitedAbility, NULL, true},
		{"Noiseless", &featurePlayerNoNoise, &featurePlayerNoNoiseUpdated, true},
		{"Fast Swim", &featurePlayerFastSwim, &featurePlayerFastSwimUpdated, true},
		{"Fast Run", &featurePlayerFastRun, &featurePlayerFastRunUpdated, true},
		{"Super Jump", &featurePlayerSuperJump, NULL, true},
		{"Invisibility", &featurePlayerInvisible, &featurePlayerInvisibleUpdated, true},
		{ "Drunk", &featurePlayerDrunk, &featurePlayerDrunkUpdated, true },
		{ "Animations", NULL, NULL, false }
	};

	draw_menu_from_struct_def(lines, lineCount, &activeLineIndexPlayer, caption, onconfirm_player_menu);
}
void process_anim_menu()
{
	std::string caption = "ANIMATIONS";

	const int lineCount = 23;

	StandardOrToggleMenuDef lines[lineCount] = {
		{ "The Bird", NULL, NULL, true },
		{ "The Bird 2", NULL, NULL, true },
		{ "Up Yours", NULL, NULL, true },
		{ "Dock", NULL, NULL, true },
		{ "Jerk", NULL, NULL, true },
		{ "Knuckle Crunch", NULL, NULL, true },
		{ "Shush", NULL, NULL, true },
		{ "DJ", NULL, NULL, true },
		{ "Rock", NULL, NULL, true },
		{ "Air Guitar", NULL, NULL, true },
		{ "Wave", NULL, NULL, true },
		{ "Salute", NULL, NULL, true },
		{ "Thanks", NULL, NULL, true },
		{ "Thumbs Up", NULL, NULL, true },
		{ "Face Palm", NULL, NULL, true },
		{ "Nose Pick", NULL, NULL, true },
		{ "Slow Clap", NULL, NULL, true },
		{ "Photography", NULL, NULL, true },
		{ "Blow Kiss", NULL, NULL, true },
		{ "Jazz Hands", NULL, NULL, true },
		{ "Surrender", NULL, NULL, true },
		{ "Air Synth", NULL, NULL, true },
		{ "Air Shagging", NULL, NULL, true }
	};

	draw_menu_from_struct_def(lines, lineCount, &activeLineIndexAnim, caption, onconfirm_animation_menu);
}
void process_misc_menu()
{
	std::string caption = "MISCELLANEOUS";

	const int lineCount = 2;

	StandardOrToggleMenuDef lines[lineCount] = {
		{ "Basic Vehicle Management System", NULL, NULL, false },
		{ "Show Voice Chat Speaker", &featureShowVoiceChatSpeaker, NULL, true }
	};

	draw_menu_from_struct_def(lines, lineCount, &activeLineIndexMisc, caption, onconfirm_misc_menu);
}
void process_misc_trainerconfig_menu()
{
	const int lineCount = 3;

	std::string caption = "Trainer Options";

	StandardOrToggleMenuDef lines[lineCount] = {
		{ "Lock Controls While In Menu", &featureBlockInputInMenu, NULL },
		{ "Reset Skin On Death", &featurePlayerResetOnDeath, NULL },
		{ "Vehicle Invinc. Includes Visual Damage", &featureVehInvulnIncludesCosmetic, NULL },
	};

	draw_menu_from_struct_def(lines, lineCount, &activeLineIndexTrainerConfig, caption, NULL);
}
void process_settings_menu()
{
	std::string caption = "TRAINER SETTINGS";

	const int lineCount = 4;

	StandardOrToggleMenuDef lines[lineCount] = {
		{ "Player Blips", &featurePlayerBlips, NULL, true },
		{ "Player Head Display", &featurePlayerHeadDisplay, NULL, true },
		{ "Player Blip Cone (Police FOV)", &featurePlayerBlipCone, NULL, true },
		{ "Player Notifications", &featurePlayerNotifications, NULL, true }
	};

	draw_menu_from_struct_def(lines, lineCount, &activeLineIndexSettings, caption, onconfirm_settings_menu);
}
void process_misc_menu()
{
	const int lineCount = 5;

	std::string caption = "Miscellaneous Options";

	StandardOrToggleMenuDef lines[lineCount] = {
		{ "Trainer Options", NULL, NULL, false },
		{ "Portable Radio", &featurePlayerRadio, &featurePlayerRadioUpdated, true },
		{"Next Radio Track",	NULL,					NULL, true},
		{ "Radio Always Off", &featureRadioAlwaysOff, &featureRadioAlwaysOffUpdated, true },
		{"Hide HUD",			&featureMiscHideHud,	NULL},
	};

	draw_menu_from_struct_def(lines, lineCount, &activeLineIndexMisc, caption, onconfirm_misc_menu);
}
void process_vehicle_menu()
{
	std::string caption = "VEHICLE MANAGEMENT";

	const int lineCount = 5;

	StandardOrToggleMenuDef lines[lineCount] = {
		{ "Set Current Vehicle As Owned", NULL, NULL, true },
		{ "Clear Owned Vehicle", NULL, NULL, true },
		{ "Lock Owned Vehicle", NULL, NULL, true },
		{ "Unlock Owned Vehicle", NULL, NULL, true },
		{ "Attempt To Retrieve Owned Vehicle", NULL, NULL, true }
	};

	draw_menu_from_struct_def(lines, lineCount, &activeLineIndexVeh, caption, onconfirm_vehicle_menu);
}
void process_player_menu(bool(*onConfirmation)(MenuItem<int> value), bool warningMsg)
{
	if (NETWORK::NETWORK_IS_SESSION_STARTED())
	{
		std::vector<StandardOrToggleMenuDef> lines_v;

		playerIdForMenuEntries.clear();
		for (int i = 0; i < MAX_PLAYERS; i++)
		{
			if (playerdb[i].name != "")
			{
				std::string linetxt = "[ID: " + std::to_string(i) + "] " + playerdb[i].name;
				playerIdForMenuEntries.push_back(i);
				lines_v.push_back({ linetxt, NULL, NULL, true });
			}
		}

		const int lineCount = (int)lines_v.size();

		if (lineCount == 0)
		{
			show_notification("Do you feel forever alone ?");
			return;
		}

		std::string caption = std::to_string(lineCount) + " CONNECTED PLAYER" + (lineCount == 1 ? "" : "S");

		if (warningMsg)
			show_notification("Please don't abuse this feature and annoy other players.");

		draw_menu_from_struct_def(&lines_v[0], lineCount, &activeLineIndexPlayer, caption, onConfirmation);
	}
	else
	{
		show_notification("Not in a network session.");
	}
}