Class PaintSurfaceTransparencyUserToolStateBase<TBrushTarget, TTerrainLayer>
Inheritance
Implements
Inherited Members
Namespace: Fwt.HexTerrains.UserTools.SM.States
Assembly: fwt.hexterrains.dll
Syntax
public abstract class PaintSurfaceTransparencyUserToolStateBase<TBrushTarget, TTerrainLayer> : BrushUserToolState<TBrushTarget, UserToolSettingsDataSource, UniversalToolSettingsScreen, TTerrainLayer>, ISmState where TBrushTarget : ChunkMeshLayerGroup where TTerrainLayer : ChunkMeshLayer
Type Parameters
| Name | Description |
|---|---|
| TBrushTarget | |
| TTerrainLayer |
Constructors
PaintSurfaceTransparencyUserToolStateBase(ISmState)
Declaration
protected PaintSurfaceTransparencyUserToolStateBase(ISmState parent)
Parameters
| Type | Name | Description |
|---|---|---|
| ISmState | parent |
Fields
ReadPropKey
When this key is pressed, click will read value under cursor instead of applying it
Declaration
public KeyCode ReadPropKey
Field Value
| Type | Description |
|---|---|
| KeyCode |
Properties
IsTransparent
Declaration
public bool IsTransparent { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
TerrainLayerIndex
If IsGetLayerByIndex is true, this index is used to get terrain layer from terrain layers list."/>
Declaration
public override int TerrainLayerIndex { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Overrides
UserToolType
Type identifier for the user tool. Allows state machine to change states based on tool type instead of state index.
Declaration
public override int UserToolType { get; }
Property Value
| Type | Description |
|---|---|
| int |
Overrides
Methods
ApplyBrush(int, int2, int, TBrushTarget, int)
Applies brush to the brushView. Returns true if changes were applied
Declaration
public override bool ApplyBrush(int brushMode, int2 cellCoord, int cellIndex, TBrushTarget brushTarget, int mouseButton)
Parameters
| Type | Name | Description |
|---|---|---|
| int | brushMode | |
| int2 | cellCoord | |
| int | cellIndex | |
| TBrushTarget | brushTarget | |
| int | mouseButton |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
Init(UserToolStateSettings)
Initializes the tool state with the specified settings.
Declaration
public override void Init(UserToolStateSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| UserToolStateSettings | settings | The settings to apply to the tool state. Cannot be null. |
Overrides
InitDefaultSettings()
Initializes the default settings for the current instance. This method is intended to be overridden in derived classes to configure initial values or options as needed.
Declaration
protected override void InitDefaultSettings()
Overrides
Remarks
Override this method in a subclass to provide custom initialization logic for default settings. The base implementation does not perform any actions.
Init<TInitArgs>(TInitArgs)
Initializes the tool using the specified initialization arguments.
Declaration
public override void Init<TInitArgs>(TInitArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| TInitArgs | args | The initialization arguments used to configure the tool. If the argument implements IUserToolStateConfig, its ToolSettings are used; otherwise, default settings are applied. |
Type Parameters
| Name | Description |
|---|---|
| TInitArgs | The type of the initialization arguments used to configure the tool. If the type implements IUserToolStateConfig, its ToolSettings will be used; otherwise, default settings are applied. |
Overrides
IsAppliedToEveryCellOnMap(int)
Determines whether the specified brush mode applies to every cell on the map.
Declaration
public override bool IsAppliedToEveryCellOnMap(int brushMode)
Parameters
| Type | Name | Description |
|---|---|---|
| int | brushMode | The brush mode to evaluate. Typically, a value of 1 indicates that the brush is applied to all cells. |
Returns
| Type | Description |
|---|---|
| bool | true if the brush mode applies to every cell on the map; otherwise, false. |
Overrides
LoadSettings()
Loads configuration settings for the current instance. Derived classes override this method to implement custom settings initialization.
Declaration
protected override void LoadSettings()
Overrides
Remarks
Override this method in a subclass to provide specific logic for loading or initializing settings. This method is called during the setup or initialization phase and does not perform any actions in the base implementation.
ReadCellData(int, TBrushTarget)
Declaration
protected virtual bool ReadCellData(int cellIndex, TBrushTarget brushTarget)
Parameters
| Type | Name | Description |
|---|---|---|
| int | cellIndex | |
| TBrushTarget | brushTarget |
Returns
| Type | Description |
|---|---|
| bool |
SaveSettings()
Saves the current settings to the underlying storage or configuration source.
Declaration
protected override void SaveSettings()
Overrides
Remarks
Override this method in a derived class to implement custom logic for persisting settings. This method does not perform any action in the base implementation.