mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-06-01 13:03:39 -05:00
"add" button for new scripts
This commit is contained in:
parent
b3336d2bb8
commit
a397cf1c71
|
|
@ -1274,11 +1274,22 @@ show:
|
|||
|
||||
public int ScriptAddress {
|
||||
get => element.GetAddress("script");
|
||||
set => element.SetAddress("script", value);
|
||||
set {
|
||||
element.SetAddress("script", value);
|
||||
NotifyPropertyChanged(nameof(CanCreateScript));
|
||||
}
|
||||
}
|
||||
|
||||
public void GotoScript() => gotoAddress(ScriptAddress);
|
||||
|
||||
public bool CanCreateScript => ScriptAddress == Pointer.NULL;
|
||||
public void CreateScript() {
|
||||
var start = element.Model.FindFreeSpace(element.Model.FreeSpaceStart, 0x10);
|
||||
Token.ChangeData(element.Model, start, 2);
|
||||
ScriptAddress = start;
|
||||
gotoAddress(start);
|
||||
}
|
||||
|
||||
private string scriptAddressText;
|
||||
public string ScriptAddressText {
|
||||
get {
|
||||
|
|
|
|||
|
|
@ -703,6 +703,11 @@
|
|||
Width="22" Height="18" IsTabStop="False" Padding="0,2" BorderBrush="{DynamicResource Backlight}">
|
||||
<Path Data="{res:Icon RightAngleArrow}" Fill="{DynamicResource Secondary}" Stretch="Fill" />
|
||||
</local:AngleButton>
|
||||
<local:AngleButton Command="{res:MethodCommand CreateScript}" Direction="Right" Grid.Row="7" Grid.Column="1" HorizontalAlignment="Right"
|
||||
Visibility="{Binding CanCreateScript, Converter={StaticResource BoolToVisibility}}"
|
||||
Width="22" Height="18" IsTabStop="False" Padding="0,2" BorderBrush="{DynamicResource Backlight}">
|
||||
<Path Data="{res:Icon Add}" Fill="{DynamicResource Secondary}" Stretch="Fill" />
|
||||
</local:AngleButton>
|
||||
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user