Skip to content

Commit

Permalink
torch slabs, wall side cursor hover
Browse files Browse the repository at this point in the history
  • Loading branch information
rainlizard committed Nov 11, 2023
1 parent 1a48c70 commit 7b1420a
Show file tree
Hide file tree
Showing 11 changed files with 132 additions and 276 deletions.
5 changes: 5 additions & 0 deletions Autoload/Settings.gd
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ var listOfSettings = [
"chance_effect_lava",
"auto_open_map_settings",
"fortify",
"automatic_torch_slabs",
# These four are read inside Viewport script
# "editor_window_position",
# "editor_window_size",
Expand Down Expand Up @@ -358,6 +359,10 @@ func game_setting(doWhat,string,value):
var oPlaceThingsAnywhere = $'../Main/Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements/MarginContainer/VBoxContainer/PlaceThingsAnywhere'
if doWhat == SET: oPlaceThingsAnywhere.pressed = value
if doWhat == GET: return oPlaceThingsAnywhere.pressed
"automatic_torch_slabs":
var oAutomaticTorchSlabsCheckbox = $'../Main/Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements/MarginContainer/VBoxContainer/AutomaticTorchSlabsCheckbox'
if doWhat == SET: oAutomaticTorchSlabsCheckbox.pressed = value
if doWhat == GET: return oAutomaticTorchSlabsCheckbox.pressed
"wallauto_art":
var oAutoWallArtButton = $'../Main/Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements/MarginContainer/VBoxContainer/GridContainer/AutoWallArtButton'
if doWhat == SET: oAutoWallArtButton.text = value
Expand Down
5 changes: 2 additions & 3 deletions Autoload/Slabs.gd
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ var auto_wall_updates_these = {
WALL_WITH_WOMAN:null,
WALL_WITH_PAIR:null,
WALL_DAMAGED:null,
WALL_AUTOMATIC:null,
}

var rooms_with_middle_slab = {
Expand Down Expand Up @@ -158,9 +157,9 @@ var data = {
ROCK: ["Impenetrable Rock", BLOCK_SLAB, BITMASK_TALL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, NOT_OWNABLE], # 0
GOLD: ["Gold Seam", BLOCK_SLAB, BITMASK_TALL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, NOT_OWNABLE], # 1
EARTH: ["Earth", BLOCK_SLAB, BITMASK_TALL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, NOT_OWNABLE], # 2
EARTH_WITH_TORCH: ["Torch Earth", BLOCK_SLAB, BITMASK_TALL, PANEL_SIDE_VIEW, 4, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, NOT_OWNABLE], # 3
EARTH_WITH_TORCH: ["Torch Earth", BLOCK_SLAB, BITMASK_TALL, PANEL_SIDE_VIEW, 4, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, NOT_OWNABLE], # 3
WALL_WITH_BANNER: ["Banner Wall", BLOCK_SLAB, BITMASK_WALL, PANEL_SIDE_VIEW, 4, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 4
WALL_WITH_TORCH: ["Torch Wall", BLOCK_SLAB, BITMASK_WALL, PANEL_SIDE_VIEW, 4, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 5
WALL_WITH_TORCH: ["Torch Wall", BLOCK_SLAB, BITMASK_WALL, PANEL_SIDE_VIEW, 4, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 5
WALL_WITH_TWINS: ["Twins Wall", BLOCK_SLAB, BITMASK_WALL, PANEL_SIDE_VIEW, 4, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 6
WALL_WITH_WOMAN: ["Woman Wall", BLOCK_SLAB, BITMASK_WALL, PANEL_SIDE_VIEW, 4, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 7
WALL_WITH_PAIR: ["Pair Wall", BLOCK_SLAB, BITMASK_WALL, PANEL_SIDE_VIEW, 4, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 8
Expand Down
22 changes: 19 additions & 3 deletions Scenes/Main.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=174 format=2]
[gd_scene load_steps=175 format=2]

[ext_resource path="res://Scenes/SlabStyle.gd" type="Script" id=1]
[ext_resource path="res://Scenes/SlabPlacement.gd" type="Script" id=2]
Expand Down Expand Up @@ -33,6 +33,7 @@
[ext_resource path="res://Scenes/SaveMap.gd" type="Script" id=31]
[ext_resource path="res://Scenes/WriteData.gd" type="Script" id=32]
[ext_resource path="res://Scenes/Message.gd" type="Script" id=33]
[ext_resource path="res://Scenes/SlabSideViewer.gd" type="Script" id=34]
[ext_resource path="res://Scenes/ConfirmDecompression.gd" type="Script" id=35]
[ext_resource path="res://Shaders/FlashNeutralRooms.gdshader" type="Shader" id=36]
[ext_resource path="res://Scenes/Editor.gd" type="Script" id=37]
Expand Down Expand Up @@ -546,6 +547,13 @@ texture = ExtResource( 24 )
centered = false
script = ExtResource( 18 )
[node name="SlabSideViewer" type="Control" parent="Game2D/Selector/TileSelector"]
show_behind_parent = true
margin_right = 40.0
margin_bottom = 40.0
mouse_filter = 2
script = ExtResource( 34 )
[node name="Centerer" type="Control" parent="Game2D/Selector/TileSelector"]
margin_right = 96.0
margin_bottom = 96.0
Expand Down Expand Up @@ -2403,13 +2411,13 @@ script = ExtResource( 103 )

[node name="MarginContainer" type="MarginContainer" parent="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements"]
margin_right = 544.0
margin_bottom = 593.0
margin_bottom = 626.0
size_flags_horizontal = 3
size_flags_vertical = 3

[node name="VBoxContainer" type="VBoxContainer" parent="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements/MarginContainer"]
margin_right = 544.0
margin_bottom = 593.0
margin_bottom = 626.0
mouse_filter = 2
__meta__ = {
"_edit_use_anchors_": false
Expand Down Expand Up @@ -2481,6 +2489,13 @@ margin_right = 532.0
margin_bottom = 198.0
text = "Place things anywhere"

[node name="AutomaticTorchSlabsCheckbox" type="CheckBox" parent="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements/MarginContainer/VBoxContainer"]
margin_top = 169.0
margin_right = 532.0
margin_bottom = 198.0
pressed = true
text = "Automatic torch slabs"

[node name="GridContainer" type="GridContainer" parent="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements/MarginContainer/VBoxContainer"]
margin_top = 202.0
margin_right = 532.0
Expand Down Expand Up @@ -6659,6 +6674,7 @@ script = SubResource( 20 )
[connection signal="toggled" from="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements/MarginContainer/VBoxContainer/OwnableNaturalTerrain" to="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements" method="_on_OwnableNaturalTerrain_toggled"]
[connection signal="toggled" from="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements/MarginContainer/VBoxContainer/EditableBordersCheckbox" to="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements" method="_on_EditableBordersCheckbox_toggled"]
[connection signal="toggled" from="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements/MarginContainer/VBoxContainer/PlaceThingsAnywhere" to="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements" method="_on_PlaceThingsAnywhere_toggled"]
[connection signal="toggled" from="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements/MarginContainer/VBoxContainer/AutomaticTorchSlabsCheckbox" to="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements" method="_on_AutomaticTorchSlabsCheckbox_toggled"]
[connection signal="pressed" from="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements/MarginContainer/VBoxContainer/GridContainer/AutoWallArtButton" to="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements" method="_on_AutoWallArtButton_pressed"]
[connection signal="focus_exited" from="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements/MarginContainer/VBoxContainer/GridContainer/DamagedWallLineEdit" to="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabPlacements" method="_on_DamagedWallLineEdit_focus_exited"]
[connection signal="toggled" from="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabUI/VBoxContainer/CheckBoxHideUnknown" to="Ui/UiSystem/PreferencesWindow" method="_on_CheckBoxHideUnknown_toggled"]
Expand Down
12 changes: 6 additions & 6 deletions Scenes/OnlyOwnership.gd
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ func initialize_grid_items():

var keeperColourIconPic = id.get_node("TextureRect")
match i:
0: keeperColourIconPic.texture = load("res://edited_images/plyrsym_32/symbol_player_red_std.png")
1: keeperColourIconPic.texture = load("res://edited_images/plyrsym_32/symbol_player_blue_std.png")
2: keeperColourIconPic.texture = load("res://edited_images/plyrsym_32/symbol_player_green_std.png")
3: keeperColourIconPic.texture = load("res://edited_images/plyrsym_32/symbol_player_yellow_std.png")
4: keeperColourIconPic.texture = load("res://edited_images/plyrsym_32/symbol_player_white_2.png")
5: keeperColourIconPic.texture = load("res://edited_images/plyrsym_32/symbol_player_any_dis.png")
0: keeperColourIconPic.texture = preload("res://edited_images/plyrsym_32/symbol_player_red_std.png")
1: keeperColourIconPic.texture = preload("res://edited_images/plyrsym_32/symbol_player_blue_std.png")
2: keeperColourIconPic.texture = preload("res://edited_images/plyrsym_32/symbol_player_green_std.png")
3: keeperColourIconPic.texture = preload("res://edited_images/plyrsym_32/symbol_player_yellow_std.png")
4: keeperColourIconPic.texture = preload("res://edited_images/plyrsym_32/symbol_player_white_2.png")
5: keeperColourIconPic.texture = preload("res://edited_images/plyrsym_32/symbol_player_any_dis.png")

oGridContainer.add_child(id)

Expand Down
12 changes: 6 additions & 6 deletions Scenes/OwnerSelection.gd
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ func _ready():

var setText = ""
match i:
0: id.texture_normal = load("res://edited_images/plyrsym_32/symbol_player_red_std.png")
1: id.texture_normal = load("res://edited_images/plyrsym_32/symbol_player_blue_std.png")
2: id.texture_normal = load("res://edited_images/plyrsym_32/symbol_player_green_std.png")
3: id.texture_normal = load("res://edited_images/plyrsym_32/symbol_player_yellow_std.png")
4: id.texture_normal = load("res://edited_images/plyrsym_32/symbol_player_white_2.png")
5: id.texture_normal = load("res://edited_images/plyrsym_32/symbol_player_any_dis.png")
0: id.texture_normal = preload("res://edited_images/plyrsym_32/symbol_player_red_std.png")
1: id.texture_normal = preload("res://edited_images/plyrsym_32/symbol_player_blue_std.png")
2: id.texture_normal = preload("res://edited_images/plyrsym_32/symbol_player_green_std.png")
3: id.texture_normal = preload("res://edited_images/plyrsym_32/symbol_player_yellow_std.png")
4: id.texture_normal = preload("res://edited_images/plyrsym_32/symbol_player_white_2.png")
5: id.texture_normal = preload("res://edited_images/plyrsym_32/symbol_player_any_dis.png")
setText = Constants.ownershipNames[i]

add_child_to_grid(id, setText)
Expand Down
2 changes: 1 addition & 1 deletion Scenes/PickSlabWindow.gd
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func add_slabs():
for slabID in allSlabIDs:
var putIntoTab = Slabs.data[slabID][Slabs.EDITOR_TAB]
if putIntoTab != Slabs.TAB_NONE:
var scene = load("res://Scenes/SlabDisplay.tscn")
var scene = preload("res://Scenes/SlabDisplay.tscn")
var id = scene.instance()
var slabVariation

Expand Down
7 changes: 4 additions & 3 deletions Scenes/Selection.gd
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ onready var oMirrorPlacementCheckBox = Nodelist.list["oMirrorPlacementCheckBox"]
onready var oLoadingBar = Nodelist.list["oLoadingBar"]
onready var oBrushPreview = Nodelist.list["oBrushPreview"]
onready var oPlaceThingsAnywhere = Nodelist.list["oPlaceThingsAnywhere"]
onready var oSlabSideViewer = Nodelist.list["oSlabSideViewer"]

enum {
CONSTRUCT_BRUSH
Expand All @@ -52,8 +53,7 @@ var paintSubtype = null setget newPaintSubtype
var paintOwnership = 0 setget newOwnership

func _process(delta):
get_slab_under_cursor()

update_under_cursor()
clean_up_cursor_array()

if oSelector.mode == oSelector.MODE_SUBTILE:
Expand Down Expand Up @@ -92,9 +92,10 @@ func newPaintSlab(value):
oPickThingWindow.set_selection(null, null) # Deselect anything in thing window
paintSlab = value

func get_slab_under_cursor():
func update_under_cursor():
cursorOverSlab = oSelector.get_slabID_at_pos(oSelector.cursorTile)
cursorOverSlabOwner = oDataOwnership.get_cellv(oSelector.cursorTile)
oSlabSideViewer.update_side()

func update_paint():
match oSelector.mode:
Expand Down
4 changes: 1 addition & 3 deletions Scenes/Selector.gd
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ onready var oLoadingBar = Nodelist.list["oLoadingBar"]
onready var oBrushPreview = Nodelist.list["oBrushPreview"]
onready var oDataClm = Nodelist.list["oDataClm"]
onready var oDataClmPos = Nodelist.list["oDataClmPos"]

onready var oSlabSideViewer = Nodelist.list["oSlabSideViewer"]

onready var TILE_SIZE = Constants.TILE_SIZE
onready var SUBTILE_SIZE = Constants.SUBTILE_SIZE
Expand Down Expand Up @@ -135,8 +135,6 @@ func mouse_button_on_field():
oInspector.inspect_something(oSelection.cursorOnInstancesArray[0])
else:
oInspector.deselect()



# Holding down button
if Input.is_action_pressed("mouse_left"):
Expand Down
Loading

0 comments on commit 7b1420a

Please sign in to comment.