Skip to content

Commit

Permalink
wall side alpha setting
Browse files Browse the repository at this point in the history
  • Loading branch information
rainlizard committed Nov 11, 2023
1 parent 7b1420a commit f0b50c4
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Autoload/Settings.gd
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var listOfSettings = [
"smooth_pan_enabled",
"smoothing_rate",
"graphics_ownership_alpha",
"hover_wall_side_alpha",
"display_fps",
"mouse_sensitivity",
"fov",
Expand Down Expand Up @@ -214,6 +215,10 @@ func game_setting(doWhat,string,value):
var oOverheadOwnership = $'../Main/Game2D/OverheadOwnership'
if doWhat == SET: oOverheadOwnership.OWNERSHIP_ALPHA = value
if doWhat == GET: return oOverheadOwnership.OWNERSHIP_ALPHA
"hover_wall_side_alpha":
var oSlabSideViewer = $'../Main/Game2D/Selector/TileSelector/SlabSideViewer'
if doWhat == SET: oSlabSideViewer.WALLSIDE_ALPHA = value
if doWhat == GET: return oSlabSideViewer.WALLSIDE_ALPHA
"display_fps":
var oFPScounter = $'../Main/Ui/UiMessages/FPScounter'
if doWhat == SET: oFPScounter.visible = value
Expand Down
9 changes: 9 additions & 0 deletions Scenes/Main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -2705,6 +2705,15 @@ margin_right = 532.0
margin_bottom = 406.0
settingText = "Ownership alpha"

[node name="WallSideAlpha" parent="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabUI/VBoxContainer" instance=ExtResource( 16 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 0.0
margin_top = 375.0
margin_right = 532.0
margin_bottom = 406.0
settingText = "Wall side alpha"

[node name="CheckBoxHideUnknown" type="CheckBox" parent="Ui/UiSystem/PreferencesWindow/VBoxContainer/TabSettings/TabUI/VBoxContainer"]
margin_top = 410.0
margin_right = 532.0
Expand Down
6 changes: 4 additions & 2 deletions Scenes/SettingsWindow.gd
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ onready var oPickThingWindow = Nodelist.list["oPickThingWindow"]
onready var oUiScale = Nodelist.list["oUiScale"]
onready var oFramerateLimit = Nodelist.list["oFramerateLimit"]
onready var oOwnerAlpha = Nodelist.list["oOwnerAlpha"]
onready var oWallSideAlpha = Nodelist.list["oWallSideAlpha"]
onready var oScriptEditorFontSize = Nodelist.list["oScriptEditorFontSize"]
onready var oEditorFontSize = Nodelist.list["oEditorFontSize"]
onready var oCheckBoxNewMapAutoOpensMapSettings = Nodelist.list["oCheckBoxNewMapAutoOpensMapSettings"]
Expand Down Expand Up @@ -78,6 +79,7 @@ func _on_SettingsWindow_about_to_show():
oThingWindowScale.update_appearance(Settings.get_setting("thing_window_scale"))
oCheckBoxHideUnknown.pressed = Settings.get_setting("hide_unknown_data")
oOwnerAlpha.update_appearance(Settings.get_setting("graphics_ownership_alpha"))
oWallSideAlpha.update_appearance(Settings.get_setting("hover_wall_side_alpha"))
oCreatureLevelFontSizeScale.update_appearance(Settings.get_setting("font_size_creature_level_scale"))
oCreatureLevelFontSizeMaxZoom.update_appearance(Settings.get_setting("font_size_creature_level_max"))
oSciptIconScale.update_appearance(Settings.get_setting("script_icon_scale"))
Expand Down Expand Up @@ -126,8 +128,8 @@ func edited_ZoomStep(new_text):
func edited_SmoothingRate(new_text):
Settings.set_setting("smoothing_rate", float(new_text))

func _on_OwnerAlphaSlider_value_changed(value):
Settings.set_setting("graphics_ownership_alpha", float(value))
func edited_WallSideAlpha(value):
Settings.set_setting("hover_wall_side_alpha", float(value))

func edited_MouseSensitivity(new_text):
Settings.set_setting("mouse_sensitivity", float(new_text))
Expand Down
2 changes: 1 addition & 1 deletion Scenes/SlabPlacement.gd
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func place_shape_of_slab_id(shapePositionArray, slabID, ownership):
oDataSlab.set_cellv(pos, slabID)

if oFortifyCheckBox.pressed == true:
if ownership != 5 and slabID != Slabs.WALL_AUTOMATIC:
if ownership != 5 and slabID != Slabs.WALL_AUTOMATIC and Slabs.auto_wall_updates_these.has(slabID) == false:
surroundingPositions[Vector2(pos.x - 1, pos.y)] = 1
surroundingPositions[Vector2(pos.x + 1, pos.y)] = 1
surroundingPositions[Vector2(pos.x, pos.y - 1)] = 2
Expand Down
5 changes: 4 additions & 1 deletion Scenes/SlabSideViewer.gd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
extends Control
onready var oSelection = Nodelist.list["oSelection"]

var WALLSIDE_ALPHA = 0.0
var sd

func _ready():
Expand All @@ -10,12 +11,14 @@ func _ready():
add_child(sd)

func update_side():
if Slabset.dat.empty() == true: return

var slabID = oSelection.cursorOverSlab
if Slabs.data[slabID][Slabs.IS_SOLID] == false:
sd.modulate.a = 0
return

sd.modulate.a = 0.75
sd.modulate.a = WALLSIDE_ALPHA

var slabVariation = slabID*28
var columnArray = [0,0,0, 0,0,0, 0,0,0]
Expand Down

0 comments on commit f0b50c4

Please sign in to comment.