Fix crash reaction and add more translation key (#1850)

This commit is contained in:
HCR-750F 2023-07-27 00:26:09 +08:00 committed by GitHub
parent f4a89e36db
commit f73c1bdc98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 81 additions and 74 deletions

View File

@ -24,5 +24,5 @@ namespace big
}
};
host_kick g_host_kick("hostkick", "Host Kick", "Host kick that only works when host", 0, false);
host_kick g_host_kick("hostkick", "HOST_KICK", "HOST_KICK_DESC", 0, false);
}

View File

@ -18,5 +18,5 @@ namespace big
}
}
};
fill_ammo g_fill_ammo("fillammo", "Fill Ammo", "Fills all of your ammo.", 0);
fill_ammo g_fill_ammo("fillammo", "FILL_AMMO", "FILL_AMMO_DESC", 0);
}

View File

@ -2,6 +2,6 @@
namespace big
{
bool_command g_beastjump("beastjump", "Beast Jump", "Allows you to jump as if you were the beast like in the Hunt the Beast event",
bool_command g_beastjump("beastjump", "BEAST_JUMP", "BEAST_JUMP_DESC",
g.self.beast_jump);
}

View File

@ -14,5 +14,5 @@ namespace big
}
};
clean_player g_clean_player("clean", "Clean Player", "Cleans the player of wetness and decals", 0);
clean_player g_clean_player("clean", "CLEAN_PLAYER", "CLEAN_PLAYER_DESC", 0);
}

View File

@ -18,5 +18,5 @@ namespace big
}
};
clear_wanted g_clear_wanted("clearwantedlvl", "Clear Wanted Level", "Clears your wanted level", 0);
clear_wanted g_clear_wanted("clearwantedlvl", "CLEAR_WANTED_LEVEL", "CLEAR_WANTED_LEVEL_DESC_SELF", 0);
}

View File

@ -22,5 +22,5 @@ namespace big
}
};
fill_inventory g_fill_inventory("fillsnacks", "Fill Inventory", "Refills snacks and armor", 0);
fill_inventory g_fill_inventory("fillsnacks", "FILL_INVENTORY", "FILL_INVENTORY_DESC", 0);
}

View File

@ -12,5 +12,5 @@ namespace big
vehicle::repair(self::veh);
}
};
repairpv g_repairpv("repairpv", "Repair PV", "Repairs your currently active personal vehicle", 0);
repairpv g_repairpv("repairpv", "REPAIR_PV", "REPAIR_PV_DESC", 0);
}

View File

@ -94,13 +94,13 @@ namespace big
}
};
boat_pickup g_boat_pickup("boatpickup", "Request Boat Pickup", "Request a boat pickup", 0);
ballistic_armor g_ballistic_armor("ballisticarmor", "Request Ballistic Equipment", "Requests ballistic equipment which includes ballistic armor and an minigun", 0);
request_avenger g_request_avenger("avenger", "Request Avenger", "Requests the Avenger", 0);
request_kosatka g_request_kosatka("kosatka", "Request Kosatka", "Requests the Kosatka", 0);
request_moc g_request_moc("moc", "Request M.O.C", "Requests the Mobile Operations Center", 0);
request_terrorbyte g_request_terrorbyte("terrorbyte", "Request Terrorbyte", "Requests the terrorbyte", 0);
request_acidlab g_request_acidlab("acidlab", "Request Acid Lab", "Requests the Acid Lab", 0);
request_acidlab_bike g_request_acidlab_bike("acidbike", "Request Acid Bike", "Requests the Acid Lab Delivery Bike", 0);
request_taxi g_request_taxi("taxi", "Request Taxi", "Requests a taxi to give you a ride", 0);
boat_pickup g_boat_pickup("boatpickup", "REQUEST_BOAT", "REQUEST_BOAT_DESC", 0);
ballistic_armor g_ballistic_armor("ballisticarmor", "REQUEST_BALLISTIC", "REQUEST_BALLISTIC_DESC", 0);
request_avenger g_request_avenger("avenger", "REQUEST_AVENGER", "REQUEST_AVENGER_DESC", 0);
request_kosatka g_request_kosatka("kosatka", "REQUEST_KOSATKA", "REQUEST_KOSATKA_DESC", 0);
request_moc g_request_moc("moc", "REQUEST_MOC", "REQUEST_MOC_DESC", 0);
request_terrorbyte g_request_terrorbyte("terrorbyte", "REQUEST_TERRORBYTE", "REQUEST_TERRORBYTE_DESC", 0);
request_acidlab g_request_acidlab("acidlab", "REQUEST_ACIDLAB", "REQUEST_ACIDLAB_DESC", 0);
request_acidlab_bike g_request_acidlab_bike("acidbike", "REQUEST_ACIDBIKE", "REQUEST_ACIDBIKE_DESC", 0);
request_taxi g_request_taxi("taxi", "REQUEST_TAXI", "REQUEST_TAXI_DESC", 0);
}

View File

@ -13,5 +13,5 @@ namespace big
}
};
skip_cutscene g_skip_cutscene("skipcutscene", "Skip Cutscene", "Skips the currently playing cutscene", 0);
skip_cutscene g_skip_cutscene("skipcutscene", "SKIP_CUTSCENE", "SKIP_CUTSCENE_DESC", 0);
}

View File

@ -13,5 +13,5 @@ namespace big
}
};
suicide g_suicide("suicide", "Suicide", "Kills you", 0);
suicide g_suicide("suicide", "SUICIDE", "SUICIDE_DESC", 0);
}

View File

@ -2,5 +2,5 @@
namespace big
{
bool_command g_super_jump("superjump", "Super Jump", "Jump really high", g.self.super_jump);
bool_command g_super_jump("superjump", "SUPER_JUMP", "SUPER_JUMP_DESC", g.self.super_jump);
}

View File

@ -28,5 +28,5 @@ namespace big
};
off_radar g_off_radar("otr", "OFF_RADAR", "OFF_RADAR_DESC", g.self.off_radar);
bool_command ghost_org("ghostorg", "Ghost Org", "Use Ghost Organization instead of standard off radar.", g.self.ghost_org);
bool_command ghost_org("ghostorg", "GHOST_ORG", "GHOST_ORG_DESC", g.self.ghost_org);
}

View File

@ -19,5 +19,5 @@ namespace big
}
};
disable_phone g_disable_phone("nophone", "Disable Phone", "Blocks phone and stops all phone calls", g.tunables.disable_phone);
disable_phone g_disable_phone("nophone", "DISABLE_PHONE", "DISABLE_PHONE_DESC", g.tunables.disable_phone);
}

View File

@ -21,6 +21,6 @@ namespace big
}
};
block_homing g_block_homing("blockhoming", "Block Homing Missiles", "Prevents homing missiles from locking on to your vehicle",
block_homing g_block_homing("blockhoming", "BLOCK_HOMING", "BLOCK_HOMING_DESC",
g.vehicle.block_homing);
}

View File

@ -24,6 +24,6 @@ namespace big
}
};
siren_mute g_siren_mute("mutesiren", "Mute Siren", "Disables the siren sound of Emergency vehicles",
siren_mute g_siren_mute("mutesiren", "MUTE_SIREN", "MUTE_SIREN_DESC",
g.vehicle.siren_mute);
}

View File

@ -94,5 +94,5 @@ namespace big
}
};
drive_on_water g_drive_on_water("driveonwater", "Drive On Water", "Allows you to drive on water", g.vehicle.drive_on_water);
drive_on_water g_drive_on_water("driveonwater", "DRIVE_ON_WATER", "DRIVE_ON_WATER_DESC", g.vehicle.drive_on_water);
}

View File

@ -124,5 +124,5 @@ namespace big
}
};
vehicle_fly g_vehicle_fly("vehiclefly", "Vehicle Fly", "Fly with any land vehicle", g.vehicle.fly.enabled);
vehicle_fly g_vehicle_fly("vehiclefly", "VEHICLE_FLY", "VEHICLE_FLY_DESC", g.vehicle.fly.enabled);
}

View File

@ -39,5 +39,5 @@ namespace big
}
};
horn_boost g_horn_boost("hornboost", "Horn Boost", "Boosts your vehicle forward when you sound the horn", g.vehicle.horn_boost);
horn_boost g_horn_boost("hornboost", "HORN_BOOST", "HORN_BOOST_DESC", g.vehicle.horn_boost);
}

View File

@ -18,6 +18,6 @@ namespace big
}
};
instant_brake g_instant_brake("instantbrake", "Instant Brake", "Makes your vehicle stop instantly when you press the brake",
instant_brake g_instant_brake("instantbrake", "INSTANT_BRAKE", "INSTANT_BRAKE_DESC",
g.vehicle.instant_brake);
}

View File

@ -39,7 +39,7 @@ namespace big
}
};
vehinvisibility g_vehinvisibility("invisveh", "Vehicle Invisiblity", "Makes your car invisible", g.vehicle.vehinvisibility);
bool_command g_localveh_visibility("localinvisveh", "Visible Locally", "Makes your car visible to yourself, other players will still not be able to see it",
vehinvisibility g_vehinvisibility("invisveh", "VEHICLE_INVISIBILITY", "VEHICLE_INVISIBILITY_DESC", g.vehicle.vehinvisibility);
bool_command g_localveh_visibility("localinvisveh", "VEHICLE_LOCAL_VISIBLE", "VEHICLE_LOCAL_VISIBLE_DESC",
g.vehicle.localveh_visibility);
}

View File

@ -24,6 +24,6 @@ namespace big
}
};
keep_engine_running g_keep_engine_running("keepengine", "Keep Engine Running", "Keeps the engine running when you exit the vehicle",
keep_engine_running g_keep_engine_running("keepengine", "KEEP_ENGINE", "KEEP_ENGINE_DESC",
g.vehicle.keep_engine_running);
}

View File

@ -16,6 +16,6 @@ namespace big
}
};
keep_on_ground g_keep_on_ground("keeponground", "Keep On Ground", "Makes it so your vehicle is always on the ground on all four wheels",
keep_on_ground g_keep_on_ground("keeponground", "KEEP_ON_GROUND", "KEEP_ON_GROUND_DESC",
g.vehicle.keep_on_ground);
}

View File

@ -17,5 +17,5 @@ namespace big
};
keep_vehicle_clean
g_keep_vehicle_clean("keepvehicleclean", "Keep Vehicle Clean", "Keeps the vehicle clean", g.vehicle.keep_vehicle_clean);
g_keep_vehicle_clean("keepvehicleclean", "KEEP_VEHICLE_CLEAN_CMD", "KEEP_VEHICLE_CLEAN_CMD_DESC", g.vehicle.keep_vehicle_clean);
}

View File

@ -15,6 +15,6 @@ namespace big
}
};
keep_vehicle_repaired g_keep_vehicle_repaired("keepfixed", "Keep Vehicle Repaired", "Keeps your vehicle free of wear and tear",
keep_vehicle_repaired g_keep_vehicle_repaired("keepfixed", "KEEP_VEHICLE_FIXED", "KEEP_VEHICLE_FIXED_DESC",
g.vehicle.keep_vehicle_repaired);
}

View File

@ -23,5 +23,5 @@ namespace big
vehicle::disable_collisions::m_patch->restore();
}
};
veh_no_collision g_veh_no_collision("vehnocollision", "No Collision", "Same as Ped No Collision, except this is global and also affects Ped", g.vehicle.no_collision);
veh_no_collision g_veh_no_collision("vehnocollision", "NO_COLLISION_VEHICLE", "NO_COLLISION_VEHICLE_DESC", g.vehicle.no_collision);
}

View File

@ -21,5 +21,5 @@ namespace big
};
no_vehicle_water_collision
g_no_vehicle_water_collision("driveunder", "Drive Underwater", "Allows you to drive underwater", g.vehicle.no_water_collision);
g_no_vehicle_water_collision("driveunder", "NO_COLLISION_WATER", "NO_COLLISION_WATER_DESC", g.vehicle.no_water_collision);
}

View File

@ -20,6 +20,6 @@ namespace big
}
};
seatbelt g_seatbelt("seatbelt", "Seatbelt", "Prevent you from falling off bikes or flying through the windshield",
seatbelt g_seatbelt("seatbelt", "SEATBELT", "SEATBELT_DESC",
g.vehicle.seatbelt);
}

View File

@ -62,7 +62,7 @@ namespace big
};
speedo_meter
g_speedo_meter("speedometer", "Speedometer", "Enable/disable the speedo meter for vehicles.", g.vehicle.speedo_meter.enabled);
g_speedo_meter("speedometer", "SPEEDO_METER", "SPEEDO_METER_DESC", g.vehicle.speedo_meter.enabled);
bool_command g_speedo_meter_gears("speedometergears", "Show current gear", "Adds the current gear the vehicle is in to the speedo meter.",
g.vehicle.speedo_meter.show_current_gear);
bool_command g_speedo_meter_left_side("speedometerleftside", "Align to left", "Aligns the speedo meter text to the left instead of to the right.",

View File

@ -161,5 +161,5 @@ namespace big
}
};
turn_signals g_turn_signals("turnsignals", "Turn Signals", "Makes your car invisible", g.vehicle.turn_signals);
turn_signals g_turn_signals("turnsignals", "TURN_SIGNALS", "TURN_SIGNALS_DESC", g.vehicle.turn_signals);
}

View File

@ -3,6 +3,6 @@
namespace big
{
bool_command g_veh_unlimited_weapons("vehallweapons", "Allow Weapons In Vehicle", "Allows you to use all weapons in vehicle",
bool_command g_veh_unlimited_weapons("vehallweapons", "VEHICLE_ALL_WEAPONS", "VEHICLE_ALL_WEAPONS_DESC",
g.vehicle.unlimited_weapons);
}

View File

@ -134,6 +134,6 @@ namespace big
static bool true_ref = true;
vehicle_godmode_internal g_vehicle_godmode_internal("$$vehgodmode", "", "", true_ref);
bool_command g_vehicle_godmode("vehgodmode", "Vehicle God Mode", "Prevents your vehicle from taking any form of damage",
bool_command g_vehicle_godmode("vehgodmode", "VEHICLE_GOD", "VEHICLE_GOD_DESC",
g.vehicle.god_mode);
}

View File

@ -19,5 +19,5 @@ namespace big
};
vehicle_jump
g_vehicle_jump("vehjump", "Vehicle Jump", "Makes the vehicle jump when you press the handbrake", g.vehicle.vehicle_jump);
g_vehicle_jump("vehjump", "VEHICLE_JUMP", "VEHICLE_JUMP_DESC", g.vehicle.vehicle_jump);
}

View File

@ -7,9 +7,6 @@ namespace big
class reaction
{
protected:
void process_common(player_ptr player);
public:
bool announce_in_chat = false;
bool notify = true;
@ -27,5 +24,6 @@ namespace big
reaction(const char* event_name, const char* notify_message, const char* announce_message);
virtual void process(player_ptr player);
virtual void process_common(player_ptr player);
};
}

View File

@ -13,7 +13,7 @@
namespace big
{
bool_command g_orbital_drone("orbitaldrone", "Toggle Orbital Drone", "Enables/Disables the orbital drone",
bool_command g_orbital_drone("orbitaldrone", "ORBITAL_DRONE", "ORBITAL_DRONE_DESC",
g.world.orbital_drone.enabled);
static bool nav_override;

View File

@ -5,6 +5,7 @@
#include "network/ChatData.hpp"
#include "pointers.hpp"
#include "script.hpp"
#include "services/players/player_service.hpp"
#include <script/HudColor.hpp>
@ -28,6 +29,8 @@ namespace big::notify
if (g.reactions.crash.log)
LOG(WARNING) << "Blocked " << crash << " crash from " << player->get_name() << " ("
<< (player->get_net_data() ? player->get_net_data()->m_gamer_handle.m_rockstar_id : 0) << ")";
g.reactions.crash.process_common(g_player_service->get_by_id(player->m_player_id));
}
else
{

View File

@ -21,7 +21,7 @@ namespace big
void render_rid_joiner()
{
ImGui::BeginGroup();
components::sub_title("Rid joiner");
components::sub_title("RID_JOINER"_T.data());
if (ImGui::BeginListBox("##ridjoiner", get_listbox_dimensions()))
{
static uint64_t rid = 0;
@ -71,7 +71,7 @@ namespace big
components::sub_title("SESSION_SWITCHER"_T);
if (ImGui::BeginListBox("###session_switch", get_listbox_dimensions()))
{
if (ImGui::BeginCombo("##regionswitcher", "Regions"))
if (ImGui::BeginCombo("##regionswitcher", "REGIONS"_T.data()))
{
for (const auto& region_type : regions)
{
@ -100,7 +100,7 @@ namespace big
{
ImGui::BeginGroup();
components::sub_title("Misc");
components::sub_title("MISC"_T.data());
if (ImGui::BeginListBox("##miscsession", get_listbox_dimensions()))
{
ImGui::Checkbox("JOIN_IN_SCTV"_T.data(), &g.session.join_in_sctv_slots);
@ -117,24 +117,28 @@ namespace big
ImGui::BeginDisabled(!g_player_service->get_self()->is_host());
if (ImGui::Checkbox("Lobby Lock", &g.session.lock_session))
if (ImGui::Checkbox("LOBBY_LOCK"_T.data(), &g.session.lock_session))
{
ImGui::Checkbox("Allow Friends Into Locked Lobby", &g.session.allow_friends_into_locked_session);
ImGui::Checkbox("LOBBY_LOCK_ALLOW_FRIENDS"_T.data(), &g.session.allow_friends_into_locked_session);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Allows Friends to Join Lobby While Locked");
ImGui::SetTooltip("LOBBY_LOCK_ALLOW_FRIENDS_DESC"_T.data());
}
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Blocks all players from joining. May not work on some modders.");
ImGui::SetTooltip("LOBBY_LOCK_DESC"_T.data());
ImGui::EndDisabled();
components::script_patch_checkbox("REVEAL_OTR_PLAYERS"_T, &g.session.decloak_players, "Reveals players that are off the radar");
components::script_patch_checkbox("Reveal Hidden Players", &g.session.unhide_players_from_player_list, "Reveals players that have hidden themselves from the player list");
components::script_patch_checkbox("REVEAL_OTR_PLAYERS"_T,
&g.session.decloak_players,
"REVEAL_OTR_PLAYERS_DESC"_T.data());
components::script_patch_checkbox("REVEAL_HIDDEN_PLAYERS"_T,
&g.session.unhide_players_from_player_list,
"REVEAL_HIDDEN_PLAYERS_DESC"_T.data());
components::command_button<"sextall">({}, "Send Sexts");
components::command_button<"sextall">({}, "SEND_SEXT"_T.data());
ImGui::SameLine();
components::command_button<"fakebanall">({}, "Send Fake Ban Messages");
components::command_button<"fakebanall">({}, "FAKE_BAN_MESSAGE"_T.data());
ImGui::EndListBox();
}
@ -146,7 +150,7 @@ namespace big
{
ImGui::BeginGroup();
components::sub_title("Chat");
components::sub_title("CHAT"_T.data());
if (ImGui::BeginListBox("##chat", get_listbox_dimensions()))
{
static char msg[256];
@ -203,7 +207,7 @@ namespace big
{
ImGui::BeginGroup();
components::sub_title("Globals");
components::sub_title("GLOBALS"_T.data());
if (ImGui::BeginListBox("##globals", get_listbox_dimensions()))
{
static int global_wanted_level = 0;
@ -305,19 +309,19 @@ namespace big
});
}
if (ImGui::IsItemHovered())
ImGui::SetTooltip("This might break freemode missions and interiors. Use with caution");
ImGui::SetTooltip("FORCE_SCRIPT_HOST_DESC"_T.data());
ImGui::SameLine();
ImGui::Checkbox("Fast Join", &g.session.fast_join);
ImGui::Checkbox("FAST_JOIN"_T.data(), &g.session.fast_join);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("This WILL break jobs");
ImGui::SetTooltip("FAST_JOIN_DESC"_T.data());
ImGui::Spacing();
components::sub_title("Players");
components::sub_title("PLAYERS"_T.data());
components::options_modal(
"Griefing",
"GRIEFING"_T.data(),
[] {
components::command_button<"killall">({}, "KILL_ALL"_T);
ImGui::SameLine();
@ -351,23 +355,23 @@ namespace big
components::command_button<"ceoraidall">({});
ImGui::SameLine();
components::button("Trigger MC Raid", [] {
components::button("TRIGGER_MC_RAID"_T.data(), [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::BikerDefend);
});
});
ImGui::SameLine();
components::button("Trigger Bunker Raid", [] {
components::button("TRIGGER_BUNKER_RAID"_T.data(), [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::GunrunningDefend);
});
});
},
false,
"Griefing");
"GRIEFING"_T.data());
components::options_modal(
"Teleport",
"TELEPORT"_T.data(),
[] {
if (ImGui::BeginCombo("##apartment", apartment_names[g.session.send_to_apartment_idx]))
{
@ -478,23 +482,25 @@ namespace big
components::command_button<"camhedzall">();
},
true,
"Teleport");
components::command_button<"emptysession">({}, "Empty Session");
"TELEPORT"_T.data());
components::command_button<"emptysession">({}, "EMPTY_SESSION"_T.data());
components::sub_title("SCRIPT_HOST_FEATURES"_T);
ImGui::Checkbox("DISABLE_CEO_MONEY"_T.data(), &g.session.block_ceo_money);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("DISABLE_CEO_MONEY_DESC"_T.data());
ImGui::SameLine();
ImGui::Checkbox("Block Jobs", &g.session.block_jobs);
ImGui::Checkbox("BLOCK_JOBS"_T.data(), &g.session.block_jobs);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Prevents remote players from starting jobs while in your session");
ImGui::SetTooltip("BLOCK_JOBS_DESC"_T.data());
ImGui::Checkbox("RANDOMIZE_CEO_COLORS"_T.data(), &g.session.randomize_ceo_colors);
ImGui::SameLine();
components::script_patch_checkbox("Block Muggers", &g.session.block_muggers, "For the entire session");
components::script_patch_checkbox("BLOCK_MUGGERS"_T.data(), &g.session.block_muggers, "BLOCK_MUGGERS_DESC"_T.data());
components::script_patch_checkbox("Block CEO Raids", &g.session.block_ceo_raids, "For the entire session");
components::script_patch_checkbox("BLOCK_CEO_RAIDS"_T.data(),
&g.session.block_ceo_raids,
"BLOCK_CEO_RAIDS_DESC"_T.data());
ImGui::EndGroup();
}

View File

@ -24,7 +24,7 @@ namespace big
if (reaction.add_to_player_db)
ImGui::Checkbox("REACTION_BLOCK_JOINS"_T.data(), &reaction.block_joins);
ImGui::Checkbox("REACTION_KICK_PLAYER"_T.data(), &reaction.kick);
ImGui::Checkbox("Timeout", &reaction.timeout);
ImGui::Checkbox("TIMEOUT"_T.data(), &reaction.timeout);
ImGui::TreePop();
}
ImGui::PopID();