Changed MelonPrint to print,
Renamed "MelonPrint" to just "print", TIL you can redefine pretty much any lua funct... Also fixed the lua console not re-opening after closing it the first time.
This commit is contained in:
parent
a6dd2362c2
commit
b16912a96c
|
@ -83,6 +83,7 @@ void LuaConsoleDialog::closeEvent(QCloseEvent *event)
|
|||
{
|
||||
onStop();
|
||||
bundle->overlays->clear();
|
||||
flagClosed = true;
|
||||
event->accept();
|
||||
}
|
||||
|
||||
|
@ -248,7 +249,7 @@ int lua_MelonPrint(lua_State* L)
|
|||
bundle->getEmuThread()->onLuaPrint((QString)string);
|
||||
return 0;
|
||||
}
|
||||
AddLuaFunction(lua_MelonPrint,MelonPrint);
|
||||
AddLuaFunction(lua_MelonPrint,print);
|
||||
|
||||
int lua_MelonClear(lua_State* L)
|
||||
{
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
QPushButton* buttonStartStop;
|
||||
QPushButton* buttonPausePlay;
|
||||
QScrollBar* bar;
|
||||
bool flagClosed;
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
LuaBundle* bundle;
|
||||
|
|
|
@ -1680,10 +1680,15 @@ void MainWindow::onOpenPowerManagement()
|
|||
|
||||
void MainWindow::onOpenLuaScript()
|
||||
{
|
||||
if (this->luaDialog)
|
||||
if (luaDialog && luaDialog->flagClosed)
|
||||
{
|
||||
delete luaDialog;
|
||||
luaDialog = nullptr;
|
||||
}
|
||||
if (luaDialog)
|
||||
return;
|
||||
this->luaDialog = new LuaConsoleDialog(this);
|
||||
this->luaDialog->show();
|
||||
luaDialog = new LuaConsoleDialog(this);
|
||||
luaDialog->show();
|
||||
connect(emuThread,&EmuThread::signalLuaSaveState,this,&MainWindow::onLuaSaveState);
|
||||
connect(emuThread,&EmuThread::signalLuaLoadState,this,&MainWindow::onLuaLoadState);
|
||||
}
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
-- Written by NPO197
|
||||
|
||||
MelonClear()
|
||||
MelonPrint("This text Should be cleared")
|
||||
print("This text Should be cleared")
|
||||
MelonClear()
|
||||
|
||||
MelonPrint("Running Test...")
|
||||
print("Running Test...")
|
||||
|
||||
u32Data = Readu32(0x00000000)
|
||||
MelonPrint(string.format("DataZero: %x",u32Data))
|
||||
print(string.format("DataZero: %x",u32Data))
|
||||
|
||||
canvas = MakeCanvas(0,0,500,500)
|
||||
SetCanvas(canvas)
|
||||
|
@ -109,7 +109,7 @@ function KeysText()
|
|||
if pcall(string.char,i) then
|
||||
str = str..string.char(i)
|
||||
else
|
||||
MelonPrint("NonAscii:"..i)
|
||||
print("NonAscii:"..i)
|
||||
typed = ""
|
||||
end
|
||||
end
|
||||
|
|
|
@ -30,12 +30,11 @@ end
|
|||
|
||||
## Function List
|
||||
|
||||
`nil MelonPrint(sPrintText)`
|
||||
`nil print(sPrintText)`
|
||||
- Print `sPrintText` to the lua consol
|
||||
- for now use this instead of `print()`
|
||||
|
||||
`nil MelonClear()`
|
||||
- Clearse the lua consol
|
||||
- Clearse the consol in the lua dialog window.
|
||||
|
||||
`n_u8Value Readu8(nAddress)`
|
||||
- Read Data unisigned one Byte from u32 address `nAddress`
|
||||
|
|
Loading…
Reference in New Issue