1
1
#include " SocialStatus.as" ;
2
+ #include " BindingsCommon.as" ;
2
3
3
4
const string editor_place = " editor place" ;
4
5
const string editor_destroy = " editor destroy" ;
@@ -37,23 +38,24 @@ void onTick(CRules@ this)
37
38
if (controls.isKeyJustPressed(KEY_RCONTROL )) {
38
39
p.set_bool(" editor_cursor" , ! p.get_bool(" editor_cursor" ));
39
40
}
41
+
40
42
// changing mode BLOBS/TILES
41
- if (controls.isKeyPressed( KEY_LMENU ) && controls.isKeyJustPressed( KEY_KEY_1 )) {
43
+ if (b_KeyJustPressed( " ed_mode " )) {
42
44
CBitStream params ;
43
45
params.write_u16(p.getNetworkID());
44
46
this .SendCommand(this .getCommandID(change_mode), params);
45
47
}
46
48
47
- if (! controls.isKeyPressed( KEY_MBUTTON )) return ;
49
+ if (! b_KeyPressed( " ed_modifier " )) return ;
48
50
// placing/destroing by single item
49
- if (controls.isKeyPressed( KEY_LSHIFT )) {
50
- if (controls.isKeyJustPressed( KEY_KEY_X )) {
51
+ if (b_KeyPressed( " ed_once_action " )) {
52
+ if (b_KeyJustPressed( " ed_placing " )) {
51
53
CBitStream params ;
52
54
params.write_u16(p.getNetworkID());
53
55
params.write_Vec2f(controls.getMouseWorldPos());
54
56
this .SendCommand(this .getCommandID(editor_place), params);
55
57
}
56
- if (controls.isKeyJustPressed( KEY_KEY_Z )) {
58
+ if (b_KeyJustPressed( " ed_destroying " )) {
57
59
CBitStream params ;
58
60
params.write_u16(p.getNetworkID());
59
61
params.write_Vec2f(controls.getMouseWorldPos());
@@ -62,20 +64,20 @@ void onTick(CRules@ this)
62
64
}
63
65
// placing/destroying continuously
64
66
else {
65
- if (controls.isKeyPressed( KEY_KEY_X )) {
67
+ if (b_KeyPressed( " ed_placing " )) {
66
68
CBitStream params ;
67
69
params.write_u16(p.getNetworkID());
68
70
params.write_Vec2f(controls.getMouseWorldPos());
69
71
this .SendCommand(this .getCommandID(editor_place), params);
70
72
}
71
- if (controls.isKeyPressed( KEY_KEY_Z )) {
73
+ if (b_KeyPressed( " ed_destroying " )) {
72
74
CBitStream params ;
73
75
params.write_u16(p.getNetworkID());
74
76
params.write_Vec2f(controls.getMouseWorldPos());
75
77
this .SendCommand(this .getCommandID(editor_destroy), params);
76
78
}
77
79
}
78
- if (controls.isKeyJustPressed( KEY_KEY_B )) {
80
+ if (b_KeyJustPressed( " ed_copy " )) {
79
81
CBitStream params ;
80
82
params.write_u16(p.getNetworkID());
81
83
params.write_Vec2f(controls.getMouseWorldPos());
0 commit comments