#define BG_NORMAL "4.0/bg_settings_gray.#.png"
#define SHADOW_IMG "4.0/bg_settings_item_shadow.#.png"
+#define SELECTED_IMG "4.0/bg_settings_item_selected.#.png"
#define TRANSITION_FOCUS LINEAR 0.333
images {
image: BG_NORMAL COMP;
image: SHADOW_IMG COMP;
+ image: SELECTED_IMG COMP;
}
parts {
part {
- name: "area";
- type: RECT;
+ type: SPACER;
scale: 0;
description {
state: "default" 0.0;
min: 428 318;
- color: 0 0 128 128;
- align: 0.0 0.0;
}
}
part {
state: "default" 0.0;
rel1.relative: 0.0 0.0;
rel2.relative: 1.0 1.0;
- color: 255 255 255 255;
- align: 0.5 0.5;
image.normal: BG_NORMAL;
}
description {
inherit, "default" 0.0;
rel1.relative: -0.05 -0.05;
rel2.relative: 1.05 1.05;
+ }
+ description {
+ state: "invis" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 0;
+ }
+ }
+ part {
+ name: "bg_selected";
+ type: IMAGE;
+ scale: 0;
+ description {
+ state: "default" 0.0;
+ rel1.to: "bg";
+ rel2.to: "bg";
+ color: 255 255 255 0;
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 1.0;
+ image.normal: SELECTED_IMG;
+ }
+ description {
+ state: "vis" 0.0;
+ inherit: "default" 0.0;
color: 255 255 255 255;
}
}
inherit, "default" 0.0;
color, COLOR_TEXT_DISABLE;
}
+ description {
+ state: "invis" 0.0;
+ inherit: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name, "elm.text.selected";
+ type, TEXT;
+ repeat_events, 1;
+ scale: 0;
+ description {
+ state, "default" 0.0;
+ rel1.to, "bg.content";
+ rel2.to, "bg.content";
+ text {
+ font, FONT_LIGHT;
+ size, 32;
+ align, 0.5 0.5;
+ }
+ color, 255 255 255 0;
+ }
+ description {
+ state, "vis" 0.0;
+ inherit, "default" 0.0;
+ color, 255 255 255 255;
+ }
+ }
+ }
+ script
+ {
+ public is_focused;
+ public is_mousedown;
+
+ public mouse_down_anim(val, Float:pos)
+ {
+ set_tween_state(PART:"bg", pos, "focused", 0.0, "invis", 0.0);
+ set_tween_state(PART:"bg_selected", pos, "default", 0.0, "vis", 0.0);
+ set_tween_state(PART:"elm.text", pos, "focused", 0.0, "invis", 0.0);
+ set_tween_state(PART:"elm.text.selected", pos, "default", 0.0, "vis", 0.0);
+ }
+ public mouse_up_anim(val, Float:pos)
+ {
+ set_tween_state(PART:"bg", pos, "invis", 0.0, "focused", 0.0);
+ set_tween_state(PART:"bg_selected", pos, "vis", 0.0, "default", 0.0);
+ set_tween_state(PART:"elm.text", pos, "invis", 0.0, "focused", 0.0);
+ set_tween_state(PART:"elm.text.selected", pos, "vis", 0.0, "default", 0.0);
+ }
+ public focus_anim(val, Float:pos)
+ {
+ if(get_int(is_mousedown))
+ {
+ set_tween_state(PART:"bg", pos, "default", 0.0, "focused", 0.0);
+ set_tween_state(PART:"bg_selected", pos, "vis", 0.0, "default", 0.0);
+ set_tween_state(PART:"elm.text", pos, "default", 0.0, "focused", 0.0);
+ set_tween_state(PART:"elm.text.selected", pos, "vis", 0.0, "default", 0.0);
+ }
+ else
+ {
+ set_tween_state(PART:"bg", pos, "default", 0.0, "focused", 0.0);
+ set_tween_state(PART:"elm.text", pos, "default", 0.0, "focused", 0.0);
+ }
+ }
+ public unfocus_anim(val, Float:pos)
+ {
+ if(get_int(is_mousedown))
+ {
+ set_tween_state(PART:"bg", pos, "invis", 0.0, "default", 0.0);
+ set_tween_state(PART:"bg_selected", pos, "vis", 0.0, "default", 0.0);
+ set_tween_state(PART:"elm.text", pos, "invis", 0.0, "default", 0.0);
+ set_tween_state(PART:"elm.text.selected", pos, "vis", 0.0, "default", 0.0);
+ }
+ else
+ {
+ set_tween_state(PART:"bg", pos, "focused", 0.0, "default", 0.0);
+ set_tween_state(PART:"elm.text", pos, "focused", 0.0, "default", 0.0);
+ }
}
}
programs {
name, "button_clicked";
signal, "mouse,clicked,1";
source, "bg";
- action, SIGNAL_EMIT "elm,action,click" "";
+ source: "bg_selected";
+ //action, SIGNAL_EMIT "elm,action,click" "";
}
program {
name, "focused";
signal, SIG_FOCUSED;
source, "elm";
- action, STATE_SET "focused" 0.0;
- target, "bg";
- target, "elm.text";
- transition, TRANSITION_FOCUS;
+ script
+ {
+ static txt[128] = {'\0',};
+ get_text(PART:"elm.text", txt, sizeof(txt));
+ set_text(PART:"elm.text.selected", txt);
+ set_int(is_focused, 1);
+ anim(0.333, "focus_anim", 0);
+ }
+ }
+ program {
+ signal: "mouse,down,1";
+ source: "bg";
+ source: "bg_selected";
+ script
+ {
+ if(get_int(is_focused) && !get_int(is_mousedown))
+ {
+ anim(0.167, "mouse_down_anim", 0);
+ set_int(is_mousedown, 1);
+ }
+ }
+ }
+ program
+ {
+ signal: "mouse,up,1";
+ source: "bg";
+ source: "bg_selected";
+ script
+ {
+ if(get_int(is_focused) && get_int(is_mousedown))
+ {
+ anim(0.167, "mouse_up_anim", 0);
+ set_int(is_mousedown, 0);
+ }
+ }
}
program {
name, "unfocused";
signal, SIG_UNFOCUSED;
source, "elm";
- action, STATE_SET "image_change" 0.0;
- target, "bg";
- transition, TRANSITION_FOCUS;
- after: "unfocused_scale";
- }
- program {
- name, "unfocused_scale";
- action, STATE_SET "default" 0.0;
- target, "bg";
- target, "elm.text";
+ script
+ {
+ set_int(is_focused, 0);
+ anim(0.333, "unfocus_anim", 0);
+ }
}
program {
name, "disabled";
}
}
programs {
- program {
+ /*program {
name, "focused";
target, PART_MENU_VALUE;
}
program {
name, "unfocused";
target, PART_MENU_VALUE;
- }
+ }*/
program {
name, "disabled";
target, PART_MENU_VALUE;
}
}
programs {
- program {
+ /*program {
name, "focused";
target, PART_MENU_VALUE;
}
program {
name, "unfocused";
target, PART_MENU_VALUE;
- }
+ }*/
program {
name, "disabled";
target, PART_MENU_VALUE;