Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AssetEditor/Language_En.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"SettingsWindow.LoadGameFileOnStartup": "Load game file on startup",
"SettingsWindow.ShowCaWems": "Show CA audio (.wem) files",
"SettingsWindow.Rendering": "Rendering",
"SettingsWindow.CameraMode": "3D camera mode",
"SettingsWindow.RenderBackground": "Render engine background colour",
"SettingsWindow.OnlyLoadLod0": "Only load Lod0 for reference meshes",
"SettingsWindow.GridSize": "Grid Size",
Expand Down
7 changes: 7 additions & 0 deletions AssetEditor/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ partial class SettingsViewModel : ObservableObject
public ObservableCollection<BackgroundColour> RenderEngineBackgroundColours { get; set; } = [];
public ObservableCollection<GameTypeEnum> Games { get; set; } = [];
public ObservableCollection<GamePathItem> GameDirectores { get; set; } = [];
public ObservableCollection<CameraControlMode> CameraModes { get; set; } = [];

[ObservableProperty] private string _selectedLanguage;
[ObservableProperty] private ThemeType _currentTheme;
Expand All @@ -33,6 +34,7 @@ partial class SettingsViewModel : ObservableObject
[ObservableProperty] private bool _showCAWemFiles;
[ObservableProperty] private string _wwisePath;
[ObservableProperty] private bool _onlyLoadLod0ForReferenceMeshes;
[ObservableProperty] private CameraControlMode _selectedCameraMode;

public SettingsViewModel(ApplicationSettingsService settingsService, LocalizationManager localizationManager)
{
Expand All @@ -47,13 +49,16 @@ public SettingsViewModel(ApplicationSettingsService settingsService, Localizatio
RenderEngineBackgroundColours = new ObservableCollection<BackgroundColour>((BackgroundColour[])Enum.GetValues(typeof(BackgroundColour)));
CurrentRenderEngineBackgroundColour = _settingsService.CurrentSettings.RenderEngineBackgroundColour;
VisualEditorsGridSize = _settingsService.CurrentSettings.VisualEditorsGridSize;
CameraModes = new ObservableCollection<CameraControlMode>((CameraControlMode[])Enum.GetValues(typeof(CameraControlMode)));

StartMaximised = _settingsService.CurrentSettings.StartMaximised;
Games = new ObservableCollection<GameTypeEnum>(GameInformationDatabase.Games.Values.OrderBy(game => game.DisplayName).Select(game => game.Type));
CurrentGame = _settingsService.CurrentSettings.CurrentGame;
LoadCaPacksByDefault = _settingsService.CurrentSettings.LoadCaPacksByDefault;
ShowCAWemFiles = _settingsService.CurrentSettings.ShowCAWemFiles;
OnlyLoadLod0ForReferenceMeshes = _settingsService.CurrentSettings.OnlyLoadLod0ForReferenceMeshes;
SelectedCameraMode = _settingsService.CurrentSettings.CameraControlMode;

foreach (var game in GameInformationDatabase.Games.Values.OrderBy(game => game.DisplayName))
{
GameDirectores.Add(
Expand Down Expand Up @@ -81,6 +86,8 @@ private void Save()
_settingsService.CurrentSettings.SelectedLangauge = SelectedLanguage;
_settingsService.CurrentSettings.OnlyLoadLod0ForReferenceMeshes = OnlyLoadLod0ForReferenceMeshes;
_settingsService.CurrentSettings.GameDirectories.Clear();
_settingsService.CurrentSettings.CameraControlMode = SelectedCameraMode;

foreach (var item in GameDirectores)
_settingsService.CurrentSettings.GameDirectories.Add(new ApplicationSettings.GamePathPair() { Game = item.GameType, Path = item.Path });
_settingsService.CurrentSettings.WwisePath = WwisePath;
Expand Down
5 changes: 5 additions & 0 deletions AssetEditor/Views/Settings/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<TextBlock Grid.Row="0" Text="{loc:Loc SettingsWindow.Application}" Margin="5, 10, 0, 0" FontSize="15"/>
Expand All @@ -76,6 +77,10 @@

<TextBlock Grid.Row="7" Grid.Column="0" Text="{loc:Loc SettingsWindow.ShowCaWems}" Margin="5, 0, 0, 0"/>
<CheckBox Grid.Row="7" Grid.Column="1" Margin="-1, 0, 0, 5" IsChecked="{Binding ShowCAWemFiles, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>

<TextBlock Grid.Row="8" Text="{loc:Loc SettingsWindow.CameraMode}" Margin="5, 0, 0, 0"/>
<ComboBox Grid.Row="8" Grid.Column="1" Margin="0, 0, 0, 5" SelectedItem="{Binding SelectedCameraMode, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
ItemsSource="{Binding CameraModes}"/>
</Grid>


Expand Down
4 changes: 3 additions & 1 deletion AssetEditor/Views/Settings/SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
xmlns:local="clr-namespace:AssetEditor.Views.Settings"
xmlns:loc="clr-namespace:Shared.Ui.Common;assembly=Shared.Ui"
mc:Ignorable="d"
Title="Settings" Height="685" Width="850"
Title="Settings"
SizeToContent="WidthAndHeight"
ContentRendered="Window_OnContentRendered"
Style="{StaticResource CustomWindowStyle}"
ResizeMode="NoResize">
<Grid>
Expand Down
8 changes: 7 additions & 1 deletion AssetEditor/Views/Settings/SettingsWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Windows;
using System;
using System.Windows;

namespace AssetEditor.Views.Settings
{
Expand All @@ -16,5 +17,10 @@ private void Button_Click(object sender, RoutedEventArgs e)
{
Close();
}

private void Window_OnContentRendered(object sender, EventArgs e)
{
InvalidateVisual();
}
}
}
179 changes: 179 additions & 0 deletions Documentation/AssetEditorDocumentation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Asset Editor Documentation</title>

<style>
body {
margin: 0;
font-family: Arial, sans-serif;
display: flex;
height: 100vh;
}

/* loadWithFallback is defined in the script section */

.sidebar {
width: 320px;
background: #f8f9fb;
border-right: 1px solid #ddd;
padding: 15px;
box-sizing: border-box;
}

.sidebar-header {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
}

.sidebar-header img {
width: 28px;
}

.language-select {
margin-bottom: 20px;
}

.file-list a {
display: block;
padding: 6px 0;
text-decoration: none;
color: #2b5fd9;
cursor: pointer;
}

.file-list a:hover {
text-decoration: underline;
}

.content {
flex: 1;
}

iframe {
width: 100%;
height: 100%;
border: none;
}
</style>
</head>

<body>

<div class="sidebar">

<div class="sidebar-header">
Asset Editor Documentation
<img src="icon.svg">
</div>

<div class="language-select">
Language:
<select id="languageSelector">
<option value="en">English</option>
<option value="no">Norwegian</option>
</select>
</div>

<div class="file-list" id="fileList"></div>

</div>

<div class="content">
<iframe id="docFrame"></iframe>
</div>

<script>

// MASTER PAGE LIST (language independent)
// Add an explicit 'langs' array for each doc to indicate available translations.
// The code will check this against the currently selected language and only
// attempt to load a localized file if that language is listed here. Otherwise
// it will load the English default.
const masterDocs = [
{ title: "Getting Started", base: "GettingStarted", langs: ["en", "no"] },
{ title: "PackFile Handling", base: "PackFileHandling", langs: ["en"] },
{ title: "Camera Control", base: "CameraControl", langs: ["en"] }
];





function resolveFile(baseName) {
// Return the single file path to load. If the selected language is
// supported for this document, return the localized filename; otherwise
// return the English default file. No runtime fallback attempts are used.
const selectElement = document.getElementById("languageSelector");
const currentLanguage = selectElement.value;
console.log("Selected Value:", currentLanguage);
const defaultLanguage = 'en';
const fallback = `Documentation/${baseName}.html`;

// Find doc entry to see which languages are available for this file.
const docEntry = masterDocs.find(d => d.base === baseName) || {};
const available = docEntry.langs || [defaultLanguage];

const file = (currentLanguage && currentLanguage !== defaultLanguage && available.includes(currentLanguage))
? `Documentation/${baseName}_${currentLanguage}.html`
: fallback;

console.log("Resolved file:", file);
return Promise.resolve(file);
}

function loadFile(frame, file) {
// Simple file load: set iframe src to the resolved file path.
frame.onload = null;
frame.onerror = null;
frame.src = file;
}

function loadSidebar() {

const list = document.getElementById("fileList");
list.innerHTML = "";

masterDocs.forEach(doc => {

const link = document.createElement("a");
link.textContent = doc.title;

link.onclick = async () => {
const file = await resolveFile(doc.base);
const frame = document.getElementById("docFrame");
loadFile(frame, file);
};

list.appendChild(link);
});

}

document.getElementById("languageSelector").addEventListener("change", e => {
// Rebuild sidebar links and load the first page in the newly selected language.
loadSidebar();
resolveFile(masterDocs[0].base).then(file => {
const frame = document.getElementById("docFrame");
loadFile(frame, file);
});
});

loadSidebar();

// Load first page initially
resolveFile(masterDocs[0].base).then(file => {
const frame = document.getElementById("docFrame");
loadFile(frame, file);
});

</script>

</body>
</html>
37 changes: 37 additions & 0 deletions Documentation/Documentation/CameraControl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

<!DOCTYPE html>
<html>
<head><meta charset="UTF-8"></head>
<body>
<h1>Camera control</h1>
<p>All 3d editors in AssetEditor has the same camera controls. The tool supports two different controll schemas - Blender style and AssetEditor Style. AssetEditor is the default. This can be changed under settings.</p>

<h2>Camera control - General</h2>
<ul>
<li><b>F4</b> - Resets camera back to start.</li>
<li><b>Numpad 1 / Ctrl + Numpad 1</b> - Set camera to front/back view</li>
<li><b>Numpad 3 / Ctrl + Numpad 3</b> - Set camera to left/right view</li>
<li><b>Numpad 7 / Ctrl + Numpad 7</b> - Set camera to Top/bottom view</li>
<li><b>Numpad 7</b> - Toggle perspective/orthographic camera</li>
<li><b>Numpad decimal</b> - Focus selected object</li>
<li><b>Spacebar</b> - View only selected camera</li>
</ul>
<p>Its also possible to press the corner of the top right gizmo to move the camera into orthographic mode.</p>

<h2>Camera control - AssetEditor Style</h2>
<ul>
<li><b>Ctrl + Mouse wheel</b> - Camera zoom</li>
<li><b>Ctrl + Left Mouse button</b> - Rotate the camera</li>
<li><b>Ctrl + Right Mouse button</b> - Move the camera</li>
</ul>

<h2>Camera control - Blender Style</h2>
<ul>
<li><b>Mouse wheel</b> - Camera zoom</li>
<li><b>Middle Mouse button</b> - Rotate the camera</li>
<li><b>Shift + Middle Mouse button</b> - Move the camera</li>
</ul>
<img src="Images\AssetEditor_Kitbash_Camera.png">

</body>
</html>
41 changes: 41 additions & 0 deletions Documentation/Documentation/GettingStarted.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

<!DOCTYPE html>
<html>
<head><meta charset="UTF-8"></head>
<body>
<h1>Getting Started</h1>
<h2>What is AssetEditor</h2>
<p>AssetEditor is a modding program for Total War games. The main focus of the tool is the Warhammer games, but a lot of the tools also work for older games.</p>

<p>The tool consists of the following editors</p>
<ul>
<li><b>KitbashEditor</b> - A simple to use 3d modelling program for editing meshes. </li>
<li><b>SuperView</b> - View and edit metafiles which effects how the game interact with animations. </li>
<li><b>AudioTool</b> - Edit sound events</li>
<li><b>SkeletonTool</b> - Edit skeletons</li>
<li><b>Animation Bin</b> - Edit or create animation sets</li>
</ul>



<h2>Configuring AssetEditor</h2>
<p>
When AssetEditor is opened for the first time, the settings window is displayed. The tool requires a game folder to be set for the selected game.
If its not set, the tool will not behave correctly. The settings window can also be accessed from the tool bar. File => Settings. Some settings changes require the tool to restart.
</p>
<img src="Images\AssetEditor_settings.png">

<h2>The basics</h2>
<p>
AssetEditor works as a "super editor", with multiple different editors for different files types. The general layout is like seen below.
</p>
<ul>
<li><b>Toolbar</b> - Tools and other functionality that works independently of selected editor </li>
<li><b>Editor Tabs</b> - A list of all open tabs. Open or close as needed </li>
<li><b>Selected Editor</b> - The editor surface of the selected editor</li>
<li><b>Editor Toolbar</b> - The toolbar for the current editor</li>
<li><b>PackFile explorer</b> - A tree view, just like windows file explorer. This allows you to view the content of selected packfiles.</li>
</ul>
<img src="Images\AssetEditor_basics.png">
</body>
</html>
10 changes: 10 additions & 0 deletions Documentation/Documentation/GettingStarted_no.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

<!DOCTYPE html>
<html>
<head><meta charset="UTF-8"></head>
<body>
<h1>Komme i gang (Norwegian)</h1>
<p>Dette er norsk versjon av siden.</p>
<img src="https://via.placeholder.com/400x200">
</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions Documentation/Documentation/ImportingAssets.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

<!DOCTYPE html>
<html>
<head><meta charset="UTF-8"></head>
<body>
<h1>Importing Assets (English default)</h1>
<p>This explains asset importing.</p>
<img src="https://via.placeholder.com/400x200">
</body>
</html>
Loading
Loading