cl_antiping_smooth 1
КіБ
/МіБ
(KiB
/MiB
)// chat.cpp
#include <harfbuzz/hb.h>
void CText::render_text(const char *pText, int x, int y, int w, int h, int align, int color)
{
// Create a HarfBuzz buffer
hb_buffer_t *buffer = hb_buffer_create();
hb_buffer_set_content_type(buffer, HB_BUFFER_CONTENT_TYPE_UNICODE);
hb_buffer_set_direction(buffer, HB_DIRECTION_RTL); // Set direction to RTL
hb_buffer_set_script(buffer, HB_SCRIPT_ARABIC); // Set script to Arabic
hb_buffer_set_language(buffer, hb_language_from_string("ar", -1)); // Set language to Arabic
// Add text to the buffer
hb_buffer_add_utf8(buffer, pText, strlen(pText), 0, strlen(pText));
// Shape the text using HarfBuzz
hb_font_t *font = hb_font_createFromFile("font.ttf");
hb_shape(buffer, font, NULL, 0);
// Get the shaped text
hb_glyph_info_t *glyphs;
int num_glyphs = hb_buffer_get_glyph_infos(buffer, &glyphs);
// Calculate the x position of each glyph based on the alignment
int glyph_x = x;
if (align == ALIGN_RIGHT) {
glyph_x = x + w - (num_glyphs * 10); // adjust x position for right alignment
} else if (align == ALIGN_CENTER) {
glyph_x = x + (w - (num_glyphs * 10)) / 2; // adjust x position for center alignment
}
// Render the shaped text
for (int i = 0; i < num_glyphs; i++) {
int glyph_y = y;
int glyph_w = 10; // adjust width for each glyph
int glyph_h = 10; // adjust height for each glyph
// Render the glyph using the CTexture class
CTexture *glyph_texture = CTexture::get_texture(glyphs[i].codepoint);
glyph_texture->render(glyph_x, glyph_y, glyph_w, glyph_h);
// Increment the x position for the next glyph
glyph_x += 10;
}
// Clean up
hb_buffer_destroy(buffer);
hb_font_destroy(font);
}
Maybe somthing like this// test class for
// test class for
record_points
table is filled, used, updatedui_page
via the console while the start menu is active, the browser tab was not refreshed when clicking the Play-button, leading to the old server list being shown for the new browser tab.
After starting/stopping the local server from the main menu, refresh the LAN tab on its next activation, so it immediately shows/hides the started/stopped server without needing a manual refresh.
This is not a perfect solution, as the server would not show up when activating the LAN ta...Containerfile
(Dockerfile
for docker)/profile
command and thought I might edit the record_points
table or create a different table, but then how could I test it without being able to replicate what's exactly done in the current ddnet infraapt install ddnet
which version do i get?yay ddnet-foss
xd