add:直接调Ci点名
This commit is contained in:
@@ -2418,6 +2418,15 @@
|
|||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Toggled="ToggleSwitchShowRandomAndSingleDraw_Toggled" />
|
Toggled="ToggleSwitchShowRandomAndSingleDraw_Toggled" />
|
||||||
</ui:SimpleStackPanel>
|
</ui:SimpleStackPanel>
|
||||||
|
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||||
|
<TextBlock Foreground="#fafafa" Text="直接调用Ci点名"
|
||||||
|
VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0" />
|
||||||
|
<ui:ToggleSwitch OnContent="" OffContent=""
|
||||||
|
Name="ToggleSwitchDirectCallCiRand"
|
||||||
|
IsOn="False" FontFamily="Microsoft YaHei UI"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Toggled="ToggleSwitchDirectCallCiRand_Toggled" />
|
||||||
|
</ui:SimpleStackPanel>
|
||||||
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0"
|
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0"
|
||||||
Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" />
|
Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" />
|
||||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ using System.Text;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
|
using MessageBox = iNKORE.UI.WPF.Modern.Controls.MessageBox;
|
||||||
|
|
||||||
namespace Ink_Canvas {
|
namespace Ink_Canvas {
|
||||||
public partial class MainWindow : Window {
|
public partial class MainWindow : Window {
|
||||||
@@ -825,7 +826,24 @@ namespace Ink_Canvas {
|
|||||||
AnimationsHelper.HideWithSlideAndFade(BorderTools);
|
AnimationsHelper.HideWithSlideAndFade(BorderTools);
|
||||||
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
|
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
|
||||||
|
|
||||||
new RandWindow(Settings, true).ShowDialog();
|
// 检查是否启用了直接调用ClassIsland点名功能
|
||||||
|
if (Settings.RandSettings.DirectCallCiRand) {
|
||||||
|
try {
|
||||||
|
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo {
|
||||||
|
FileName = "classisland://plugins/IslandCaller/Run",
|
||||||
|
UseShellExecute = true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
MessageBox.Show("无法调用ClassIsland点名:" + ex.Message);
|
||||||
|
|
||||||
|
// 调用失败时回退到默认的随机点名窗口
|
||||||
|
new RandWindow(Settings, true).ShowDialog();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 使用默认的随机点名窗口
|
||||||
|
new RandWindow(Settings, true).ShowDialog();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GridInkReplayButton_MouseUp(object sender, MouseButtonEventArgs e) {
|
private void GridInkReplayButton_MouseUp(object sender, MouseButtonEventArgs e) {
|
||||||
|
|||||||
@@ -1775,6 +1775,16 @@ namespace Ink_Canvas {
|
|||||||
// 保存设置到文件
|
// 保存设置到文件
|
||||||
SaveSettingsToFile();
|
SaveSettingsToFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ToggleSwitchDirectCallCiRand_Toggled(object sender, RoutedEventArgs e) {
|
||||||
|
if (!isLoaded) return;
|
||||||
|
|
||||||
|
// 获取开关状态并保存到设置中
|
||||||
|
Settings.RandSettings.DirectCallCiRand = ToggleSwitchDirectCallCiRand.IsOn;
|
||||||
|
|
||||||
|
// 保存设置到文件
|
||||||
|
SaveSettingsToFile();
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@@ -602,6 +602,7 @@ namespace Ink_Canvas {
|
|||||||
RandWindowOnceCloseLatencySlider.Value = Settings.RandSettings.RandWindowOnceCloseLatency;
|
RandWindowOnceCloseLatencySlider.Value = Settings.RandSettings.RandWindowOnceCloseLatency;
|
||||||
RandWindowOnceMaxStudentsSlider.Value = Settings.RandSettings.RandWindowOnceMaxStudents;
|
RandWindowOnceMaxStudentsSlider.Value = Settings.RandSettings.RandWindowOnceMaxStudents;
|
||||||
ToggleSwitchShowRandomAndSingleDraw.IsOn = Settings.RandSettings.ShowRandomAndSingleDraw;
|
ToggleSwitchShowRandomAndSingleDraw.IsOn = Settings.RandSettings.ShowRandomAndSingleDraw;
|
||||||
|
ToggleSwitchDirectCallCiRand.IsOn = Settings.RandSettings.DirectCallCiRand;
|
||||||
RandomDrawPanel.Visibility = Settings.RandSettings.ShowRandomAndSingleDraw ? Visibility.Visible : Visibility.Collapsed;
|
RandomDrawPanel.Visibility = Settings.RandSettings.ShowRandomAndSingleDraw ? Visibility.Visible : Visibility.Collapsed;
|
||||||
SingleDrawPanel.Visibility = Settings.RandSettings.ShowRandomAndSingleDraw ? Visibility.Visible : Visibility.Collapsed;
|
SingleDrawPanel.Visibility = Settings.RandSettings.ShowRandomAndSingleDraw ? Visibility.Visible : Visibility.Collapsed;
|
||||||
} else {
|
} else {
|
||||||
@@ -609,6 +610,7 @@ namespace Ink_Canvas {
|
|||||||
ToggleSwitchDisplayRandWindowNamesInputBtn.IsOn = Settings.RandSettings.DisplayRandWindowNamesInputBtn;
|
ToggleSwitchDisplayRandWindowNamesInputBtn.IsOn = Settings.RandSettings.DisplayRandWindowNamesInputBtn;
|
||||||
RandWindowOnceCloseLatencySlider.Value = Settings.RandSettings.RandWindowOnceCloseLatency;
|
RandWindowOnceCloseLatencySlider.Value = Settings.RandSettings.RandWindowOnceCloseLatency;
|
||||||
RandWindowOnceMaxStudentsSlider.Value = Settings.RandSettings.RandWindowOnceMaxStudents;
|
RandWindowOnceMaxStudentsSlider.Value = Settings.RandSettings.RandWindowOnceMaxStudents;
|
||||||
|
ToggleSwitchDirectCallCiRand.IsOn = Settings.RandSettings.DirectCallCiRand;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Automation
|
// Automation
|
||||||
|
|||||||
@@ -437,5 +437,7 @@ namespace Ink_Canvas
|
|||||||
public int RandWindowOnceMaxStudents { get; set; } = 10;
|
public int RandWindowOnceMaxStudents { get; set; } = 10;
|
||||||
[JsonProperty("showRandomAndSingleDraw")]
|
[JsonProperty("showRandomAndSingleDraw")]
|
||||||
public bool ShowRandomAndSingleDraw { get; set; } = true;
|
public bool ShowRandomAndSingleDraw { get; set; } = true;
|
||||||
|
[JsonProperty("directCallCiRand")]
|
||||||
|
public bool DirectCallCiRand { get; set; } = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user