{
int font_height = getFontHeight(font_nr);
int pad_x = ED_SETTINGS_XPOS(0);
- int pad_y = ED_SETTINGS_YPOS(0);
+ int pad_y = ED_SETTINGS_YPOS(0) + ED_BORDER_SIZE;
int sx = SX + pad_x;
int sy = SY + pad_y;
int max_lines_per_screen = (SYSIZE - pad_y) / font_height - 1;
int gd_y = gd->y + gd_gi->height - 1;
Pixel tab_color = GetPixel(gd->bitmap, gd_x, gd_y);
int id_first = ED_TEXTBUTTON_ID_PROPERTIES_INFO;
+#if 1
+ int id_last = ED_TEXTBUTTON_ID_PROPERTIES_CONFIG;
+#else
int id_last = ED_TEXTBUTTON_ID_PROPERTIES_INFO;
+#endif
int i;
+#if 0
/* draw additional "configure" tabulator for configurable elements */
if (checkPropertiesConfig())
id_last = ED_TEXTBUTTON_ID_PROPERTIES_CONFIG;
+#endif
/* draw additional "advanced" tabulator for custom elements */
if (IS_CUSTOM_ELEMENT(properties_element))
int font1_width = getFontWidth(font1_nr);
int font2_height = getFontHeight(font2_nr);
int pad_x = ED_SETTINGS_XPOS(0);
- int pad_y = ED_SETTINGS_YPOS(0);
+ int pad_y = ED_SETTINGS_YPOS(0) + ED_BORDER_SIZE;
int screen_line = 0;
int i, x, y;
{
int i;
+ if (!checkPropertiesConfig())
+ {
+ PrintInfoText("No configuration options available.", FONT_TEXT_1, 0);
+
+ return;
+ }
+
/* check if there are elements where a score can be chosen for */
for (i=0; elements_with_counter[i].element != -1; i++)
{
DrawCustomChangedArea();
}
+static void DrawElementName(int x, int y, int element)
+{
+ char *element_name = getElementInfoText(element);
+ int font_nr = FONT_TEXT_1;
+ int font_width = getFontWidth(font_nr);
+ int font_height = getFontHeight(font_nr);
+ int max_text_width = SXSIZE - x - ED_SETTINGS_XPOS(0);
+ int max_chars_per_line = max_text_width / font_width;
+ char buffer[max_chars_per_line + 1];
+
+ if (strlen(element_name) <= max_chars_per_line)
+ DrawTextF(x, y, font_nr, element_name);
+ else
+ {
+ int next_pos = max_chars_per_line;
+
+ strncpy(buffer, element_name, max_chars_per_line);
+ buffer[max_chars_per_line] = '\0';
+
+ if (element_name[max_chars_per_line] == ' ')
+ next_pos++;
+ else
+ {
+ int i;
+
+ for (i = max_chars_per_line - 1; i >= 0; i--)
+ if (buffer[i] == ' ')
+ break;
+
+ if (strlen(&element_name[i + 1]) <= max_chars_per_line)
+ {
+ buffer[i] = '\0';
+ next_pos = i + 1;
+ }
+ }
+
+ DrawTextF(x, y - font_height / 2, font_nr, buffer);
+
+ strncpy(buffer, &element_name[next_pos], max_chars_per_line);
+ buffer[max_chars_per_line] = '\0';
+
+ DrawTextF(x, y + font_height / 2, font_nr, buffer);
+ }
+}
+
static void DrawPropertiesWindow()
{
int xstart = 2;
!IS_CUSTOM_ELEMENT(properties_element))
edit_mode_properties = ED_MODE_PROPERTIES_CONFIG;
+#if 0
if (edit_mode_properties == ED_MODE_PROPERTIES_CONFIG &&
!checkPropertiesConfig())
edit_mode_properties = ED_MODE_PROPERTIES_INFO;
+#endif
if (IS_CUSTOM_ELEMENT(properties_element))
CopyCustomElementPropertiesToEditor(properties_element);
FrameCounter = 0; /* restart animation frame counter */
- DrawTextF((xstart + 3) * MINI_TILEX, (ystart + 1) * MINI_TILEY,
- FONT_TEXT_1, getElementInfoText(properties_element));
+ DrawElementName((xstart + 3) * MINI_TILEX, (ystart + 1) * MINI_TILEY,
+ properties_element);
DrawPropertiesTabulatorGadgets();