about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--apworld/client/player.gd13
1 files changed, 12 insertions, 1 deletions
diff --git a/apworld/client/player.gd b/apworld/client/player.gd index 43bf758..3858e53 100644 --- a/apworld/client/player.gd +++ b/apworld/client/player.gd
@@ -78,6 +78,7 @@ func _ready():
78 # Add the gift map entry panel if needed. 78 # Add the gift map entry panel if needed.
79 if not ap.enable_gift_maps.is_empty(): 79 if not ap.enable_gift_maps.is_empty():
80 var panel_prefab = preload("res://objects/nodes/panel.tscn") 80 var panel_prefab = preload("res://objects/nodes/panel.tscn")
81 var tpl_prefab = preload("res://objects/nodes/listeners/teleportListener.tscn")
81 var wpl_prefab = preload("res://objects/nodes/listeners/worldportListener.tscn") 82 var wpl_prefab = preload("res://objects/nodes/listeners/worldportListener.tscn")
82 83
83 var giftmap_parent = Node.new() 84 var giftmap_parent = Node.new()
@@ -93,7 +94,7 @@ func _ready():
93 94
94 var giftmap_panel = panel_prefab.instantiate() 95 var giftmap_panel = panel_prefab.instantiate()
95 giftmap_panel.name = "Panel" 96 giftmap_panel.name = "Panel"
96 giftmap_panel.position = Vector3(33.5, 1, 5.5) 97 giftmap_panel.position = Vector3(33.5, -190, 5.5)
97 giftmap_panel.rotation_degrees = Vector3(-45, 0, 0) 98 giftmap_panel.rotation_degrees = Vector3(-45, 0, 0)
98 giftmap_panel.clue = "player" 99 giftmap_panel.clue = "player"
99 giftmap_panel.answer = symbolless_player 100 giftmap_panel.answer = symbolless_player
@@ -114,6 +115,16 @@ func _ready():
114 115
115 giftmap_parent.add_child.call_deferred(giftmap_panel) 116 giftmap_parent.add_child.call_deferred(giftmap_panel)
116 117
118 var giftmap_tpl = tpl_prefab.instantiate()
119 giftmap_tpl.name = "PanelTeleporter"
120 giftmap_tpl.teleport_point = Vector3(33.5, 1, 5.5)
121 giftmap_tpl.teleport_rotate = Vector3(-45, 0, 0)
122 giftmap_tpl.target_path = giftmap_panel
123 giftmap_tpl.senders.append(
124 NodePath("/root/scene/Components/Listeners/unlockReaderListenerDoubles")
125 )
126 giftmap_parent.add_child.call_deferred(giftmap_tpl)
127
117 # Add the strict purple ending validation. 128 # Add the strict purple ending validation.
118 if global.map == "the_sun_temple" and ap.strict_purple_ending: 129 if global.map == "the_sun_temple" and ap.strict_purple_ending:
119 var panel_prefab = preload("res://objects/nodes/panel.tscn") 130 var panel_prefab = preload("res://objects/nodes/panel.tscn")
* copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ /* * Idea of subclassing NSOpenGLView was taken from "TextureUpload" Apple's sample */ // Only compile this code on Mac. These files should not be included on your iOS project. // But in case they are included, it won't be compiled. #import <Availability.h> #ifdef __IPHONE_OS_VERSION_MAX_ALLOWED #elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED) #import "MacGLView.h" #import <OpenGL/gl.h> #import "CCDirectorMac.h" #import "../../ccConfig.h" @implementation MacGLView @synthesize eventDelegate = eventDelegate_; +(void) load_ { NSLog(@"%@ loaded", self); } - (id) initWithFrame:(NSRect)frameRect { self = [self initWithFrame:frameRect shareContext:nil]; return self; } - (id) initWithFrame:(NSRect)frameRect shareContext:(NSOpenGLContext*)context { NSOpenGLPixelFormatAttribute attribs[] = { NSOpenGLPFAAccelerated, NSOpenGLPFANoRecovery, NSOpenGLPFADoubleBuffer, NSOpenGLPFADepthSize, 24, 0 }; NSOpenGLPixelFormat *pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs]; if (!pixelFormat) NSLog(@"No OpenGL pixel format"); if( (self = [super initWithFrame:frameRect pixelFormat:[pixelFormat autorelease]]) ) { if( context ) [self setOpenGLContext:context]; // Synchronize buffer swaps with vertical refresh rate GLint swapInt = 1; [[self openGLContext] setValues:&swapInt forParameter:NSOpenGLCPSwapInterval]; // GLint order = -1; // [[self openGLContext] setValues:&order forParameter:NSOpenGLCPSurfaceOrder]; // event delegate eventDelegate_ = nil; } return self; } - (void) reshape { // We draw on a secondary thread through the display link // When resizing the view, -reshape is called automatically on the main thread // Add a mutex around to avoid the threads accessing the context simultaneously when resizing CGLLockContext([[self openGLContext] CGLContextObj]); NSRect rect = [self bounds]; CCDirector *director = [CCDirector sharedDirector]; [director reshapeProjection: NSSizeToCGSize(rect.size) ]; // avoid flicker [director drawScene]; // [self setNeedsDisplay:YES]; CGLUnlockContext([[self openGLContext] CGLContextObj]); } - (void) dealloc { [super dealloc]; } #if CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD #define DISPATCH_EVENT(__event__, __selector__) [eventDelegate_ queueEvent:__event__ selector:__selector__]; #else #define DISPATCH_EVENT(__event__, __selector__) \ id obj = eventDelegate_; \ [obj performSelector:__selector__ \ onThread:[(CCDirectorMac*)[CCDirector sharedDirector] runningThread] \ withObject:__event__ \ waitUntilDone:NO]; #endif #pragma mark MacGLView - Mouse events - (void)mouseDown:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } - (void)mouseMoved:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } - (void)mouseDragged:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } - (void)mouseUp:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } - (void)rightMouseDown:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } - (void)rightMouseDragged:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } - (void)rightMouseUp:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } - (void)otherMouseDown:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } - (void)otherMouseDragged:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } - (void)otherMouseUp:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } - (void)mouseEntered:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } - (void)mouseExited:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } -(void) scrollWheel:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } #pragma mark MacGLView - Key events -(BOOL) becomeFirstResponder { return YES; } -(BOOL) acceptsFirstResponder { return YES; } -(BOOL) resignFirstResponder { return YES; } - (void)keyDown:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } - (void)keyUp:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } - (void)flagsChanged:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } #pragma mark MacGLView - Touch events - (void)touchesBeganWithEvent:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } - (void)touchesMovedWithEvent:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } - (void)touchesEndedWithEvent:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } - (void)touchesCancelledWithEvent:(NSEvent *)theEvent { DISPATCH_EVENT(theEvent, _cmd); } @end #endif // __MAC_OS_X_VERSION_MAX_ALLOWED