mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
添加相应接口
This commit is contained in:
parent
09e853677a
commit
03b47558fa
@ -70,7 +70,7 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
Core.Controller.MoveWindows(MoveTimerPoint.X, MoveTimerPoint.Y);
|
||||
}
|
||||
|
||||
public Action DefaultClickAction;
|
||||
bool isPress = false;
|
||||
private void MainGrid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
@ -97,7 +97,7 @@ namespace VPet_Simulator.Core
|
||||
if (act != null)
|
||||
Dispatcher.Invoke(act.DoAction);
|
||||
else
|
||||
Dispatcher.Invoke(ToolBar.Show);
|
||||
DefaultClickAction?.Invoke();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -40,11 +40,14 @@ namespace VPet_Simulator.Core
|
||||
EndTimer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public Action EndAction;
|
||||
private void EndTimer_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
if (--timeleft <= 0)
|
||||
{
|
||||
Dispatcher.Invoke(() => this.Visibility = Visibility.Collapsed);
|
||||
EndAction?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
public Timer EndTimer = new Timer() { Interval = 100 };
|
||||
@ -75,6 +78,7 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
EndTimer.Stop(); ShowTimer.Stop();
|
||||
this.Visibility = Visibility.Collapsed;
|
||||
EndAction?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -105,8 +105,10 @@ namespace VPet_Simulator.Windows
|
||||
Dispatcher.Invoke(new Action(() => {
|
||||
Core.Graph = Pets[0].Graph;
|
||||
LoadingText.Visibility = Visibility.Collapsed;
|
||||
winSetting = new winGameSetting(this);
|
||||
DisplayGrid.Child = new Main(Core);
|
||||
winSetting = new winGameSetting(this);
|
||||
var main = new Main(Core) { };
|
||||
main.DefaultClickAction = () => { Dispatcher.Invoke(() => { main.Say("你知道吗? 鼠标右键可以打开菜单栏"); }); };
|
||||
DisplayGrid.Child = main;
|
||||
}));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user