Skip to content
This repository was archived by the owner on May 25, 2024. It is now read-only.

Commit 845fdc1

Browse files
authored
Merge pull request #5 from ByteSquire/fixfeat-v11
- disabled non-functional buttons (hopefully all of them) - a lot of bug fixes for building a mod - cancelling build improved - fix scrolling in file views - added archive stats functionality - open multiple files when selecting multiple using shift or ctrl - a couple of fixes for the custom table control
2 parents 4792f7d + 238383a commit 845fdc1

File tree

14 files changed

+316
-93
lines changed

14 files changed

+316
-93
lines changed

Editors/Basic/Scripts/ArrayVariable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ private void OnDelRow()
278278
UpdateIndices();
279279

280280
var nextIndex = indices[0];
281-
if (nextIndex == 0)
281+
if (nextIndex == -1)
282282
return;
283283
if (nextIndex > values.Count - 1)
284284
nextIndex--;

Editors/Generic/MenuBar.tscn

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,12 @@ item_2/disabled = true
117117
item_3/text = "Toolbar"
118118
item_3/checkable = 1
119119
item_3/id = 3
120+
item_3/disabled = true
120121
item_4/text = "Status Bar"
121122
item_4/checkable = 1
122123
item_4/checked = true
123124
item_4/id = 4
125+
item_4/disabled = true
124126
script = ExtResource("4_gj3qr")
125127

126128
[node name="Tools" type="PopupMenu" parent="."]

Scenes/main.tscn

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ size_flags_vertical = 4
4141
metadata/_edit_use_anchors_ = true
4242

4343
[node name="MainView" type="VBoxContainer" parent="."]
44-
layout_mode = 1
4544
anchors_preset = 15
4645
anchor_right = 1.0
4746
anchor_bottom = 1.0
@@ -50,7 +49,8 @@ grow_vertical = 2
5049
metadata/_edit_use_anchors_ = true
5150

5251
[node name="MenuBar" type="MenuBar" parent="MainView" node_paths=PackedStringArray("workingDirDialog", "aboutPopup", "createModDialog", "selectNewModDialog", "optionsDialog")]
53-
layout_mode = 2
52+
offset_right = 1150.0
53+
offset_bottom = 31.0
5454
script = ExtResource("1_hfkuf")
5555
workingDirDialog = NodePath("../../Popups/SelectWorkingFolder")
5656
aboutPopup = NodePath("../../Popups/About")
@@ -101,6 +101,7 @@ item_0/text = "New"
101101
item_0/id = 0
102102
item_1/text = "Delete"
103103
item_1/id = 1
104+
item_1/disabled = true
104105
item_2/text = ""
105106
item_2/id = 2
106107
item_2/separator = true
@@ -121,6 +122,7 @@ item_2/id = 2
121122
item_2/separator = true
122123
item_3/text = "Verify Build"
123124
item_3/id = 3
125+
item_3/disabled = true
124126
script = ExtResource("2_bwdgy")
125127

126128
[node name="Verify Options" type="PopupMenu" parent="MainView/MenuBar/Build"]
@@ -129,23 +131,28 @@ item_0/text = "Normal"
129131
item_0/checkable = 2
130132
item_0/checked = true
131133
item_0/id = 0
134+
item_0/disabled = true
132135
item_1/text = "Detailed"
133136
item_1/checkable = 2
134137
item_1/id = 1
138+
item_1/disabled = true
135139
item_2/text = "Excessive"
136140
item_2/checkable = 2
137141
item_2/id = 2
142+
item_2/disabled = true
138143
script = ExtResource("6_fceit")
139144

140145
[node name="Database" type="PopupMenu" parent="MainView/MenuBar"]
141146
item_count = 7
142147
item_0/text = "Import Record..."
143148
item_0/id = 0
149+
item_0/disabled = true
144150
item_1/text = ""
145151
item_1/id = 1
146152
item_1/separator = true
147153
item_2/text = "Check Records"
148154
item_2/id = 2
155+
item_2/disabled = true
149156
item_3/text = "Move Records"
150157
item_3/id = 3
151158
item_3/disabled = true
@@ -163,8 +170,10 @@ script = ExtResource("7_ux155")
163170
item_count = 4
164171
item_0/text = "Build..."
165172
item_0/id = 0
173+
item_0/disabled = true
166174
item_1/text = "Compact..."
167175
item_1/id = 1
176+
item_1/disabled = true
168177
item_2/text = ""
169178
item_2/id = 2
170179
item_2/separator = true
@@ -176,6 +185,7 @@ script = ExtResource("8_bxck6")
176185
item_count = 3
177186
item_0/text = "Extract game files..."
178187
item_0/id = 0
188+
item_0/disabled = true
179189
item_1/text = ""
180190
item_1/id = 1
181191
item_1/separator = true
@@ -191,6 +201,7 @@ item_0/checked = true
191201
item_0/id = 0
192202
item_1/text = "Refresh"
193203
item_1/id = 1
204+
item_1/disabled = true
194205
script = ExtResource("10_rod4w")
195206

196207
[node name="Help" type="PopupMenu" parent="MainView/MenuBar"]
@@ -204,63 +215,80 @@ item_2/id = 2
204215
item_2/separator = true
205216
item_3/text = "Install Templates..."
206217
item_3/id = 3
218+
item_3/disabled = true
207219
item_4/text = "Install Tutorials..."
208220
item_4/id = 4
221+
item_4/disabled = true
209222
script = ExtResource("11_va2v8")
210223

211224
[node name="FilesConsole" type="VSplitContainer" parent="MainView"]
212-
layout_mode = 2
225+
offset_top = 35.0
226+
offset_right = 1150.0
227+
offset_bottom = 615.0
213228
size_flags_vertical = 3
214229

215230
[node name="TabContainer" type="TabContainer" parent="MainView/FilesConsole"]
216-
layout_mode = 2
231+
offset_right = 1150.0
232+
offset_bottom = 284.0
217233
size_flags_vertical = 3
218234
tab_alignment = 1
219235
drag_to_rearrange_enabled = true
220236
script = ExtResource("13_utfmt")
221237

222238
[node name="ConsoleContainer" type="ScrollContainer" parent="MainView/FilesConsole"]
223239
custom_minimum_size = Vector2(0, 40)
224-
layout_mode = 2
240+
offset_top = 296.0
241+
offset_right = 1150.0
242+
offset_bottom = 580.0
225243
size_flags_vertical = 3
226244

227245
[node name="Console" type="RichTextLabel" parent="MainView/FilesConsole/ConsoleContainer"]
228-
layout_mode = 2
246+
offset_right = 1150.0
247+
offset_bottom = 284.0
229248
size_flags_horizontal = 3
230249
size_flags_vertical = 3
231250
bbcode_enabled = true
232251
scroll_following = true
233252

234253
[node name="FootBar" type="HSplitContainer" parent="MainView"]
235-
layout_mode = 2
254+
offset_top = 619.0
255+
offset_right = 1150.0
256+
offset_bottom = 646.0
236257
split_offset = 300
237258
script = ExtResource("20_owo0q")
238259

239260
[node name="StatusLabel" type="RichTextLabel" parent="MainView/FootBar"]
240-
layout_mode = 2
261+
offset_right = 869.0
262+
offset_bottom = 27.0
241263
size_flags_horizontal = 3
242264
bbcode_enabled = true
243265
text = "[color=green]Ready[/color]"
244266

245267
[node name="ProgressPath" type="HSplitContainer" parent="MainView/FootBar"]
246-
layout_mode = 2
268+
offset_left = 881.0
269+
offset_right = 1150.0
270+
offset_bottom = 27.0
247271
size_flags_horizontal = 3
248272

249273
[node name="Progress" type="ProgressBar" parent="MainView/FootBar/ProgressPath"]
250274
custom_minimum_size = Vector2(50, 0)
251-
layout_mode = 2
275+
offset_right = 128.0
276+
offset_bottom = 27.0
252277
size_flags_horizontal = 3
253278
size_flags_vertical = 1
254279
theme_override_styles/fill = SubResource("StyleBoxFlat_wpugc")
255280
step = 1.0
256281
rounded = true
257282

258283
[node name="PathContainer" type="ScrollContainer" parent="MainView/FootBar/ProgressPath"]
259-
layout_mode = 2
284+
offset_left = 140.0
285+
offset_right = 269.0
286+
offset_bottom = 27.0
260287
size_flags_horizontal = 3
261288

262289
[node name="Path" type="Label" parent="MainView/FootBar/ProgressPath/PathContainer"]
263-
layout_mode = 2
290+
offset_right = 129.0
291+
offset_bottom = 23.0
264292
size_flags_horizontal = 3
265293
size_flags_vertical = 1
266294
script = ExtResource("7_k8qir")
@@ -333,3 +361,4 @@ progress = NodePath("../../MainView/FootBar/ProgressPath/Progress")
333361
[connection signal="install_templates" from="MainView/MenuBar/Help" to="MainView/MenuBar" method="_on_help_install_templates"]
334362
[connection signal="install_tutorials" from="MainView/MenuBar/Help" to="MainView/MenuBar" method="_on_help_install_tutorials"]
335363
[connection signal="ToggleBuild" from="Util/BuildMod" to="MainView/MenuBar/Build" method="_on_build_mod_toggle_build"]
364+
[connection signal="ToggleBuild" from="Util/BuildMod" to="MainView/MenuBar/Database" method="_on_build_mod_toggle_build"]

Scripts/MainScene/MenuBar/Management/DatabaseManagement.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
using Godot;
2+
using Microsoft.Extensions.Logging;
23
using System;
4+
using System.IO;
5+
using System.Linq;
6+
using TQArchive_Wrapper;
7+
using TQDBEditor.Common;
38

49
namespace TQDBEditor
510
{
@@ -36,6 +41,20 @@ public void _on_database_show_archive_stats()
3641
{
3742
GD.Print("Database -> Show archive stats");
3843
EmitSignal(nameof(ShowArchiveStatsClicked));
44+
45+
var config = this.GetEditorConfig();
46+
var logger = this.GetConsoleLogger();
47+
var archivePath = config.GetCurrentOutputArchivePath();
48+
try
49+
{
50+
var arzReader = new ArzReader(archivePath, logger);
51+
52+
logger.LogInformation("{archive}:\nNumber of Files in archive: {numFiles}\nNumber of Strings in archive: {numStrings}",
53+
archivePath,
54+
arzReader.GetDBRFileInfos().Count(),
55+
arzReader.GetStringList().Count());
56+
}
57+
catch (Exception) { }
3958
}
4059

4160
public void _on_database_stop()

Scripts/MainScene/MenuBar/SubMenus/DatabaseMenu.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,8 @@ func _on_id_pressed(id):
2222
6:
2323
stop.emit()
2424

25+
26+
func _on_build_mod_toggle_build():
27+
var index = get_item_index(6)
28+
set_item_disabled(index, not is_item_disabled(index))
29+

0 commit comments

Comments
 (0)