+static void DrawValueField(int field, int value)
+{
+ int i = 0;
+ int screen_pos[][3] =
+ {
+ { ED_SCORE_FIELD,
+ ED_SCORE_XPOS + ED_WIN_COUNT_XPOS, ED_SCORE_YPOS },
+ { -1, 0, 0 }
+ };
+
+ while (screen_pos[i][0] != -1)
+ {
+ int x = SX + screen_pos[i][1];
+ int y = SY + screen_pos[i][2];
+
+ if (screen_pos[i++][0] != field)
+ continue;
+
+ XCopyArea(display, pix[PIX_DOOR], drawto, gc,
+ DOOR_GFX_PAGEX4 + ED_WIN_COUNT_XPOS,
+ DOOR_GFX_PAGEY1 + ED_WIN_COUNT_YPOS,
+ ED_WIN_COUNT_XSIZE, ED_WIN_COUNT_YSIZE,
+ x, y);
+
+ DrawText(x + ED_COUNT_VALUE_XOFFSET, y + ED_COUNT_VALUE_YOFFSET,
+ int2str(value, 3), FS_SMALL, FC_YELLOW);
+ }
+}
+
+static void DrawPropertiesWindow(int button)
+{
+ int x, y;
+ int new_element;
+ int num_elements_in_level;
+
+ ClearWindow();
+
+ new_element = (button == 1 ? new_element1 :
+ button == 2 ? new_element2 :
+ button == 3 ? new_element3 : 0);
+
+ DrawGraphic(1, 1, el2gfx(new_element));
+ DrawText(SX + 3*TILEX, SY + 5*TILEY/4, "Element Properties",
+ FS_SMALL, FC_YELLOW);
+
+ num_elements_in_level = 0;
+ for(y=0; y<lev_fieldy; y++)
+ for(x=0; x<lev_fieldx; x++)
+ if (Feld[x][y] == new_element)
+ num_elements_in_level++;
+
+ DrawTextF(TILEX, 5*TILEY, FC_YELLOW, "%d x contained in level",
+ num_elements_in_level);
+
+ gadget_score_value = &level.score[0];
+ DrawValueField(ED_SCORE_FIELD, *gadget_score_value);
+ MapCounterButtons(ED_CTRL_ID_SCORE_DOWN);
+}
+