RomAssetEditor.tscn 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. [gd_scene load_steps=6 format=3 uid="uid://cabk5huwjo06p"]
  2. [ext_resource type="Script" uid="uid://bhplwsmbalqng" path="res://Scripts/UI/RomAssetEditor.gd" id="1_rj2ho"]
  3. [ext_resource type="Texture2D" uid="uid://biikrttwchk12" path="res://Assets/Sprites/UI/EditorGridSmall.png" id="2_ayc5w"]
  4. [sub_resource type="SystemFont" id="SystemFont_potm2"]
  5. font_names = PackedStringArray("Monospace")
  6. font_weight = 600
  7. [sub_resource type="Theme" id="Theme_0rwsj"]
  8. default_font = SubResource("SystemFont_potm2")
  9. default_font_size = 12
  10. [sub_resource type="SystemFont" id="SystemFont_nik6x"]
  11. font_names = PackedStringArray("Monospace")
  12. font_weight = 600
  13. font_stretch = 50
  14. [node name="RomAssetEditor" type="Node"]
  15. script = ExtResource("1_rj2ho")
  16. metadata/_custom_type_script = "uid://bcqr1v25ygedb"
  17. [node name="FileDialog" type="FileDialog" parent="."]
  18. unique_name_in_owner = true
  19. oversampling_override = 1.0
  20. title = "Open a File"
  21. file_mode = 0
  22. access = 2
  23. filters = PackedStringArray("*.nes;NES ROMs")
  24. use_native_dialog = true
  25. [node name="BG" type="ColorRect" parent="."]
  26. anchors_preset = 15
  27. anchor_right = 1.0
  28. anchor_bottom = 1.0
  29. grow_horizontal = 2
  30. grow_vertical = 2
  31. mouse_filter = 2
  32. color = Color(0, 0, 0, 1)
  33. [node name="RomRequired" type="Label" parent="."]
  34. unique_name_in_owner = true
  35. anchors_preset = 15
  36. anchor_right = 1.0
  37. anchor_bottom = 1.0
  38. grow_horizontal = 2
  39. grow_vertical = 2
  40. size_flags_horizontal = 0
  41. theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
  42. theme_override_fonts/font = SubResource("SystemFont_potm2")
  43. theme_override_font_sizes/font_size = 12
  44. text = "No ROM path set...
  45. Open the game normally, and
  46. provide a ROM."
  47. horizontal_alignment = 1
  48. vertical_alignment = 1
  49. [node name="Buttons" type="HBoxContainer" parent="."]
  50. unique_name_in_owner = true
  51. anchors_preset = 15
  52. anchor_right = 1.0
  53. anchor_bottom = 1.0
  54. grow_horizontal = 2
  55. grow_vertical = 2
  56. theme = SubResource("Theme_0rwsj")
  57. alignment = 2
  58. [node name="VBoxContainer2" type="VBoxContainer" parent="Buttons"]
  59. custom_minimum_size = Vector2(215, 240)
  60. layout_mode = 2
  61. size_flags_horizontal = 3
  62. mouse_filter = 2
  63. alignment = 2
  64. [node name="ScrollContainer" type="ScrollContainer" parent="Buttons/VBoxContainer2"]
  65. unique_name_in_owner = true
  66. custom_minimum_size = Vector2(0, 210)
  67. layout_mode = 2
  68. size_flags_horizontal = 3
  69. [node name="ImageContainer" type="BoxContainer" parent="Buttons/VBoxContainer2/ScrollContainer"]
  70. layout_mode = 2
  71. size_flags_vertical = 3
  72. mouse_filter = 2
  73. [node name="ImagePreview" type="TextureRect" parent="Buttons/VBoxContainer2/ScrollContainer/ImageContainer"]
  74. unique_name_in_owner = true
  75. self_modulate = Color(1, 1, 1, 0.5019608)
  76. layout_mode = 2
  77. size_flags_horizontal = 0
  78. size_flags_vertical = 0
  79. mouse_filter = 2
  80. stretch_mode = 2
  81. [node name="GreenPreview" type="TextureRect" parent="Buttons/VBoxContainer2/ScrollContainer/ImageContainer/ImagePreview"]
  82. unique_name_in_owner = true
  83. layout_mode = 0
  84. offset_right = 40.0
  85. offset_bottom = 40.0
  86. stretch_mode = 2
  87. [node name="TilesPreview" type="TextureRect" parent="Buttons/VBoxContainer2/ScrollContainer/ImageContainer/ImagePreview"]
  88. unique_name_in_owner = true
  89. layout_mode = 0
  90. offset_right = 40.0
  91. offset_bottom = 40.0
  92. stretch_mode = 2
  93. [node name="TextureRect" type="TextureRect" parent="Buttons/VBoxContainer2/ScrollContainer/ImageContainer/ImagePreview/TilesPreview"]
  94. modulate = Color(0.50928617, 0.50928617, 0.50928617, 0.4392157)
  95. layout_mode = 1
  96. anchors_preset = 15
  97. anchor_right = 1.0
  98. anchor_bottom = 1.0
  99. grow_horizontal = 2
  100. grow_vertical = 2
  101. size_flags_horizontal = 3
  102. size_flags_vertical = 3
  103. texture = ExtResource("2_ayc5w")
  104. stretch_mode = 1
  105. [node name="Preview" type="Sprite2D" parent="Buttons/VBoxContainer2/ScrollContainer/ImageContainer/ImagePreview"]
  106. unique_name_in_owner = true
  107. centered = false
  108. region_enabled = true
  109. region_rect = Rect2(0, 0, 8, 8)
  110. [node name="JSONContainer" type="VBoxContainer" parent="Buttons/VBoxContainer2"]
  111. unique_name_in_owner = true
  112. visible = false
  113. layout_mode = 2
  114. size_flags_vertical = 3
  115. [node name="JSONEdit" type="TextEdit" parent="Buttons/VBoxContainer2/JSONContainer"]
  116. unique_name_in_owner = true
  117. layout_mode = 2
  118. size_flags_vertical = 3
  119. theme_override_font_sizes/font_size = 8
  120. [node name="Update" type="Button" parent="Buttons/VBoxContainer2/JSONContainer"]
  121. layout_mode = 2
  122. focus_mode = 0
  123. text = "Update"
  124. [node name="CurSprite" type="Label" parent="Buttons/VBoxContainer2"]
  125. unique_name_in_owner = true
  126. layout_mode = 2
  127. size_flags_horizontal = 3
  128. size_flags_vertical = 8
  129. theme_override_fonts/font = SubResource("SystemFont_nik6x")
  130. theme_override_font_sizes/font_size = 12
  131. text = "CURRENT SPRITE:
  132. MARIO.PNG"
  133. horizontal_alignment = 1
  134. [node name="VBoxContainer" type="VBoxContainer" parent="Buttons"]
  135. layout_mode = 2
  136. alignment = 2
  137. [node name="PaletteOverride" type="LineEdit" parent="Buttons/VBoxContainer"]
  138. unique_name_in_owner = true
  139. layout_mode = 2
  140. theme_override_font_sizes/font_size = 6
  141. placeholder_text = "Palette"
  142. [node name="LastImage" type="Button" parent="Buttons/VBoxContainer"]
  143. layout_mode = 2
  144. focus_mode = 0
  145. text = "Last"
  146. [node name="NextImage" type="Button" parent="Buttons/VBoxContainer"]
  147. layout_mode = 2
  148. focus_mode = 0
  149. text = "Next"
  150. [node name="SaveImage" type="Button" parent="Buttons/VBoxContainer"]
  151. layout_mode = 2
  152. focus_mode = 0
  153. text = "Save"
  154. [node name="JSON" type="Button" parent="Buttons/VBoxContainer"]
  155. layout_mode = 2
  156. focus_mode = 0
  157. toggle_mode = true
  158. text = "JSON"
  159. [connection signal="file_selected" from="FileDialog" to="." method="on_file_selected"]
  160. [connection signal="pressed" from="Buttons/VBoxContainer2/JSONContainer/Update" to="." method="update_palettes" binds= [true]]
  161. [connection signal="pressed" from="Buttons/VBoxContainer/LastImage" to="." method="cycle_list" binds= [-1]]
  162. [connection signal="pressed" from="Buttons/VBoxContainer/NextImage" to="." method="cycle_list" binds= [1]]
  163. [connection signal="pressed" from="Buttons/VBoxContainer/SaveImage" to="." method="save_sprite"]
  164. [connection signal="toggled" from="Buttons/VBoxContainer/JSON" to="." method="toggle_palettes_view"]