/*
* NMPanelMenu.m
* shapes
*
* Created by Nate Murray on 7/29/10.
* Copyright 2010 YetiApps. All rights reserved.
*
*/
#import "NMPanelMenu.h"
@implementation NMPanelMenu
-(CCMenuItem *) itemForTouch: (UITouch *) touch
{
CGPoint touchLocation = [touch locationInView: [[touch view] superview]];
touchLocation = [[CCDirector sharedDirector] convertToGL: touchLocation];
CCMenuItem* item;
CCARRAY_FOREACH(children_, item){
// ignore invisible and disabled items: issue #779, #866
if ( [item visible] && [item isEnabled] ) {
CGPoint local = [item convertToNodeSpace:touchLocation];
CGRect r = [item rect];
r.origin = CGPointZero;
if( CGRectContainsPoint( r, local ) ) {
return item;
}
}
}
return nil;
}
@end
hange='this.form.submit();'>
blob: 3c037ff296a5320eda94f6907e8e49b4bc9f940a (
plain) (
blame)
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
|
extends "res://scripts/nodes/keyHolder.gd"
func setFromAp(key, level):
if level > 0:
has_key = true
is_complete = "%s%d" % [key, level]
held_key = key
held_level = level
get_node("Hinge/Letter").mesh.text = held_key
get_node("Hinge/Letter2").mesh.text = held_key
setMaterial()
emit_signal("trigger")
else:
has_key = false
held_key = ""
held_level = 0
setMaterial()
get_node("Hinge/Letter").mesh.text = "-"
get_node("Hinge/Letter2").mesh.text = "-"
is_complete = ""
emit_signal("untrigger")
func addKey(key):
var node_path = String(
get_tree().get_root().get_node("scene").get_path_to(self).get_concatenated_names()
)
var ap = global.get_node("Archipelago")
ap.keyboard.put_in_keyholder(key, global.map, node_path)
func removeKey():
var node_path = String(
get_tree().get_root().get_node("scene").get_path_to(self).get_concatenated_names()
)
var ap = global.get_node("Archipelago")
ap.keyboard.remove_from_keyholder(held_key, global.map, node_path)
|