<commit_before>-- Copyright 2017 <NAME>
--
-- Plik uruchomieniowy gry
--
local composer   = require( 'composer' )
local app        = require( 'lib.app' )
local preference = require( 'preference' ) 

-- Dodaje nowe funkcje do standardowych modułów 
require( 'lib.utils' ) 

-- Usunięcie paska navigacyjnego z dołu
if system.getInfo( "androidApiLevel" ) and system.getInfo( "androidApiLevel" ) < 19 then
  native.setProperty( "androidSystemUiVisibility", "lowProfile" )
else
  native.setProperty( "androidSystemUiVisibility", "immersiveSticky" ) 
end

-- are we running on a simulator?
local isSimulator = "simulator" == system.getInfo( "environment" )
local isMobile = ("ios" == system.getInfo("platform")) or ("android" == system.getInfo("platform"))

-- if we are load our visual monitor that let's a press of the "F"
-- key show our frame rate and memory usage, "P" to show physics
if isSimulator then 

  -- show FPS
  local visualMonitor = require( "com.ponywolf.visualMonitor" )
  local visMon = visualMonitor:new()
  visMon.isVisible = false

  -- show/hide physics
  local function debugKeys( event )
    local phase = event.phase
    local key = event.keyName
    if phase == "up" then
      if key == "p" then
        physics.show = not physics.show
        if physics.show then 
          physics.setDrawMode( "hybrid" ) 
        else
          physics.setDrawMode( "normal" )  
        end
      elseif key == "f" then
        visMon.isVisible = not visMon.isVisible 
      end
    end
  end
  Runtime:addEventListener( "key", debugKeys )
end

-- Ładowanie ustawień z pliku settings.json
preference:load()

app.sound = preference:get( 'sound' )
app.music = preference:get( 'music' )

composer.gotoScene( 'scene.menu' )<commit_msg>Save settings before app quits<commit_after>-- Copyright 2017 <NAME>
--
-- Plik uruchomieniowy gry
--
local composer   = require( 'composer' )
local app        = require( 'lib.app' )
local preference = require( 'preference' ) 

-- Dodaje nowe funkcje do standardowych modułów 
require( 'lib.utils' ) 

-- Usunięcie paska navigacyjnego z dołu
if system.getInfo( "androidApiLevel" ) and system.getInfo( "androidApiLevel" ) < 19 then
  native.setProperty( "androidSystemUiVisibility", "lowProfile" )
else
  native.setProperty( "androidSystemUiVisibility", "immersiveSticky" ) 
end

-- are we running on a simulator?
local isSimulator = "simulator" == system.getInfo( "environment" )
local isMobile = ("ios" == system.getInfo("platform")) or ("android" == system.getInfo("platform"))

-- if we are load our visual monitor that let's a press of the "F"
-- key show our frame rate and memory usage, "P" to show physics
if isSimulator then 

  -- show FPS
  local visualMonitor = require( "com.ponywolf.visualMonitor" )
  local visMon = visualMonitor:new()
  visMon.isVisible = false

  -- show/hide physics
  local function debugKeys( event )
    local phase = event.phase
    local key = event.keyName
    if phase == "up" then
      if key == "p" then
        physics.show = not physics.show
        if physics.show then 
          physics.setDrawMode( "hybrid" ) 
        else
          physics.setDrawMode( "normal" )  
        end
      elseif key == "f" then
        visMon.isVisible = not visMon.isVisible 
      end
    end
  end
  Runtime:addEventListener( "key", debugKeys )
end

local function onSystemEvent( event )    
    if (event.type == "applicationStart") then

    elseif (event.type == "applicationExit") then 
        -- Zapis ustawień przed zamknięciem aplikacji
        preference:save()
    elseif ( event.type == "applicationSuspend" ) then
      
    elseif event.type == "applicationResume" then
        
    end
end

Runtime:addEventListener( "system", onSystemEvent )

-- Ładowanie ustawień z pliku settings.json
preference:load()

app.sound = preference:get( 'sound' )
app.music = preference:get( 'music' )

composer.gotoScene( 'scene.menu' )
{'fraction_non_alphanumeric': 0.1103148195546455, 'fraction_numerical': 0.0030714102892244687, 'mean_word_length': 3.224864864864865, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3642265', 'n_tokens_mistral': 1231, 'n_tokens_neox': 1215, 'n_words': 367}