Skip to content

Commit

Permalink
Add no signal 2025-02-06 notes
Browse files Browse the repository at this point in the history
  • Loading branch information
exodrifter committed Feb 7, 2025
1 parent aa68296 commit e96f4be
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 0 deletions.
44 changes: 44 additions & 0 deletions content/entries/20250206170706.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
created: 2025-02-06T17:07:06Z
---

_no signal_ stream 171:
- Copied TODOs from [20250202182941](20250202182941.md)
- Ran into a weird `Window` focus issue [20250206191936](20250206191936.md)

Tanuki:
- [ ] Add audio-locked box
- [ ] Articulate piano keys
- [ ] Decorate music room
- [ ] Separate toilet lever so it can be animated in Godot
- [ ] Fix Rubix cube UVs
- [ ] Make Naoko's charm model

TODO:
- [ ] Add previews to audio settings
- [ ] [#44](https://gitea.arcturuscollective.com/exodrifter/lost-contact/issues/44) Controller support
- [ ] Sometimes the anchor point is wrong when you select an item, not sure how to reproduce.

Part One:
- [x] Add a map button
- [ ] Zoom in and out on cursor position in map
- [ ] Show current position on map
- [ ] Add buttons for zooming in and out
- [ ] Add button for resetting view
- [ ] Remember map position in save

Part Two:
- [ ] Add poem song puzzle to music room
- [ ] Make toilets flushable
- [ ] Implement Rubix cube

Part Three:
- [ ] Delete all items when transitioning to part three
- [ ] Add footstep sounds
- [ ] Add breathing sounds
- [ ] Add dialog to energy lab
- [ ] Add dialog to radio lab
- [ ] Add fuse, eva, and card writer
- [ ] Add ftl ship puzzle
- [ ] Add final cinematic
- [ ] Add free text dialog system
42 changes: 42 additions & 0 deletions content/entries/20250206191936.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
created: 2025-02-06T19:19:36Z
---

In _no signal_ I'm trying to add a new embedded window, for a total of two embedded windows: the notes window and the map window. I want the user to be able to show and hide these windows, but for some reason when I make a window visible and tell it to grab focus, the other window does not update its visual appearance to show that it is unfocused:

```gdscript
func _on_notes_button_pressed() -> void:
notes_ui.visible = not notes_ui.visible
if notes_ui.visible:
notes_ui.grab_focus()
func _on_map_button_pressed() -> void:
map_ui.visible = not map_ui.visible
if map_ui.visible:
map_ui.grab_focus()
```

I wasn't able to find a way to explicitly drop focus or find out why the other window was not dropping focus, so I worked around it by grabbing the focus of all of the other windows before grabbing the focus of the window I wanted to focus:

```gdscript
func _on_notes_button_pressed() -> void:
notes_ui.visible = not notes_ui.visible
if notes_ui.visible:
focus_window(notes_ui)
func _on_map_button_pressed() -> void:
map_ui.visible = not map_ui.visible
if map_ui.visible:
focus_window(map_ui)
func focus_window(window_to_focus: Window) -> void:
# For some reason, focus isn't dropped when we focus the new window and
# there's no function to explicitly drop focus. So, to work around this
# we focus the window we want to unfocus right before we focus the
# window we want to focus
for window: Window in get_viewport().get_embedded_subwindows():
if window != window_to_focus:
window.grab_focus()
window_to_focus.grab_focus()
```
37 changes: 37 additions & 0 deletions content/notes/godot-window-does-not-lose-focus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "Godot `Window` does not lose focus"
created: 2025-02-06T19:28:51Z
aliases:
- "Godot `Window` does not lose focus"
tags:
- godot
---

# Godot `Window` does not lose focus

For some reason, `Window`s do not always lose focus when other windows are focused. There isn't a function to explicitly drop focus, so to work around this problem you can focus of all of the other windows before grabbing the focus of the window you want to focus. For example: [^1]

```gdscript
func _on_notes_button_pressed() -> void:
notes_ui.visible = not notes_ui.visible
if notes_ui.visible:
focus_window(notes_ui)
func _on_map_button_pressed() -> void:
map_ui.visible = not map_ui.visible
if map_ui.visible:
focus_window(map_ui)
func focus_window(window_to_focus: Window) -> void:
# For some reason, focus isn't dropped when we focus the new window and
# there's no function to explicitly drop focus. So, to work around this
# we focus the window we want to unfocus right before we focus the
# window we want to focus
for window: Window in get_viewport().get_embedded_subwindows():
if window != window_to_focus:
window.grab_focus()
window_to_focus.grab_focus()
```

[^1]: [20250206191936](entries/20250206191936.md)
1 change: 1 addition & 0 deletions content/notes/no-signal.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ If you've been asked to playtest the game, please see the [playtesting steps](no

| date | version | notes |
|------|---------|-------|
| <span class="timestamp">2025-02-06</span> || [170706](../entries/20250206170706.md) |
| <span class="timestamp">2025-02-02</span> || [182941](../entries/20250202182941.md) |
| <span class="timestamp">2025-01-31</span> || [192922](../entries/20250131192922.md) |
| <span class="timestamp">2025-01-28</span> || [172941](../entries/20250128172941.md) |
Expand Down

0 comments on commit e96f4be

Please sign in to comment.