Skip to content

Commit

Permalink
v0.0.3
Browse files Browse the repository at this point in the history
- Added option to be able to change the ID/Position of the object
- Added a menu that appears when you click "All", "Male" or "Female" which allows you to import a file or an entire folder.
- The necessary libraries have been included in the repository.
  • Loading branch information
TMMarkus authored Apr 19, 2023
2 parents 4d27897 + 112be71 commit 165219a
Show file tree
Hide file tree
Showing 23 changed files with 313 additions and 122 deletions.
4 changes: 2 additions & 2 deletions AkinaRPTool/AkinaRPTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
</ItemGroup>
<ItemGroup>
<Reference Include="RageLib">
<HintPath>..\packages\RageLib\RageLib.dll</HintPath>
<HintPath>..\libraries\RageLib\RageLib.dll</HintPath>
</Reference>
<Reference Include="RageLib.GTA5">
<HintPath>..\packages\RageLib\RageLib.GTA5.dll</HintPath>
<HintPath>..\libraries\RageLib\RageLib.GTA5.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions AkinaRPTool/ClothData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ public int Posi
{
return posi;
}
set
{
posi = value;
OnPropertyChanged("Posi");
}
}

public ClothData()
Expand Down
65 changes: 58 additions & 7 deletions AkinaRPTool/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:local="clr-namespace:AkinaRPTool"
xmlns:Properties="clr-namespace:AkinaRPTool.Properties" x:Class="AkinaRPTool.MainWindow"
mc:Ignorable="d"
Title="[Alpha v0.0.2] AkinaRP Clothes Tool by TMMarkus" Height="450" Width="800" Icon="icon_alpha.ico">
Title="[Alpha v0.0.3] AkinaRP Clothes Tool by TMMarkus" Height="450" Width="800" Icon="icon_alpha.ico">
<Grid>
<ProgressBar x:Name="currentProgress" Height="3" VerticalAlignment="Bottom" Background="White" BorderBrush="White" Value="0"/>
<TextBlock x:Name="currentStatusBar" Height="20" Margin="0" TextWrapping="Wrap" VerticalAlignment="Bottom" Background="{x:Null}" Padding="5,0,0,0">
Expand Down Expand Up @@ -165,9 +165,36 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<Button x:Name="addAllClothes" Content="⚥ All" Click="AddAllClothes_Click" Grid.Column="0" FontSize="10"/>
<Button x:Name="addMaleClothes" Content="♂ Male" Click="AddMaleClothes_Click" Grid.Column="1" FontSize="10"/>
<Button x:Name="addFemaleClothes" Content="♀ Female" Click="AddFemaleClothes_Click" Grid.Column="2" FontSize="10"/>
<Button x:Name="addAllClothes" Content="⚥ All" Click="OpenMenu_Click" Grid.Column="0" FontSize="10">
<Button.ContextMenu>
<ContextMenu>
<MenuItem Header="Import folder..." Click="AddAllClothes_Click_Folder" />
<MenuItem Header="Import file..." Click="AddAllClothes_Click_File" />
</ContextMenu>
</Button.ContextMenu>
</Button>



<Button x:Name="addMaleClothes" Content="♂ Male" Click="OpenMenu_Click" Grid.Column="1" FontSize="10">
<Button.ContextMenu>
<ContextMenu>
<MenuItem Header="Import folder..." Click="AddMaleClothes_Click_Folder" />
<MenuItem Header="Import file..." Click="AddMaleClothes_Click_File" />
</ContextMenu>
</Button.ContextMenu>
</Button>


<Button x:Name="addFemaleClothes" Content="♀ Female" Click="OpenMenu_Click" Grid.Column="2" FontSize="10">
<Button.ContextMenu>
<ContextMenu>
<MenuItem Header="Import folder..." Click="AddFemaleClothes_Click_Folder" />
<MenuItem Header="Import file..." Click="AddFemaleClothes_Click_File" />
</ContextMenu>
</Button.ContextMenu>
</Button>

<Button x:Name="removeUnderCursor" Content="❌ Remove" Click="RemoveUnderCursor_Click" Grid.Column="3" FontSize="10"/>
</Grid>
</Grid>
Expand All @@ -184,17 +211,41 @@

<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="75"/>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>

<Grid Grid.Column="0">
<GroupBox Header="Item name">
<TextBox x:Name="drawableName" TextWrapping="Wrap" VerticalAlignment="Top" TextChanged="DrawableName_TextChanged" BorderBrush="{x:Null}"/>
<GroupBox Header="ID">
<Grid>

<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="25" />
</Grid.ColumnDefinitions>

<TextBox Grid.Column="0" x:Name="ID" IsEnabled="False" TextWrapping="Wrap" IsReadOnly="True" VerticalAlignment="Stretch" FontSize="12" Background="Transparent" BorderBrush="{x:Null}" MaxLines="1" />

<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="20" />
<RowDefinition Height="20" />
</Grid.RowDefinitions>
<Button Content="⬆️" FontSize="12" x:Name="PlusID" Click="PlusID_Click" Grid.Row="0"/>
<Button Content="⬇️" FontSize="12" x:Name="RestID" Click="RestID_Click" Grid.Row="1"/>
</Grid>
</Grid>
</GroupBox>
</Grid>

<Grid Grid.Column="1">
<GroupBox Header="Item name">
<TextBox x:Name="drawableName" TextWrapping="Wrap" VerticalAlignment="Center" TextChanged="DrawableName_TextChanged" BorderBrush="{x:Null}"/>
</GroupBox>
</Grid>

<Grid Grid.Column="2">
<GroupBox Header="First person model">
<Grid>
<TextBox x:Name="fpModelPath" VerticalAlignment="Stretch" Margin="0, 0, 100, 0" Text="Not selected..." FontSize="12" Background="Transparent" BorderBrush="{x:Null}" IsEnabled="False" IsReadOnly="True" IsUndoEnabled="False" MaxLines="1"/>
Expand Down
84 changes: 81 additions & 3 deletions AkinaRPTool/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
using Microsoft.Win32;
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using static AkinaRPTool.ClothData;
using static System.Net.Mime.MediaTypeNames;

namespace AkinaRPTool
{
Expand All @@ -16,6 +21,7 @@ public partial class MainWindow : Window
public static ObservableCollection<ClothData> femaleClothes;
private static ClothData selectedCloth = null;
public static ProjectBuild projectBuildWindow = null;


public MainWindow()
{
Expand Down Expand Up @@ -66,17 +72,41 @@ public static void SetProgress(double progress)
statusProgress.Value = statusProgress.Maximum * progress;
}

private void AddAllClothes_Click(object sender, RoutedEventArgs e)
private void OpenMenu_Click(object sender, RoutedEventArgs e)
{
// Mostrar el menú en la posición del cursor del mouse
Button boton = (Button)sender;
boton.ContextMenu.PlacementTarget = boton;
boton.ContextMenu.Placement = System.Windows.Controls.Primitives.PlacementMode.MousePoint;
boton.ContextMenu.IsOpen = true;
}

private void AddAllClothes_Click_Folder(object sender, RoutedEventArgs e)
{
ProjectController.Instance().ShowFolderSelection(Sex.All);
}

private void AddAllClothes_Click_File(object sender, RoutedEventArgs e)
{
ProjectController.Instance().AddFiles(Sex.All);
}

private void AddMaleClothes_Click(object sender, RoutedEventArgs e)
private void AddMaleClothes_Click_Folder(object sender, RoutedEventArgs e)
{
ProjectController.Instance().ShowFolderSelection(Sex.Male);
}

private void AddMaleClothes_Click_File(object sender, RoutedEventArgs e)
{
ProjectController.Instance().AddFiles(Sex.Male);
}

private void AddFemaleClothes_Click(object sender, RoutedEventArgs e)
private void AddFemaleClothes_Click_Folder(object sender, RoutedEventArgs e)
{
ProjectController.Instance().ShowFolderSelection(Sex.Female);
}

private void AddFemaleClothes_Click_File(object sender, RoutedEventArgs e)
{
ProjectController.Instance().AddFiles(Sex.Female);
}
Expand Down Expand Up @@ -116,6 +146,53 @@ private void RemoveUnderCursor_Click(object sender, RoutedEventArgs e)
}
}

private void RestID_Click(object sender, RoutedEventArgs e)
{
if (selectedCloth != null && selectedCloth.Posi > 0)
{
int oldPosi = 1;
int newPosi = 0;
oldPosi = selectedCloth.Posi;
newPosi = selectedCloth.Posi - 1;

ClothData oldCloth = clothes[oldPosi];
ClothData newCloth = clothes[newPosi];

oldCloth.Posi = newPosi;
newCloth.Posi = oldPosi;

clothes[newPosi] = oldCloth;
clothes[oldPosi] = newCloth;

ID.Text = newPosi.ToString();

ProjectController.Instance().UpdateClothesList();
}
}

private void PlusID_Click(object sender, RoutedEventArgs e)
{
if (selectedCloth != null && selectedCloth.Posi < clothes.Count - 1) {
int oldPosi = 1;
int newPosi = 0;
oldPosi = selectedCloth.Posi;
newPosi = selectedCloth.Posi + 1;

ClothData oldCloth = clothes[oldPosi];
ClothData newCloth = clothes[newPosi];

oldCloth.Posi = newPosi;
newCloth.Posi = oldPosi;

clothes[newPosi] = oldCloth;
clothes[oldPosi] = newCloth;

ID.Text = newPosi.ToString();

ProjectController.Instance().UpdateClothesList();
}
}

private void ClothesListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.AddedItems.Count > 0)
Expand All @@ -142,6 +219,7 @@ private void ClothesListBox_SelectionChanged(object sender, SelectionChangedEven
unkFlag4Check.IsChecked = selectedCloth.componentFlags.unkFlag4;
isHighHeelsCheck.IsChecked = selectedCloth.componentFlags.isHighHeels;
isReskinCheck.IsChecked = selectedCloth.isReskin;
ID.Text = selectedCloth.Posi.ToString();
}
else
{
Expand Down
Loading

0 comments on commit 165219a

Please sign in to comment.