Skip to content

Commit

Permalink
Merge pull request #1091 from Zurphing/mapstudio-updates
Browse files Browse the repository at this point in the history
[Kh2MapStudio] Various MapStudio Updates & Fixes
  • Loading branch information
shananas authored Aug 1, 2024
2 parents 3c13a1d + 85ef365 commit 8807c94
Show file tree
Hide file tree
Showing 14 changed files with 1,517 additions and 705 deletions.
17 changes: 15 additions & 2 deletions OpenKh.Kh2/ModelMultiple.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
using System;
using System;
using System.IO;

namespace OpenKh.Kh2
{
public class ModelMultiple : Model
{
private bool _isParsedSuccessfully;
private string _errorMessage;

public ModelMultiple(Stream stream)
{
throw new NotImplementedException();
try
{
//Parse Logic, doesn't work for now but fixes the crash for tr02/etc.
_isParsedSuccessfully = true;
}
catch (Exception ex)
{
_isParsedSuccessfully = false;
_errorMessage = ex.Message;
}
}


public override int GroupCount => 0;

protected override void InternalWrite(Stream stream)
Expand Down
17 changes: 17 additions & 0 deletions OpenKh.Tools.Common.CustomImGui/ImGuiEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,23 @@ public static void ForCombo(string name, string[] items, Func<int> getter, Actio
var value = getter();
if (ImGui.Combo(name, ref value, items, items.Length))
setter(value);
}

//Used for custom color/opacity in kh2mapstudio/eventactivators
public static void ForEdit5(string name, Func<float> getter, Action<float> setter, float speed = 0.01f)
{
var value = getter();
if (ImGui.DragFloat(name, ref value, speed))
setter(value);
}

public static bool ForEdit(string label, Func<Vector3> get, Action<Vector3> set)
{
var value = get();
var modified = ImGui.InputFloat3(label, ref value);
if (modified)
set(value);
return modified;
}
}
}
Loading

0 comments on commit 8807c94

Please sign in to comment.