-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add steam input debug view, refactor iga (#17)
* Fixes * Add IGAView * Do not use pointers to Q_GADGETs * Fixes * Add basic repl console * Add console to debug overlay * Improve console visuals * Extract components from console * Refactor ReplEdit * Cleanup * Improve IGAView * show only iga on igaview
- Loading branch information
Showing
31 changed files
with
528 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,6 +128,7 @@ ApplicationWindow { | |
|
||
DebugOverlay { | ||
id: debugOverlay | ||
visible: true | ||
|
||
x: 0 | ||
y: 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import QtQuick 2.15 | ||
import QtQuick.Layouts 1.15 | ||
import QtQuick.Controls 2.12 | ||
|
||
import "../../../resources/qml/models" as Models | ||
|
||
ListView { | ||
id: root | ||
clip: true | ||
|
||
property var actions: [] | ||
|
||
model: Models.JSONListModel { | ||
data: root.actions | ||
} | ||
|
||
delegate: ItemDelegate { | ||
width: root.width | ||
height: 50 | ||
|
||
RowLayout { | ||
anchors.fill: parent | ||
|
||
Label { | ||
Layout.fillWidth: parent | ||
height: parent.height | ||
font.pointSize: 20 | ||
|
||
text: name | ||
verticalAlignment: Qt.AlignVCenter | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import QtQuick 2.15 | ||
import QtQuick.Layouts 1.15 | ||
import QtQuick.Controls 2.15 | ||
|
||
import "./ConsoleComponents" | ||
|
||
Item { | ||
id: root | ||
|
||
ColumnLayout { | ||
anchors.fill: parent | ||
|
||
ListView { | ||
id: replView | ||
|
||
Layout.fillHeight: parent | ||
Layout.fillWidth: parent | ||
|
||
verticalLayoutDirection: ListView.BottomToTop | ||
|
||
clip: true | ||
|
||
model: ListModel { | ||
id: logsModel | ||
|
||
ListElement { | ||
replType: "info" | ||
replLine: ">>>" | ||
} | ||
|
||
function addLine(type, line) { | ||
insert(0, {replLine: line, replType: type}) | ||
} | ||
} | ||
|
||
delegate: LineDelegate { | ||
width: parent.width | ||
} | ||
} | ||
|
||
ReplEdit { | ||
id: replEdit | ||
Layout.fillWidth: parent | ||
|
||
onEvalRequested: { | ||
logsModel.addLine("command", line) | ||
try { | ||
logsModel.addLine("result", `${eval(line)}`) | ||
} catch (e) { | ||
logsModel.addLine("error", `${e}`) | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import QtQuick 2.15 | ||
import QtQuick.Layouts 1.15 | ||
import QtQuick.Controls 2.15 | ||
|
||
import "../../MDI" as MDI | ||
|
||
ItemDelegate { | ||
height: lineLabel.height | ||
|
||
property var typeIcons:({ | ||
"command": "arrowLeft", | ||
"result": "arrowRight", | ||
"error": "bug", | ||
"info": "information" | ||
}) | ||
|
||
RowLayout { | ||
anchors.fill: parent | ||
|
||
MDI.Icon { | ||
Layout.preferredWidth: 30 | ||
|
||
name: typeIcons[replType] | ||
color: "gray" | ||
} | ||
|
||
Label { | ||
id: lineLabel | ||
|
||
Layout.fillWidth: parent | ||
|
||
font.pointSize: 16 | ||
|
||
text: replLine | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import QtQuick 2.15 | ||
import QtQuick.Layouts 1.15 | ||
import QtQuick.Controls 2.15 | ||
|
||
TextArea { | ||
id: root | ||
|
||
property var history: [] | ||
property int historyPosition: 0 | ||
|
||
signal evalRequested(string line) | ||
|
||
onHistoryPositionChanged: { | ||
text = historyPosition === history.length ? "" : history[historyPosition] | ||
} | ||
|
||
Keys.onPressed: (event)=> { | ||
switch(event.key) { | ||
case Qt.Key_Return: | ||
if (event.modifiers === 0) { | ||
event.accepted = true | ||
root.evalRequested(root.text) | ||
history.push(root.text) | ||
historyPosition = history.length | ||
} | ||
break | ||
|
||
case Qt.Key_Up: | ||
if (historyPosition > 0) { | ||
event.accepted = true | ||
historyPosition -= 1 | ||
root.cursorPosition = root.text.length | ||
} | ||
break | ||
|
||
case Qt.Key_Down: | ||
if (historyPosition < history.length) { | ||
event.accepted = true | ||
historyPosition += 1 | ||
root.cursorPosition = root.text.length | ||
} | ||
break | ||
} | ||
} | ||
} |
Oops, something went wrong.