File: grid_controller.cfg

package info (click to toggle)
frogatto-data 1.3.1%2Bdfsg-4
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid, trixie
  • size: 254,428 kB
  • sloc: xml: 584; python: 396; perl: 249; sh: 126; ruby: 69; makefile: 21
file content (89 lines) | stat: -rw-r--r-- 2,194 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

# Dialog controllers are generic objects designed to be used as triggers for scripts.
# Various usages include modifying:
#  - on_create to trigger something on the start of a level.
#  - on_triggered to trigger something when the player reaches a certain spot
{
id: "grid_controller",
zorder: 50,
always_active: true,
hidden_in_game: true,
//use_absolute_screen_coordinates: true,

editor_info: {
	category: "controllers",
	var: [{
			name: "max_height",
			type: "int",
			value: "200",
		},{
			name: "row_selection",
			type: "boolean",
			value: "false",
		},{
			name: "fake_width",
			type: "int",
			value: "200",
		},
	],
},

vars: {
	Widget: {
		type: "grid",
		id: "a",
		show_background: true,
		children: [[ //We want to define /some/ children by default.
				{type: 'graphical_font_label', text:'r1c1', font: 'default', size: 1},
				{type: 'graphical_font_label', text:'r1c2', font: 'default', size: 1},
				{type: 'graphical_font_label', text:'r1c3', font: 'default', size: 1},
			],[
				{type: 'graphical_font_label', text:'r2c1', font: 'default', size: 1},
				{type: 'graphical_font_label', text:'r2c2', font: 'default', size: 1},
				{type: 'graphical_font_label', text:'r2c3', font: 'default', size: 1},
			]],
		on_select: "if(	self.widgets.a.selected_row != -1
						and self.widgets.a.selected_row != self.vars.Widget.header_rows
						and (not self.widgets.a.selected_row in self.vars.Widget.header_rows), 
			fire_event('select'),
			fire_event('select_header'))",
		on_mouseover: "fire_event('mouseover')",
	},
	columns: 3,
},

on_editor_changed_variable: "fire_event('create')",

on_process: "if(level.in_editor, debug_rect(x,y,fake_width,max_height))",

on_create: "[
	set_widgets(nwgt),
	set(self.vars.Widget, nwgt),
	] where
	nwgt = self.vars.Widget
		+ if(self.vars.row_selection, {
			allow_selection: true,
			must_select: true,
			},{
			allow_selection: false,
			must_select: false,
		}) 
		+ {
			columns: self.vars.columns,
		}",

on_select: "[sound('click.wav')]",

on_end_anim: "animation('normal')",
animation: {
	id: "normal",
	image: "effects/particles.png",
	x: 86,
	y: 73,
	w: 28,
	h: 28,
	collide: [0,0,28,28],
	frames: 1,
	duration: 1000,
	},
}