-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.lua
More file actions
108 lines (92 loc) · 3.54 KB
/
main.lua
File metadata and controls
108 lines (92 loc) · 3.54 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
love.setDeprecationOutput(false)
function love.load()
nativelocks = require 'src/native/engine/core/nativelocks'
imageloader = require 'src/native/engine/loader/imageloader'
save = require 'src/native/engine/core/save_handler'
pluginmanager = require 'src/native/engine/plugin/pluginmngr'
language = require 'src/native/engine/resources/language'
utils = require 'src/native/engine/resources/utils'
request = require 'src/native/engine/core/request'
version = require 'src/thirdparty/version'
utils = require 'src/native/engine/resources/utils'
settings = require 'src/native/engine/core/file_reader'
versionCheck = require 'src/native/engine/core/bios_versionCheck'
btnPressedCount = 0
love.keyboard.setKeyRepeat(true)
-- engine version system
engineVersion = "0.0.4"
serverEngineVersion = ""
function requestFunction()
code, serverEngineVersion = request.newRequest("https://raw.githubusercontent.com/Litium-org/litium/master/.litversion")
end
if pcall(requestFunction) then
print(serverEngineVersion)
else
serverEngineVersion = engineVersion
end
nativelocks.lock()
--=[: API Stuff :]=--
litgraphics = require 'API/sprite/litgraphics'
litsound = require 'API/sound/litsound'
litgame = require 'API/game/litgame'
litsystem = require 'API/system/litsystem'
litinput = require 'API/input/litinput'
litfilesystem = require 'API/filesystem/litfilesystem'
litwindow = require 'API/window/litwindow'
litsave = require 'API/savesystem/litsave'
switch = require 'src/native/sources/switch'
initLogoTimer = 0
imageloader.init()
imagedata = imageloader.getImage()
theValue = versionCheck.doCheck(engineVersion, serverEngineVersion)
print(theValue)
if theValue then
if imageloader.getCurrentImageName() ~= "-warnoutdate" then
if not utils.exist("file", ".litignored") then
imageloader.changeImageName("-warnoutdate")
versionCheck.ignored()
litgame.restart()
end
end
end
pcall(imagedata(), start())
pluginmanager.loadPlugins()
end
function love.draw()
litgraphics.clearScreen()
pcall(imagedata(), render())
end
function love.update(dt)
pcall(imagedata(), update(dt))
end
function love.keypressed(k, scancode, isRepeat)
pcall(imagedata(), keydown(k, scancode))
-- callback if specific keys pressed
if k == "home" then
if isRepeat then
print(btnPressedCount)
btnPressedCount = btnPressedCount + 1
if btnPressedCount > 20 then
imageloader.changeImageName("-native")
litgame.restart()
end
end
end
if k == "end" then
if isRepeat then
btnPressedCount = btnPressedCount + 1
if btnPressedCount > 20 then
litgame.quit()
end
end
end
if k == "v" then
if isRepeat then
btnPressedCount = btnPressedCount + 1
if btnPressedCount > 20 then
imageloader.changeImageName("-verbose")
litgame.restart()
end
end
end
end