Ejemplo n.º 1
0
    private static bool DrawMatrixInput(float width, ref Matrix4x4 matrix)
    {
        using var table = ImRaii.Table(string.Empty, 5, ImGuiTableFlags.BordersInner | ImGuiTableFlags.SizingFixedFit);
        if (!table)
        {
            return(false);
        }

        var changes = false;

        ImGui.TableNextColumn();
        ImGui.TableNextColumn();
        ImGuiUtil.Center("R");
        ImGui.TableNextColumn();
        ImGuiUtil.Center("G");
        ImGui.TableNextColumn();
        ImGuiUtil.Center("B");
        ImGui.TableNextColumn();
        ImGuiUtil.Center("A");

        var inputWidth = width / 6;

        ImGui.TableNextColumn();
        ImGui.AlignTextToFramePadding();
        ImGui.Text("R    ");
        changes |= DragFloat("##RR", inputWidth, ref matrix.M11);
        changes |= DragFloat("##RG", inputWidth, ref matrix.M12);
        changes |= DragFloat("##RB", inputWidth, ref matrix.M13);
        changes |= DragFloat("##RA", inputWidth, ref matrix.M14);

        ImGui.TableNextColumn();
        ImGui.AlignTextToFramePadding();
        ImGui.Text("G    ");
        changes |= DragFloat("##GR", inputWidth, ref matrix.M21);
        changes |= DragFloat("##GG", inputWidth, ref matrix.M22);
        changes |= DragFloat("##GB", inputWidth, ref matrix.M23);
        changes |= DragFloat("##GA", inputWidth, ref matrix.M24);

        ImGui.TableNextColumn();
        ImGui.AlignTextToFramePadding();
        ImGui.Text("B    ");
        changes |= DragFloat("##BR", inputWidth, ref matrix.M31);
        changes |= DragFloat("##BG", inputWidth, ref matrix.M32);
        changes |= DragFloat("##BB", inputWidth, ref matrix.M33);
        changes |= DragFloat("##BA", inputWidth, ref matrix.M34);

        ImGui.TableNextColumn();
        ImGui.AlignTextToFramePadding();
        ImGui.Text("A    ");
        changes |= DragFloat("##AR", inputWidth, ref matrix.M41);
        changes |= DragFloat("##AG", inputWidth, ref matrix.M42);
        changes |= DragFloat("##AB", inputWidth, ref matrix.M43);
        changes |= DragFloat("##AA", inputWidth, ref matrix.M44);

        return(changes);
    }
Ejemplo n.º 2
0
    public void DrawProgressInfo(Vector2 size)
    {
        if (_modPackCount == 0)
        {
            ImGuiUtil.Center("Nothing to extract.");
        }
        else if (_modPackCount == _currentModPackIdx)
        {
            DrawEndState();
        }
        else
        {
            ImGui.NewLine();
            var percentage = _modPackCount / ( float )_currentModPackIdx;
            ImGui.ProgressBar(percentage, size, $"Mod {_currentModPackIdx + 1} / {_modPackCount}");
            ImGui.NewLine();
            if (State == ImporterState.DeduplicatingFiles)
            {
                ImGui.TextUnformatted($"Deduplicating {_currentModName}...");
            }
            else
            {
                ImGui.TextUnformatted($"Extracting {_currentModName}...");
            }

            if (_currentNumOptions > 1)
            {
                ImGui.NewLine();
                ImGui.NewLine();
                percentage = _currentNumOptions == 0 ? 1f : _currentOptionIdx / ( float )_currentNumOptions;
                ImGui.ProgressBar(percentage, size, $"Option {_currentOptionIdx + 1} / {_currentNumOptions}");
                ImGui.NewLine();
                if (State != ImporterState.DeduplicatingFiles)
                {
                    ImGui.TextUnformatted(
                        $"Extracting option {( _currentGroupName.Length == 0 ? string.Empty : $"{_currentGroupName} - " )}{_currentOptionName}...");