#define INFOTEXT_UNKNOWN_ELEMENT "unknown"
-/*
- -----------------------------------------------------------------------------
- screen and artwork graphic pixel position definitions
- -----------------------------------------------------------------------------
-*/
+// ----------------------------------------------------------------------------
+// screen and artwork graphic pixel position definitions
+// ----------------------------------------------------------------------------
// values for the control window
#define ED_CTRL1_BUTTONS_HORIZ 4 // toolbox
SYSIZE - INFOTEXT_YSIZE)
-/*
- -----------------------------------------------------------------------------
- editor gadget definitions
- -----------------------------------------------------------------------------
-*/
+// ----------------------------------------------------------------------------
+// editor gadget definitions
+// ----------------------------------------------------------------------------
enum
{
GADGET_ID_RANDOM_BALL_CONTENT,
GADGET_ID_INITIAL_BALL_STATE,
GADGET_ID_GROW_INTO_DIGGABLE,
+ GADGET_ID_SB_FIELDS_NEEDED,
+ GADGET_ID_SB_OBJECTS_NEEDED,
GADGET_ID_AUTO_EXIT_SOKOBAN,
GADGET_ID_SOLVED_BY_ONE_PLAYER,
GADGET_ID_CONTINUOUS_SNAPPING,
ED_CHECKBUTTON_ID_RANDOM_BALL_CONTENT,
ED_CHECKBUTTON_ID_INITIAL_BALL_STATE,
ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE,
+ ED_CHECKBUTTON_ID_SB_FIELDS_NEEDED,
+ ED_CHECKBUTTON_ID_SB_OBJECTS_NEEDED,
ED_CHECKBUTTON_ID_AUTO_EXIT_SOKOBAN,
ED_CHECKBUTTON_ID_SOLVED_BY_ONE_PLAYER,
ED_CHECKBUTTON_ID_CONTINUOUS_SNAPPING,
#define ED_DRAWING_ID_EDITOR_LAST ED_DRAWING_ID_RANDOM_BACKGROUND
-/*
- -----------------------------------------------------------------------------
- some internally used definitions
- -----------------------------------------------------------------------------
-*/
+// ----------------------------------------------------------------------------
+// some internally used definitions
+// ----------------------------------------------------------------------------
// values for CopyLevelToUndoBuffer()
#define UNDO_IMMEDIATE 0
#define DEFAULT_EDITOR_TILESIZE_MM TILESIZE
-/*
- -----------------------------------------------------------------------------
- some internally used data structure definitions
- -----------------------------------------------------------------------------
-*/
+// ----------------------------------------------------------------------------
+// some internally used data structure definitions
+// ----------------------------------------------------------------------------
static struct
{
char shortcut;
} controlbutton_info[ED_NUM_CTRL_BUTTONS] =
{
- /* note: some additional characters are already reserved for "cheat mode"
- shortcuts (":XYZ" style) -- for details, see "events.c" */
+ // note: some additional characters are already reserved for "cheat mode"
+ // shortcuts (":XYZ" style) -- for details, see "events.c"
// ---------- toolbox control buttons ---------------------------------------
},
{
ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(0),
+ GADGET_ID_SB_FIELDS_NEEDED, GADGET_ID_NONE,
+ &level.sb_fields_needed,
+ NULL, NULL,
+ "all fields need to be filled", "require all SB fields to be solved"
+ },
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(0),
+ GADGET_ID_SB_OBJECTS_NEEDED, GADGET_ID_NONE,
+ &level.sb_objects_needed,
+ NULL, NULL,
+ "all objects need to be placed", "require all SB objects to be solved"
+ },
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1),
GADGET_ID_AUTO_EXIT_SOKOBAN, GADGET_ID_NONE,
&level.auto_exit_sokoban,
NULL, NULL,
- "exit level if all fields solved", "automatically finish Sokoban levels"
+ "exit level if all tasks solved", "automatically finish Sokoban levels"
},
{
ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(14),
};
-/*
- -----------------------------------------------------------------------------
- some internally used variables
- -----------------------------------------------------------------------------
-*/
+// ----------------------------------------------------------------------------
+// some internally used variables
+// ----------------------------------------------------------------------------
// maximal size of level editor drawing area
static int MAX_ED_FIELDX, MAX_ED_FIELDY;
};
-/*
- -----------------------------------------------------------------------------
- functions
- -----------------------------------------------------------------------------
-*/
+// ----------------------------------------------------------------------------
+// functions
+// ----------------------------------------------------------------------------
static int getMaxInfoTextLength(void)
{
if (selectbox_info[i].size == -1) // dynamically determine size
{
- /* (we cannot use -1 for uninitialized values if we directly compare
- with results from strlen(), because the '<' and '>' operation will
- implicitely cast -1 to an unsigned integer value!) */
+ // (we cannot use -1 for uninitialized values if we directly compare
+ // with results from strlen(), because the '<' and '>' operation will
+ // implicitely cast -1 to an unsigned integer value!)
selectbox_info[i].size = 0;
for (j = 0; selectbox_info[i].options[j].text != NULL; j++)
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE);
}
+ if (properties_element == EL_SOKOBAN_FIELD_EMPTY)
+ MapCheckbuttonGadget(ED_CHECKBUTTON_ID_SB_FIELDS_NEEDED);
+
+ if (properties_element == EL_SOKOBAN_OBJECT)
+ MapCheckbuttonGadget(ED_CHECKBUTTON_ID_SB_OBJECTS_NEEDED);
+
if (properties_element == EL_SOKOBAN_OBJECT ||
properties_element == EL_SOKOBAN_FIELD_EMPTY ||
properties_element == EL_SOKOBAN_FIELD_FULL)
+ {
+ checkbutton_info[ED_CHECKBUTTON_ID_AUTO_EXIT_SOKOBAN].y =
+ ED_ELEMENT_SETTINGS_XPOS(properties_element == EL_SOKOBAN_FIELD_FULL ?
+ 0 : 1);
+
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_AUTO_EXIT_SOKOBAN);
+ }
if (IS_BALLOON_ELEMENT(properties_element))
MapSelectboxGadget(ED_SELECTBOX_ID_WIND_DIRECTION);
radius = (int)(sqrt((float)(len_x * len_x + len_y * len_y)) + 0.5);
- /* not optimal (some points get drawn twice) but simple,
- and fast enough for the few points we are drawing */
+ // not optimal (some points get drawn twice) but simple,
+ // and fast enough for the few points we are drawing
for (x = 0; x <= radius; x++)
{
case GADGET_ID_SAVE:
{
- /* saving read-only levels into personal level set modifies global vars
- "leveldir_current" and "level_nr"; restore them after saving level */
+ // saving read-only levels into personal level set modifies global vars
+ // "leveldir_current" and "level_nr"; restore them after saving level
LevelDirTree *leveldir_former = leveldir_current;
int level_nr_former = level_nr;
char *level_filename;