Compare commits

..

No commits in common. "49ce6885ea4eda97afd05daa9c1648d671b1ef05" and "ebc98715bec363938e6b033e5f7454fc23ea5f8a" have entirely different histories.

3 changed files with 4 additions and 6 deletions

View File

@ -40,9 +40,7 @@ class Funfriend::ChatterContext < Funfriend::WindowContext
def update_position
if parent
p = parent.not_nil!
if !p.closed
window.position = (Vec2.new(p.window.position) + Vec2.new(p.window.size) / 2 + parent_relative_pos - window_size / 2).xy_i
end
window.position = (Vec2.new(p.window.position) + Vec2.new(p.window.size) / 2 + parent_relative_pos - window_size / 2).xy_i
end
end

View File

@ -28,15 +28,17 @@ module Funfriend
LOG = ::Log.for("")
@@contexts = [] of WindowContext
@@main_context : WindowContext?
def self.should_close?
@@contexts.size == 0
@@main_context && @@main_context.not_nil!.window.should_close?
end
def self.init_contexts
ConfigMan.config["buddies"]["types"].as(String).split(",").each do |buddy_name|
add_context(BuddyContext.new(make_buddy(buddy_name)))
end
@@main_context = @@contexts[0]
at_exit { contexts.each &.destroy }
end

View File

@ -5,7 +5,6 @@ GLFW_FOCUS_ON_SHOW = 0x0002000C
class Funfriend::WindowContext
getter window : CrystGLFW::Window
property closed : Bool = false
DEFAULT_HINTS = {
# supposedly required on MacOS
@ -44,7 +43,6 @@ class Funfriend::WindowContext
def close
window.destroy
@closed = true
end
def clean_up