Skip to content

Commit

Permalink
Merge branch 'ddnet' into chillerbot
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Sep 25, 2024
2 parents 0939db3 + cc6d75d commit 97baf81
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 10 deletions.
4 changes: 2 additions & 2 deletions scripts/android/files/java/org/ddnet/client/NativeMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public void onCreate(Bundle SavedInstanceState) {
if(gfxBackend != null) {
if(gfxBackend.equals("Vulkan")) {
launchArguments = new String[] {"gfx_backend Vulkan"};
} else if(gfxBackend.equals("OpenGL")) {
launchArguments = new String[] {"gfx_backend OpenGL"};
} else if(gfxBackend.equals("GLES")) {
launchArguments = new String[] {"gfx_backend GLES"};
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/android/files/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<resources>
<string name="app_name">DDNet</string>
<string name="shortcut_play_vulkan_short">Play (Vulkan)</string>
<string name="shortcut_play_opengl_short">Play (OpenGL)</string>
<string name="shortcut_play_gles_short">Play (OpenGL ES)</string>
</resources>
6 changes: 3 additions & 3 deletions scripts/android/files/res/xml/shortcuts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
</intent>
</shortcut>
<shortcut
android:shortcutId="play-opengl"
android:shortcutId="play-gles"
android:enabled="true"
android:icon="@mipmap/ic_launcher"
android:shortcutShortLabel="@string/shortcut_play_opengl_short">
android:shortcutShortLabel="@string/shortcut_play_gles_short">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="org.ddnet.client"
android:targetClass="org.ddnet.client.NativeMain">
<extra
android:name="gfx-backend"
android:value="OpenGL" />
android:value="GLES" />
</intent>
</shortcut>
</shortcuts>
2 changes: 1 addition & 1 deletion src/engine/client/serverbrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ void CServerBrowser::UpdateFromHttp()
}
// (Also add favorites we're not allowed to ping.)
CServerEntry *pEntry = Add(pFavorites[i].m_aAddrs, pFavorites[i].m_NumAddrs);
if(pFavorites->m_AllowPing)
if(pFavorites[i].m_AllowPing)
{
QueueRequest(pEntry);
}
Expand Down
5 changes: 4 additions & 1 deletion src/engine/shared/config_variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ MACRO_CONFIG_INT(EdShowkeys, ed_showkeys, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE
MACRO_CONFIG_INT(EdAlignQuads, ed_align_quads, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Enable/disable quad alignment. When enabled, red lines appear to show how quad/points are aligned and snapped to other quads/points when moving them")
MACRO_CONFIG_INT(EdShowQuadsRect, ed_show_quads_rect, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show the bounds of the selected quad. In case of multiple quads, it shows the bounds of the englobing rect. Can be helpful when aligning a group of quads")
MACRO_CONFIG_INT(EdAutoMapReload, ed_auto_map_reload, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Run 'hot_reload' on the local server while rcon authed on map save")
MACRO_CONFIG_INT(EdLayerSelector, ed_layer_selector, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Ctrl+right click tiles to select their layers in the editor")

MACRO_CONFIG_INT(ClShowWelcome, cl_show_welcome, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show welcome message indicating the first launch of the client")
MACRO_CONFIG_INT(ClMotdTime, cl_motd_time, 10, 0, 100, CFGFLAG_CLIENT | CFGFLAG_SAVE, "How long to show the server message of the day")
Expand Down Expand Up @@ -717,7 +718,9 @@ MACRO_CONFIG_STR(Gfx3DTextureAnalysisRenderer, gfx_3d_texture_analysis_renderer,
MACRO_CONFIG_STR(Gfx3DTextureAnalysisVersion, gfx_3d_texture_analysis_version, 128, "", CFGFLAG_SAVE | CFGFLAG_CLIENT, "The version on which the analysis was performed")

MACRO_CONFIG_STR(GfxGpuName, gfx_gpu_name, 256, "auto", CFGFLAG_SAVE | CFGFLAG_CLIENT, "The GPU's name, which will be selected by the backend. (if supported by the backend)")
#if !defined(CONF_ARCH_IA32) && !defined(CONF_PLATFORM_MACOS)
#if defined(CONF_PLATFORM_ANDROID)
MACRO_CONFIG_STR(GfxBackend, gfx_backend, 256, "GLES", CFGFLAG_SAVE | CFGFLAG_CLIENT, "The backend to use (e.g. GLES or Vulkan)")
#elif !defined(CONF_ARCH_IA32) && !defined(CONF_PLATFORM_MACOS)
MACRO_CONFIG_STR(GfxBackend, gfx_backend, 256, "Vulkan", CFGFLAG_SAVE | CFGFLAG_CLIENT, "The backend to use (e.g. OpenGL or Vulkan)")
#else
MACRO_CONFIG_STR(GfxBackend, gfx_backend, 256, "OpenGL", CFGFLAG_SAVE | CFGFLAG_CLIENT, "The backend to use (e.g. OpenGL or Vulkan)")
Expand Down
9 changes: 7 additions & 2 deletions src/game/editor/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3216,7 +3216,12 @@ void CEditor::DoMapEditor(CUIRect View)
else if(m_pBrush->IsEmpty() && GetSelectedLayerType(0, LAYERTYPE_QUADS) != nullptr)
str_copy(m_aTooltip, "Use left mouse button to drag and create a brush. Hold shift to select multiple quads. Press R to rotate selected quads. Use ctrl+right mouse to select layer.");
else if(m_pBrush->IsEmpty())
str_copy(m_aTooltip, "Use left mouse button to drag and create a brush. Use ctrl+right mouse to select layer.");
{
if(g_Config.m_EdLayerSelector)
str_copy(m_aTooltip, "Use left mouse button to drag and create a brush. Use ctrl+right click to select layer for hovered tile.");
else
str_copy(m_aTooltip, "Use left mouse button to drag and create a brush.");
}
else
str_copy(m_aTooltip, "Use left mouse button to paint with the brush. Right button clears the brush.");

Expand Down Expand Up @@ -7670,7 +7675,7 @@ void CEditor::RenderMenubar(CUIRect MenuBar)
if(DoButton_Ex(&s_SettingsButton, "Settings", 0, &SettingsButton, 0, nullptr, IGraphics::CORNER_T, EditorFontSizes::MENU, TEXTALIGN_ML))
{
static SPopupMenuId s_PopupMenuEntitiesId;
Ui()->DoPopupMenu(&s_PopupMenuEntitiesId, SettingsButton.x, SettingsButton.y + SettingsButton.h - 1.0f, 200.0f, 106.0f, this, PopupMenuSettings, PopupProperties);
Ui()->DoPopupMenu(&s_PopupMenuEntitiesId, SettingsButton.x, SettingsButton.y + SettingsButton.h - 1.0f, 210.0f, 120.0f, this, PopupMenuSettings, PopupProperties);
}

CUIRect ChangedIndicator, Info, Help, Close;
Expand Down
4 changes: 4 additions & 0 deletions src/game/editor/layer_selector.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <engine/shared/config.h>

#include "editor.h"

#include "layer_selector.h"
Expand All @@ -16,6 +18,8 @@ bool CLayerSelector::SelectByTile()
return false;
if(!Input()->ModifierIsPressed() || !Ui()->MouseButtonClicked(1))
return false;
if(!g_Config.m_EdLayerSelector)
return false;

int MatchedGroup = -1;
int MatchedLayer = -1;
Expand Down
24 changes: 24 additions & 0 deletions src/game/editor/popups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,30 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuSettings(void *pContext, CUIRect
}
}

View.HSplitTop(2.0f, nullptr, &View);
View.HSplitTop(12.0f, &Slot, &View);
{
Slot.VMargin(5.0f, &Slot);

CUIRect Label, Selector;
Slot.VSplitMid(&Label, &Selector);
CUIRect No, Yes;
Selector.VSplitMid(&No, &Yes);

pEditor->Ui()->DoLabel(&Label, "Select layers by tile", 10.0f, TEXTALIGN_ML);

static int s_ButtonNo = 0;
static int s_ButtonYes = 0;
if(pEditor->DoButton_Ex(&s_ButtonNo, "No", !g_Config.m_EdLayerSelector, &No, 0, "Do not select layers when Ctrl+right clicking on a tile", IGraphics::CORNER_L))
{
g_Config.m_EdLayerSelector = false;
}
if(pEditor->DoButton_Ex(&s_ButtonYes, "Yes", g_Config.m_EdLayerSelector, &Yes, 0, "Select layers when Ctrl+right clicking on a tile", IGraphics::CORNER_R))
{
g_Config.m_EdLayerSelector = true;
}
}

return CUi::POPUP_KEEP_OPEN;
}

Expand Down

0 comments on commit 97baf81

Please sign in to comment.