Many different fixes (#2749)

* fix(BytePatch): regression in world spawn bypass introduced in #2669
* fix(View/Network): session join options not updating after language change
* fix(RapidFire): prevent game from crashing by filling up the bullet pool
* refactor(Settings): don't save certain settings that users usually don't want to have enabled
* fix(CustomWeapons): render weapon names properly
* fix(reaction): names don't appear in chat
This commit is contained in:
Andreas Maerten
2024-02-21 23:34:11 +01:00
committed by GitHub
parent 183b0eee44
commit 0b53660312
8 changed files with 57 additions and 52 deletions

View File

@ -14,20 +14,20 @@ namespace big
struct custom_weapon
{
big::CustomWeapon id;
const std::string_view name;
const char* name;
};
const custom_weapon custom_weapons[] = {
{big::CustomWeapon::NONE, "VIEW_SELF_WEAPONS_NONE"_T},
{big::CustomWeapon::CAGE_GUN, "VIEW_SELF_WEAPONS_CAGE_GUN"_T},
{big::CustomWeapon::DELETE_GUN, "VIEW_SELF_WEAPONS_DELETE_GUN"_T},
{big::CustomWeapon::GRAVITY_GUN, "VIEW_SELF_WEAPONS_GRAVITY_GUN"_T},
{big::CustomWeapon::STEAL_VEHICLE_GUN, "BACKEND_LOOPED_WEAPONS_STEAL_VEHICLE_GUN"_T},
{big::CustomWeapon::REPAIR_GUN, "BACKEND_LOOPED_WEAPONS_REPAIR_GUN"_T},
{big::CustomWeapon::VEHICLE_GUN, "BACKEND_LOOPED_WEAPONS_VEHICLE_GUN"_T},
{big::CustomWeapon::TP_GUN, "VIEW_SELF_WEAPONS_TP_GUN"_T},
{big::CustomWeapon::PAINT_GUN, "VIEW_SELF_WEAPONS_PAINT_GUN"_T},
};
constexpr auto custom_weapons = std::to_array<custom_weapon>({
{big::CustomWeapon::NONE, "VIEW_SELF_WEAPONS_NONE"},
{big::CustomWeapon::CAGE_GUN, "VIEW_SELF_WEAPONS_CAGE_GUN"},
{big::CustomWeapon::DELETE_GUN, "VIEW_SELF_WEAPONS_DELETE_GUN"},
{big::CustomWeapon::GRAVITY_GUN, "VIEW_SELF_WEAPONS_GRAVITY_GUN"},
{big::CustomWeapon::STEAL_VEHICLE_GUN, "BACKEND_LOOPED_WEAPONS_STEAL_VEHICLE_GUN"},
{big::CustomWeapon::REPAIR_GUN, "BACKEND_LOOPED_WEAPONS_REPAIR_GUN"},
{big::CustomWeapon::VEHICLE_GUN, "BACKEND_LOOPED_WEAPONS_VEHICLE_GUN"},
{big::CustomWeapon::TP_GUN, "VIEW_SELF_WEAPONS_TP_GUN"},
{big::CustomWeapon::PAINT_GUN, "VIEW_SELF_WEAPONS_PAINT_GUN"},
});
void view::weapons()
{
@ -133,11 +133,11 @@ namespace big
ImGui::Checkbox("VIEW_WEAPON_CUSTOM_GUN_ONLY_FIRES_WHEN_THE_WEAPON_IS_OUT"_T.data(), &g.self.custom_weapon_stop);
CustomWeapon selected = g.weapons.custom_weapon;
if (ImGui::BeginCombo("WEAPON"_T.data(), custom_weapons[(int)selected].name.data()))
if (ImGui::BeginCombo("WEAPON"_T.data(), g_translation_service.get_translation(custom_weapons[(int)selected].name).data()))
{
for (const custom_weapon& weapon : custom_weapons)
{
if (ImGui::Selectable(weapon.name.data(), weapon.id == selected))
if (ImGui::Selectable(g_translation_service.get_translation(weapon.name).data(), weapon.id == selected))
{
g.weapons.custom_weapon = weapon.id;
}