projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added separate network info structure for network options and setup values
[rocksndiamonds.git]
/
src
/
libgame
/
misc.c
diff --git
a/src/libgame/misc.c
b/src/libgame/misc.c
index 4a71d544c166cd0563494cc18d2d4078fbe4a385..28cc8bd5af3efdbb66387dbb11e0d14c36afeb06 100644
(file)
--- a/
src/libgame/misc.c
+++ b/
src/libgame/misc.c
@@
-1516,6
+1516,10
@@
void translate_keyname(Key *keysym, char **x11name, char **name, int mode)
char *name;
} translate_key[] =
{
char *name;
} translate_key[] =
{
+ /* return and escape keys */
+ { KSYM_Return, "XK_Return", "return" },
+ { KSYM_Escape, "XK_Escape", "escape" },
+
/* normal cursor keys */
{ KSYM_Left, "XK_Left", "cursor left" },
{ KSYM_Right, "XK_Right", "cursor right" },
/* normal cursor keys */
{ KSYM_Left, "XK_Left", "cursor left" },
{ KSYM_Right, "XK_Right", "cursor right" },
@@
-2039,6
+2043,31
@@
int get_switch3_from_string(char *s)
return result;
}
return result;
}
+int get_player_nr_from_string(char *s)
+{
+ static char *player_text[] =
+ {
+ "player_1",
+ "player_2",
+ "player_3",
+ "player_4",
+
+ NULL
+ };
+
+ char *s_lower = getStringToLower(s);
+ int result = 0;
+ int i;
+
+ for (i = 0; player_text[i] != NULL; i++)
+ if (strEqual(s_lower, player_text[i]))
+ result = i;
+
+ free(s_lower);
+
+ return result;
+}
+
/* ------------------------------------------------------------------------- */
/* functions for generic lists */
/* ------------------------------------------------------------------------- */
/* functions for generic lists */
@@
-2819,6
+2848,14
@@
int get_anim_action_parameter_value(char *token)
checked_free(gfx_token);
}
checked_free(gfx_token);
}
+ if (result == -1)
+ {
+ Key key = getKeyFromX11KeyName(token);
+
+ if (key != KSYM_UNDEFINED)
+ result = -(int)key;
+ }
+
if (result == -1)
result = ANIM_EVENT_ACTION_NONE;
if (result == -1)
result = ANIM_EVENT_ACTION_NONE;
@@
-2909,7
+2946,7
@@
int get_parameter_value(char *value_raw, char *suffix, int type)
else if (strEqual(suffix, ".init_event_action") ||
strEqual(suffix, ".anim_event_action"))
{
else if (strEqual(suffix, ".init_event_action") ||
strEqual(suffix, ".anim_event_action"))
{
- result = get_anim_action_parameter_value(value);
+ result = get_anim_action_parameter_value(value
_raw
);
}
else if (strEqual(suffix, ".class"))
{
}
else if (strEqual(suffix, ".class"))
{
@@
-2931,6
+2968,9
@@
int get_parameter_value(char *value_raw, char *suffix, int type)
if (string_has_parameter(value, "passthrough_clicks"))
result |= STYLE_PASSTHROUGH;
if (string_has_parameter(value, "passthrough_clicks"))
result |= STYLE_PASSTHROUGH;
+
+ if (string_has_parameter(value, "multiple_actions"))
+ result |= STYLE_MULTIPLE_ACTIONS;
}
else if (strEqual(suffix, ".fade_mode"))
{
}
else if (strEqual(suffix, ".fade_mode"))
{