mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
TIL lua's loadstring is now simply 'load'
Former-commit-id: 2e2ee60f28eb3cbdeb9da7877eba4d0774590f87 Former-commit-id: 81c4274951d08267adb5380d5f4fa351ace25fff
This commit is contained in:
@@ -19,7 +19,7 @@ import org.newdawn.slick.state.StateBasedGame
|
||||
*/
|
||||
class StateVTTest : BasicGameState() {
|
||||
|
||||
val vt = SimpleTextTerminal(SimpleTextTerminal.WHITE, 80, 43, colour = true)
|
||||
val vt = SimpleTextTerminal(SimpleTextTerminal.WHITE, 80, 25, colour = true)
|
||||
val computerInside = BaseTerrarumComputer(vt)
|
||||
|
||||
val vtUI = Image(vt.displayW, vt.displayH)
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
fs.run = function(p)
|
||||
local f = fs.open(p, "r")
|
||||
local s = f.readAll()
|
||||
fs.dostring(s)
|
||||
load(s)()
|
||||
end
|
||||
|
||||
_G.loadstring = _G.load
|
||||
|
||||
--------------
|
||||
-- HEXUTILS --
|
||||
|
||||
@@ -38,7 +38,6 @@ internal class Filesystem(globals: Globals, computer: BaseTerrarumComputer) {
|
||||
globals["fs"]["open"] = OpenFile(computer)
|
||||
globals["fs"]["parent"] = GetParentDir(computer)
|
||||
globals["__haltsystemexplicit__"] = HaltComputer(computer)
|
||||
globals["fs"]["dostring"] = DoString(computer)
|
||||
// fs.run defined in ROMLIB
|
||||
}
|
||||
|
||||
@@ -336,13 +335,6 @@ internal class Filesystem(globals: Globals, computer: BaseTerrarumComputer) {
|
||||
}
|
||||
}
|
||||
|
||||
class DoString(val computer: BaseTerrarumComputer): OneArgFunction() {
|
||||
override fun call(script: LuaValue): LuaValue {
|
||||
computer.luaJ_globals.load(script.checkjstring()).call()
|
||||
return LuaValue.NONE
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////
|
||||
|
||||
@@ -73,7 +73,7 @@ open class SimpleTextTerminal(
|
||||
|
||||
val screenBuffer = AAFrame(width, height)
|
||||
|
||||
open protected val fontRef = "./assets/graphics/fonts/cp949.png"
|
||||
open protected val fontRef = "./assets/graphics/fonts/MDA.png"
|
||||
open protected val fontImg = Image(fontRef)
|
||||
open protected val fontW = fontImg.width / 16
|
||||
open protected val fontH = fontImg.height / 16
|
||||
|
||||
Reference in New Issue
Block a user