mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 11:39:19 +02:00
reformat: remove redundant parentheses
This commit is contained in:
@@ -35,9 +35,9 @@ void launcher_mode::exit()
|
||||
void launcher_mode::on_key(const int Key, const int Scancode, const int Action, const int Mods)
|
||||
{
|
||||
#ifndef __unix__
|
||||
Global.shiftState = (Mods & GLFW_MOD_SHIFT) ? true : false;
|
||||
Global.ctrlState = (Mods & GLFW_MOD_CONTROL) ? true : false;
|
||||
Global.altState = (Mods & GLFW_MOD_ALT) ? true : false;
|
||||
Global.shiftState = Mods & GLFW_MOD_SHIFT ? true : false;
|
||||
Global.ctrlState = Mods & GLFW_MOD_CONTROL ? true : false;
|
||||
Global.altState = Mods & GLFW_MOD_ALT ? true : false;
|
||||
#endif
|
||||
m_userinterface->on_key(Key, Action);
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ void ui::scenerylist_panel::draw_trainset(trainset_desc &trainset)
|
||||
glm::ivec2 size = mini->size();
|
||||
float width = 30.0f / size.y * size.x;
|
||||
float beforeX = ImGui::GetCursorPosX();
|
||||
ImGui::Image((ImTextureID)(intptr_t)(mini->get()), ImVec2(width, 30), ImVec2(0, 1), ImVec2(1, 0));
|
||||
ImGui::Image((ImTextureID)(intptr_t)mini->get(), ImVec2(width, 30), ImVec2(0, 1), ImVec2(1, 0));
|
||||
float afterX = ImGui::GetCursorPosX();
|
||||
|
||||
ImGui::SameLine(beforeX);
|
||||
@@ -338,7 +338,7 @@ void ui::scenerylist_panel::draw_droptarget(trainset_desc &trainset, int positio
|
||||
if (ImGui::BeginDragDropTarget()) {
|
||||
const ImGuiPayload *payload = ImGui::AcceptDragDropPayload("vehicle_pure");
|
||||
if (payload) {
|
||||
skin_set *ptr = *(reinterpret_cast<skin_set**>(payload->Data));
|
||||
skin_set *ptr = *reinterpret_cast<skin_set **>(payload->Data);
|
||||
std::shared_ptr<skin_set> skin;
|
||||
for (auto &s : ptr->vehicle.lock()->matching_skinsets)
|
||||
if (s.get() == ptr)
|
||||
@@ -406,7 +406,7 @@ void ui::dynamic_edit_popup::render_content()
|
||||
if (ImGui::BeginCombo(STR_C("Skin"), dynamic.skin->skin.c_str(), ImGuiComboFlags_HeightLargest))
|
||||
{
|
||||
for (auto const &skin : dynamic.vehicle->matching_skinsets) {
|
||||
bool is_selected = (skin == dynamic.skin);
|
||||
bool is_selected = skin == dynamic.skin;
|
||||
if (ImGui::Selectable(skin->skin.c_str(), is_selected))
|
||||
dynamic.skin = skin;
|
||||
if (is_selected)
|
||||
@@ -419,7 +419,7 @@ void ui::dynamic_edit_popup::render_content()
|
||||
if (ImGui::BeginCombo(STR_C("Occupancy"), Translations.lookup_c(dynamic.drivertype.c_str())))
|
||||
{
|
||||
for (auto const &str : occupancy_names) {
|
||||
bool is_selected = (str == dynamic.drivertype);
|
||||
bool is_selected = str == dynamic.drivertype;
|
||||
if (ImGui::Selectable(Translations.lookup_c(str.c_str()), is_selected))
|
||||
dynamic.drivertype = str;
|
||||
if (is_selected)
|
||||
|
||||
@@ -13,7 +13,7 @@ void scenery_scanner::scan()
|
||||
for (auto &f : std::filesystem::directory_iterator("scenery")) {
|
||||
std::filesystem::path path(std::filesystem::relative(f.path(), "scenery/"));
|
||||
|
||||
if (*(path.filename().string().begin()) == '$')
|
||||
if (*path.filename().string().begin() == '$')
|
||||
continue;
|
||||
|
||||
if (path.string().ends_with(".scn"))
|
||||
|
||||
@@ -101,7 +101,7 @@ void ui::vehicles_bank::parse_category_entry(const std::string ¶m)
|
||||
void ui::vehicles_bank::parse_controllable_entry(const std::string &target, const std::string ¶m)
|
||||
{
|
||||
get_vehicle(target)->controllable =
|
||||
(param.size() >= 1 && param[0] == '1');
|
||||
param.size() >= 1 && param[0] == '1';
|
||||
}
|
||||
|
||||
void ui::vehicles_bank::parse_texture_info(const std::string &target, const std::string ¶m, std::shared_ptr<skin_meta> meta)
|
||||
|
||||
@@ -47,15 +47,15 @@ void ui::vehiclepicker_panel::render_contents()
|
||||
|
||||
bool model_added = false;
|
||||
bool can_break = false;
|
||||
bool map_sel_eq = (selected_group && group == *selected_group);
|
||||
bool map_sel_eq = selected_group && group == *selected_group;
|
||||
|
||||
for (auto const &vehicle : kv.second) {
|
||||
if (vehicle->type != selected_type)
|
||||
continue;
|
||||
|
||||
for (auto const &skinset : vehicle->matching_skinsets) {
|
||||
bool map_group_eq = (skinset->group == group);
|
||||
bool sel_group_eq = (selected_group && skinset->group == *selected_group);
|
||||
bool map_group_eq = skinset->group == group;
|
||||
bool sel_group_eq = selected_group && skinset->group == *selected_group;
|
||||
|
||||
if (!model_added && map_group_eq) {
|
||||
model_list.push_back(&group);
|
||||
@@ -253,7 +253,7 @@ bool ui::vehiclepicker_panel::skin_filter(const skin_set *skin, std::vector<sear
|
||||
return true;
|
||||
}
|
||||
|
||||
return alternative_present ? (!any) : false;
|
||||
return alternative_present ? !any : false;
|
||||
}
|
||||
|
||||
bool ui::vehiclepicker_panel::selectable_image(const char *desc, bool selected, const deferred_image* image, const skin_set *pickable)
|
||||
|
||||
Reference in New Issue
Block a user