Compare commits
No commits in common. "12fec071c05aa4f8a692b7639dde007880735d4d" and "3458794dbb49c1f3cb62507c67cd3190c42a8459" have entirely different histories.
12fec071c0
...
3458794dbb
62
PenPaperMain/Anmeldung.xaml
Normal file
62
PenPaperMain/Anmeldung.xaml
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
<Window x:Class="Pen_Paper_Main.Anmeldung"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:Pen_Paper_Main"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="Anmeldung" Height="450" Width="800">
|
||||||
|
<Grid Background="LightBlue">
|
||||||
|
<Border Width="350" Padding="20" Background="White" CornerRadius="10"
|
||||||
|
VerticalAlignment="Center" HorizontalAlignment="Center" >
|
||||||
|
<StackPanel >
|
||||||
|
<TextBlock Text="Anmeldung"
|
||||||
|
FontSize="24"
|
||||||
|
FontWeight="Bold"
|
||||||
|
HorizontalAlignment="Center" />
|
||||||
|
|
||||||
|
|
||||||
|
<Grid Margin="10" Height="35">
|
||||||
|
<TextBox x:Name="BenutzernameInput"
|
||||||
|
Foreground="Gray"
|
||||||
|
HorizontalContentAlignment="Center"
|
||||||
|
VerticalContentAlignment="Center"
|
||||||
|
TextChanged="BenutzernameInput_TextChanged" />
|
||||||
|
|
||||||
|
<TextBlock x:Name="BenutzernamePlaceHolder"
|
||||||
|
Text="Benutzernamen eingeben"
|
||||||
|
Foreground="Gray"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
IsHitTestVisible="False"
|
||||||
|
Margin="5,0,0,0"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<Grid Margin="10" Height="35">
|
||||||
|
<PasswordBox x:Name="PasswortBox"
|
||||||
|
HorizontalContentAlignment="Center"
|
||||||
|
VerticalContentAlignment="Center"
|
||||||
|
PasswordChanged="PasswortBox_PasswordChanged"/>
|
||||||
|
|
||||||
|
<TextBlock x:Name="PasswortPlaceholder"
|
||||||
|
Text="Passwort eingeben"
|
||||||
|
Foreground="Gray"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
IsHitTestVisible="False"
|
||||||
|
Margin="5,0,0,0"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<Button Content="Anmelden"
|
||||||
|
Height="40" Background="#3B82F6"
|
||||||
|
Foreground="White"
|
||||||
|
Click="Anmelden_Click"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
69
PenPaperMain/Anmeldung.xaml.cs
Normal file
69
PenPaperMain/Anmeldung.xaml.cs
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
using System;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.Json;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
|
||||||
|
namespace Pen_Paper_Main
|
||||||
|
{
|
||||||
|
public partial class Anmeldung : Window
|
||||||
|
{
|
||||||
|
public Anmeldung()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void Anmelden_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
string user = BenutzernameInput.Text;
|
||||||
|
string pass = PasswortBox.Password;
|
||||||
|
|
||||||
|
var result = await CallApi("login", user, pass);
|
||||||
|
|
||||||
|
if (result.ok)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Anmeldung erfolgreich");
|
||||||
|
Lobby lobby = new Lobby();
|
||||||
|
lobby.Show();
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Fehler: " + result.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<(bool ok,string msg)> CallApi(string action, string u, string p)
|
||||||
|
{
|
||||||
|
using var client = new HttpClient();
|
||||||
|
var json = JsonSerializer.Serialize(new { username = u, password = p });
|
||||||
|
var resp = await client.PostAsync($"http://localhost/api/users.php?action={action}",
|
||||||
|
new StringContent(json, Encoding.UTF8, "application/json"));
|
||||||
|
var body = await resp.Content.ReadAsStringAsync();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var doc = JsonDocument.Parse(body);
|
||||||
|
bool ok = doc.RootElement.GetProperty("ok").GetBoolean();
|
||||||
|
string msg = doc.RootElement.GetProperty("msg").GetString();
|
||||||
|
return (ok, msg);
|
||||||
|
}
|
||||||
|
catch { return (false, "invalid response"); }
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PasswortBox_PasswordChanged(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
PasswortPlaceholder.Visibility = string.IsNullOrEmpty(PasswortBox.Password)
|
||||||
|
? Visibility.Visible
|
||||||
|
: Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BenutzernameInput_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
|
{
|
||||||
|
BenutzernamePlaceHolder.Visibility = string.IsNullOrEmpty(BenutzernameInput.Text)
|
||||||
|
? Visibility.Visible
|
||||||
|
: Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
9
PenPaperMain/App.xaml
Normal file
9
PenPaperMain/App.xaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<Application x:Class="Pen_Paper_Main.App"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="clr-namespace:Pen_Paper_Main"
|
||||||
|
StartupUri="MainWindow.xaml">
|
||||||
|
<Application.Resources>
|
||||||
|
|
||||||
|
</Application.Resources>
|
||||||
|
</Application>
|
14
PenPaperMain/App.xaml.cs
Normal file
14
PenPaperMain/App.xaml.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System.Configuration;
|
||||||
|
using System.Data;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace Pen_Paper_Main
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for App.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class App : Application
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
10
PenPaperMain/AssemblyInfo.cs
Normal file
10
PenPaperMain/AssemblyInfo.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
[assembly: ThemeInfo(
|
||||||
|
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||||
|
//(used if a resource is not found in the page,
|
||||||
|
// or application resource dictionaries)
|
||||||
|
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||||
|
//(used if a resource is not found in the page,
|
||||||
|
// app, or any theme specific resource dictionaries)
|
||||||
|
)]
|
15
PenPaperMain/CharakterListe.xaml
Normal file
15
PenPaperMain/CharakterListe.xaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<Window x:Class="Pen_Paper_Main.CharakterListe"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
Title="Charaktere" Height="300" Width="400" Loaded="Window_Loaded">
|
||||||
|
|
||||||
|
<!--jakob-->
|
||||||
|
<StackPanel Margin="10">
|
||||||
|
<Button Content="➕ Neu" Click="New_Click" Margin="0,0,0,6"/>
|
||||||
|
<ListBox x:Name="LstChars" Height="180" DisplayMemberPath="name"/>
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,8,0,0">
|
||||||
|
<Button Content="🗑️ Löschen" Click="Delete_Click" Margin="0,0,8,0"/>
|
||||||
|
<Button Content="Schließen" Click="Close_Click"/>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</Window>
|
49
PenPaperMain/CharakterListe.xaml.cs
Normal file
49
PenPaperMain/CharakterListe.xaml.cs
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.Json;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace Pen_Paper_Main
|
||||||
|
{
|
||||||
|
public partial class CharakterListe : Window
|
||||||
|
{
|
||||||
|
public CharakterListe() { InitializeComponent(); }
|
||||||
|
private class CharVm { public string name{get;set;}=""; public string username{get;set;}=""; }
|
||||||
|
|
||||||
|
private async void Window_Loaded(object s,RoutedEventArgs e) => await LoadAsync();
|
||||||
|
|
||||||
|
private async Task LoadAsync() {
|
||||||
|
using var http=new HttpClient();
|
||||||
|
var json=await http.GetStringAsync("http://localhost/api/characters.php?action=list");
|
||||||
|
using var doc=JsonDocument.Parse(json);
|
||||||
|
var items=new List<CharVm>();
|
||||||
|
foreach(var el in doc.RootElement.GetProperty("items").EnumerateArray()) {
|
||||||
|
items.Add(new CharVm {
|
||||||
|
name=el.GetProperty("name").GetString()??"",
|
||||||
|
username=el.GetProperty("username").GetString()??""
|
||||||
|
});
|
||||||
|
}
|
||||||
|
LstChars.ItemsSource=items;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Close_Click(object s,RoutedEventArgs e)=>Close();
|
||||||
|
|
||||||
|
private async void New_Click(object s,RoutedEventArgs e) {
|
||||||
|
var dlg=new CharakterNeu(); dlg.Owner=this; dlg.ShowDialog();
|
||||||
|
await LoadAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void Delete_Click(object s,RoutedEventArgs e) {
|
||||||
|
if(LstChars.SelectedItem is CharVm vm) {
|
||||||
|
using var http=new HttpClient();
|
||||||
|
var url=$"http://localhost/api/characters.php?action=delete&username={vm.username}&name={vm.name}";
|
||||||
|
var resp=await http.DeleteAsync(url);
|
||||||
|
var body=await resp.Content.ReadAsStringAsync();
|
||||||
|
MessageBox.Show(body);
|
||||||
|
await LoadAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
18
PenPaperMain/CharaktereNeu.xaml
Normal file
18
PenPaperMain/CharaktereNeu.xaml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<Window x:Class="Pen_Paper_Main.CharakterNeu"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
Title="Neuer Charakter" Height="200" Width="320">
|
||||||
|
<Border Background="White" CornerRadius="8" Padding="12">
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="Benutzername" Margin="0,0,0,4"/>
|
||||||
|
<TextBox x:Name="TxtUser" Margin="0,0,0,8"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Charaktername" Margin="0,0,0,4"/>
|
||||||
|
<TextBox x:Name="TxtChar" Margin="0,0,0,12"/>
|
||||||
|
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
|
<Button Content="Speichern" Width="100" Click="Save_Click"/>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</Window>
|
26
PenPaperMain/CharaktereNeu.xaml.cs
Normal file
26
PenPaperMain/CharaktereNeu.xaml.cs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
using System.Net.Http;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.Json;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
|
||||||
|
//jakob
|
||||||
|
namespace Pen_Paper_Main
|
||||||
|
{
|
||||||
|
public partial class CharakterNeu : Window
|
||||||
|
{
|
||||||
|
public CharakterNeu() { InitializeComponent(); }
|
||||||
|
|
||||||
|
private async void Save_Click(object s, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var payload = new { username = TxtUser.Text, name = TxtChar.Text };
|
||||||
|
using var http = new HttpClient();
|
||||||
|
var resp = await http.PostAsync("http://localhost/api/characters.php?action=create",
|
||||||
|
new StringContent(JsonSerializer.Serialize(payload), Encoding.UTF8, "application/json"));
|
||||||
|
var body = await resp.Content.ReadAsStringAsync();
|
||||||
|
MessageBox.Show(body);
|
||||||
|
DialogResult = true; Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
42
PenPaperMain/Einstellungen.xaml
Normal file
42
PenPaperMain/Einstellungen.xaml
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<Window x:Class="Pen_Paper_Main.Einstellungen"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:Pen_Paper_Main"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="Einstellungen" Height="450" Width="800">
|
||||||
|
<DockPanel Background="LightBlue">
|
||||||
|
<TextBlock DockPanel.Dock="Top" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="35" FontWeight="Bold">Einstellungen</TextBlock>
|
||||||
|
|
||||||
|
<Border Width="Auto" Padding="20" Height="Auto" Background="White" CornerRadius="10"
|
||||||
|
VerticalAlignment="Center" HorizontalAlignment="Center" >
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="0" Grid.Column="0" FontSize="15" HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center" FontWeight="Bold">ProfilBild auswählen : </TextBlock>
|
||||||
|
<TextBox Grid.Row="0" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="100" Height="50" Margin="15"></TextBox>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="15" FontWeight="Bold">Benutzername : </TextBlock>
|
||||||
|
|
||||||
|
<TextBox Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="100" Height="50" Margin="15"></TextBox>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="2" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="15" FontWeight="Bold">Sprache : </TextBlock>
|
||||||
|
|
||||||
|
<ScrollBar Grid.Row="2" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10"></ScrollBar>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</DockPanel>
|
||||||
|
</Window>
|
27
PenPaperMain/Einstellungen.xaml.cs
Normal file
27
PenPaperMain/Einstellungen.xaml.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace Pen_Paper_Main
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaktionslogik für Einstellungen.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class Einstellungen : Window
|
||||||
|
{
|
||||||
|
public Einstellungen()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
50
PenPaperMain/Kampange.xaml
Normal file
50
PenPaperMain/Kampange.xaml
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<Window x:Class="Pen_Paper_Main.Kampange"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:Pen_Paper_Main"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="Kampange" Height="450" Width="800">
|
||||||
|
<DockPanel Background="LightBlue">
|
||||||
|
<TextBlock DockPanel.Dock="Top" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="35" FontWeight="Bold">Kampangen</TextBlock>
|
||||||
|
|
||||||
|
<Border Width="Auto" Padding="20" Height="Auto" Background="White" CornerRadius="10"
|
||||||
|
VerticalAlignment="Center" HorizontalAlignment="Center" >
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="0" Grid.Column="0" FontSize="15" HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center" FontWeight="Bold" Margin="15">Titel :</TextBlock>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="0" Grid.Column="1" FontSize="15" HorizontalAlignment="Center" Foreground="LightGray"
|
||||||
|
VerticalAlignment="Center" Margin="15">BlaBlaBla</TextBlock>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="1" Grid.Column="0" FontSize="15" HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center" FontWeight="Bold" Margin="15">Beschreibung :</TextBlock>
|
||||||
|
|
||||||
|
<Button Grid.Row="2" Grid.Column="0" FontSize="15" HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center" Width="100" Margin="15">Bearbeiten</Button>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="1" FontSize="15" Grid.Column="1" HorizontalAlignment="Center" Foreground="LightGray"
|
||||||
|
VerticalAlignment="Center" >BlaBlaBla</TextBlock>
|
||||||
|
|
||||||
|
<Button Grid.Row="2" Grid.Column="1" FontSize="15" HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center" Width="100" Margin="15">Löschen</Button>
|
||||||
|
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</DockPanel>
|
||||||
|
</Window>
|
27
PenPaperMain/Kampange.xaml.cs
Normal file
27
PenPaperMain/Kampange.xaml.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace Pen_Paper_Main
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaktionslogik für Kampange.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class Kampange : Window
|
||||||
|
{
|
||||||
|
public Kampange()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
80
PenPaperMain/KampangenDetails.xaml
Normal file
80
PenPaperMain/KampangenDetails.xaml
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
<Window x:Class="Pen_Paper_Main.KampangenDetails"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:Pen_Paper_Main"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="KampangenDetails" Height="450" Width="800">
|
||||||
|
<Grid Background="LightBlue">
|
||||||
|
<StackPanel Margin="10">
|
||||||
|
<TextBlock Text="📂 Kampagne: Schatten über Aerion"
|
||||||
|
FontSize="20"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Margin="0,0,0,10" />
|
||||||
|
|
||||||
|
<TabControl>
|
||||||
|
<TabItem Header="📝 Allgemein">
|
||||||
|
<StackPanel Margin="10" Height="300">
|
||||||
|
<TextBlock Text="Titel:" />
|
||||||
|
<TextBox Text="PlatzHalter" Foreground="LightGray" Margin="0,5,0,10" Height="50" />
|
||||||
|
|
||||||
|
<TextBlock Text="Beschreibung:" />
|
||||||
|
<TextBox Text="PlatzHalter" Foreground="LightGray"
|
||||||
|
AcceptsReturn="True"
|
||||||
|
Height="100" Margin="0,5,0,10" />
|
||||||
|
|
||||||
|
<Button Content="💾 Speichern" Width="150" HorizontalAlignment="Left" />
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem Header="🗺️ Karten">
|
||||||
|
<StackPanel Margin="10" Height="100">
|
||||||
|
<ItemsControl>
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<DockPanel Margin="0,5">
|
||||||
|
<TextBlock DockPanel.Dock="Left" />
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
|
<Button Content="🔍 Ansehen" Margin="5,0"/>
|
||||||
|
<Button Content="🗑️ Entfernen" Margin="5,0"/>
|
||||||
|
</StackPanel>
|
||||||
|
</DockPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
|
||||||
|
<Button Content="➕ Neue Karte hinzufügen" Margin="0,10,0,0" Width="200"/>
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem Header="🧙 Charaktere">
|
||||||
|
<StackPanel Margin="10" Height="100">
|
||||||
|
<ItemsControl>
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<DockPanel Margin="0,5">
|
||||||
|
<TextBlock DockPanel.Dock="Left" />
|
||||||
|
<Button Content="🗑️ Entfernen" HorizontalAlignment="Right"/>
|
||||||
|
</DockPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
|
||||||
|
<Button Content="➕ Charakter zuweisen" Margin="0,10,0,0" Width="200"/>
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem Header="📚 Notizen">
|
||||||
|
<StackPanel Margin="10">
|
||||||
|
<TextBox Text="Notizen" Foreground="LightGray"
|
||||||
|
AcceptsReturn="True"
|
||||||
|
Height="200"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
<Button Content="💾 Notizen speichern" Margin="0,10,0,0" Width="200"/>
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
27
PenPaperMain/KampangenDetails.xaml.cs
Normal file
27
PenPaperMain/KampangenDetails.xaml.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace Pen_Paper_Main
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaktionslogik für KampangenDetails.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class KampangenDetails : Window
|
||||||
|
{
|
||||||
|
public KampangenDetails()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
71
PenPaperMain/Lobby.xaml
Normal file
71
PenPaperMain/Lobby.xaml
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
<Window x:Class="Pen_Paper_Main.Lobby"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:Pen_Paper_Main"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="Lobby" Height="450" Width="800">
|
||||||
|
<DockPanel Background="LightBlue" LastChildFill="True">
|
||||||
|
|
||||||
|
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10">
|
||||||
|
<TextBox Text="SitzungsTitel:"
|
||||||
|
FontSize="20"
|
||||||
|
Width="200"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Foreground="Gray"
|
||||||
|
Background="White"
|
||||||
|
Margin="10"
|
||||||
|
HorizontalContentAlignment="Center" />
|
||||||
|
|
||||||
|
<TextBox Text="BenutzerName:"
|
||||||
|
FontSize="20"
|
||||||
|
Width="200"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Foreground="Gray"
|
||||||
|
Background="White"
|
||||||
|
Margin="10"
|
||||||
|
HorizontalContentAlignment="Center" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<Border Width="Auto" Padding="20" Background="White" CornerRadius="10"
|
||||||
|
VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,20">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Button Grid.Row="0" Grid.Column="0" Content="Karte"
|
||||||
|
FontSize="15" FontWeight="Bold" Width="120" Height="40" Margin="10" />
|
||||||
|
|
||||||
|
<Button Grid.Row="0" Grid.Column="1" Content="Kampagne"
|
||||||
|
FontSize="15" FontWeight="Bold" Width="120" Height="40" Margin="10" />
|
||||||
|
|
||||||
|
<Button Grid.Row="1" Grid.Column="0" Content="Chat"
|
||||||
|
FontSize="15" FontWeight="Bold" Width="120" Height="40" Margin="10" />
|
||||||
|
|
||||||
|
<Button Grid.Row="1" Grid.Column="1" Content="Charakter" Click="Charaktere_Click"
|
||||||
|
FontSize="15" FontWeight="Bold" Width="120" Height="40" Margin="10" />
|
||||||
|
|
||||||
|
<Button Grid.Row="2" Grid.Column="0" Content="Einstellungen"
|
||||||
|
FontSize="15" FontWeight="Bold" Width="120" Height="40" Margin="10" />
|
||||||
|
|
||||||
|
<Button Grid.Row="2" Grid.Column="1" Content="Würfeln"
|
||||||
|
FontSize="15" FontWeight="Bold" Width="120" Height="40" Margin="10" />
|
||||||
|
|
||||||
|
<Button Grid.Row="3" Grid.ColumnSpan="2" Content="🚪 Sitzung Verlassen"
|
||||||
|
FontSize="15" FontWeight="Bold" Width="250" Height="35" Margin="10"
|
||||||
|
HorizontalAlignment="Center" />
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</DockPanel>
|
||||||
|
</Window>
|
34
PenPaperMain/Lobby.xaml.cs
Normal file
34
PenPaperMain/Lobby.xaml.cs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace Pen_Paper_Main
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaktionslogik für Lobby.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class Lobby : Window
|
||||||
|
{
|
||||||
|
public Lobby()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void Charaktere_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var win = new CharakterListe();
|
||||||
|
win.ShowDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
43
PenPaperMain/MainWindow.xaml
Normal file
43
PenPaperMain/MainWindow.xaml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<Window x:Class="Pen_Paper_Main.MainWindow"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:Pen_Paper_Main"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="MainWindow" Height="450" Width="800">
|
||||||
|
<Grid Background="LightBlue">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Text="Pen and Paper Manager"
|
||||||
|
FontSize="28"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Foreground="#333"
|
||||||
|
Margin="0,30,0,10"
|
||||||
|
HorizontalAlignment="Center" />
|
||||||
|
|
||||||
|
<StackPanel Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" Width="300" >
|
||||||
|
<TextBlock Text="Willkommen bei Pen and Paper!" FontSize="20" FontWeight="SemiBold" TextAlignment="Center"/>
|
||||||
|
|
||||||
|
<Button Content="Anmelden" Click="Anmelden_Click"
|
||||||
|
Height="40" Margin="10"/>
|
||||||
|
|
||||||
|
<Button Content="Registrieren" Click="Registrieren_Click"
|
||||||
|
Height="40" Margin="10"/>
|
||||||
|
|
||||||
|
<Button Content="Als Gast fortfahren"
|
||||||
|
Height="35" Margin="10"
|
||||||
|
Foreground="Gray"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="2" Text="v1.0.0"
|
||||||
|
FontSize="15"
|
||||||
|
Foreground="Gray"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Margin="0,10,0,10"/>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
41
PenPaperMain/MainWindow.xaml.cs
Normal file
41
PenPaperMain/MainWindow.xaml.cs
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
using System.Text;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace Pen_Paper_Main
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for MainWindow.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class MainWindow : Window
|
||||||
|
{
|
||||||
|
public MainWindow()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Event für die Buttons "Anmelden" und "Registrieren"
|
||||||
|
private void Anmelden_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Anmeldung anmeldung = new Anmeldung();
|
||||||
|
anmeldung.Show();
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Registrieren_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Registrieren registrieren = new Registrieren();
|
||||||
|
registrieren.Show();
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
PenPaperMain/Pen&Paper Main.csproj
Normal file
12
PenPaperMain/Pen&Paper Main.csproj
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<TargetFramework>net6.0-windows</TargetFramework>
|
||||||
|
<RootNamespace>Pen_Paper_Main</RootNamespace>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<UseWPF>true</UseWPF>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
44
PenPaperMain/Registrieren.xaml
Normal file
44
PenPaperMain/Registrieren.xaml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<Window x:Class="Pen_Paper_Main.Registrieren"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
Title="Registrieren" Height="450" Width="800">
|
||||||
|
|
||||||
|
<!--Jakob-->
|
||||||
|
<Grid Background="LightBlue">
|
||||||
|
<Border Width="350" Padding="20" Background="White" CornerRadius="10"
|
||||||
|
VerticalAlignment="Center" HorizontalAlignment="Center">
|
||||||
|
<StackPanel>
|
||||||
|
|
||||||
|
<TextBlock Text="Neues Konto anlegen"
|
||||||
|
FontSize="24" FontWeight="Bold"
|
||||||
|
HorizontalAlignment="Center" Margin="0,0,0,10"/>
|
||||||
|
|
||||||
|
<!-- Benutzername -->
|
||||||
|
<TextBlock Text="Benutzername" Margin="10,0,10,4"/>
|
||||||
|
<TextBox x:Name="BenutzernameInput"
|
||||||
|
Height="35" Margin="10"
|
||||||
|
HorizontalContentAlignment="Center"
|
||||||
|
VerticalContentAlignment="Center"/>
|
||||||
|
|
||||||
|
<!-- Passwort -->
|
||||||
|
<TextBlock Text="Passwort" Margin="10,6,10,4"/>
|
||||||
|
<PasswordBox x:Name="PasswortBox"
|
||||||
|
Height="35" Margin="10"
|
||||||
|
HorizontalContentAlignment="Center"
|
||||||
|
VerticalContentAlignment="Center"/>
|
||||||
|
|
||||||
|
<!-- Passwort bestätigen -->
|
||||||
|
<TextBlock Text="Passwort bestätigen" Margin="10,6,10,4"/>
|
||||||
|
<PasswordBox x:Name="PasswortBoxConfirm"
|
||||||
|
Height="35" Margin="10"
|
||||||
|
HorizontalContentAlignment="Center"
|
||||||
|
VerticalContentAlignment="Center"/>
|
||||||
|
|
||||||
|
<Button Content="Jetzt Starten"
|
||||||
|
Height="40" Margin="10,16,10,0"
|
||||||
|
Background="#3B82F6" Foreground="White"
|
||||||
|
Click="Button_Click"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
82
PenPaperMain/Registrieren.xaml.cs
Normal file
82
PenPaperMain/Registrieren.xaml.cs
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
using System;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.Json;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
|
||||||
|
//jakob
|
||||||
|
namespace Pen_Paper_Main
|
||||||
|
{
|
||||||
|
public partial class Registrieren : Window
|
||||||
|
{
|
||||||
|
public Registrieren()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void Button_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
string user = BenutzernameInput.Text.Trim();
|
||||||
|
string pass = PasswortBox.Password;
|
||||||
|
string pass2 = PasswortBoxConfirm.Password;
|
||||||
|
|
||||||
|
// simple Validierung
|
||||||
|
if (string.IsNullOrWhiteSpace(user) || string.IsNullOrWhiteSpace(pass))
|
||||||
|
{
|
||||||
|
MessageBox.Show("Bitte Benutzername und Passwort eingeben.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (pass != pass2)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Passwörter stimmen nicht überein.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = await CallApi("register", user, pass);
|
||||||
|
|
||||||
|
if (result.ok)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Registrierung erfolgreich");
|
||||||
|
var a = new Anmeldung();
|
||||||
|
a.Show();
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Fehler: " + result.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<(bool ok, string msg)> CallApi(string action, string u, string p)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//versucht api zu callen
|
||||||
|
using var client = new HttpClient();
|
||||||
|
var json = JsonSerializer.Serialize(new { username = u, password = p });
|
||||||
|
var resp = await client.PostAsync(
|
||||||
|
|
||||||
|
//url der api und worauf es verweist
|
||||||
|
$"http://localhost/api/users.php?action={action}",
|
||||||
|
new StringContent(json, Encoding.UTF8, "application/json")
|
||||||
|
);
|
||||||
|
|
||||||
|
// antwort wird erwartet
|
||||||
|
var body = await resp.Content.ReadAsStringAsync();
|
||||||
|
//text als json umformatieren
|
||||||
|
using var doc = JsonDocument.Parse(body);
|
||||||
|
//liest ob ok true oder false ist (ist definiert in db.php)
|
||||||
|
bool ok = doc.RootElement.GetProperty("ok").GetBoolean();
|
||||||
|
string msg = doc.RootElement.GetProperty("msg").GetString() ?? "";
|
||||||
|
|
||||||
|
return (ok, msg);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return (false, "invalid response");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
51
PenPaperMain/SitzungVerwalten.xaml
Normal file
51
PenPaperMain/SitzungVerwalten.xaml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<Window x:Class="Pen_Paper_Main.SitzungVerwalten"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:Pen_Paper_Main"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="SitzungVerwalten" Height="450" Width="800">
|
||||||
|
|
||||||
|
<DockPanel Background="LightBlue">
|
||||||
|
<TextBlock DockPanel.Dock="Top" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="35" FontWeight="Bold">Sitzungen</TextBlock>
|
||||||
|
|
||||||
|
<Border Width="Auto" Padding="20" Height="Auto" Background="White" CornerRadius="10"
|
||||||
|
VerticalAlignment="Center" HorizontalAlignment="Center" >
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="0" Grid.Column="0" FontSize="15" HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center" FontWeight="Bold" Margin="15">Sitzung erstellen</TextBlock>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="0" Grid.Column="1" FontSize="15" HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center" FontWeight="Bold" Margin="15">Sitzung beitreten</TextBlock>
|
||||||
|
|
||||||
|
<TextBox Grid.Row="1" Grid.Column="0" FontSize="15" HorizontalAlignment="Center" Foreground="LightGray"
|
||||||
|
VerticalAlignment="Center" Margin="10">Titel eingeben</TextBox>
|
||||||
|
|
||||||
|
<Button Grid.Row="2" Grid.Column="0" FontSize="15" HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center" Margin="15">Sitzung erstellen</Button>
|
||||||
|
|
||||||
|
<TextBox Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" Foreground="LightGray"
|
||||||
|
VerticalAlignment="Center" >Code eingeben</TextBox>
|
||||||
|
|
||||||
|
<Button Grid.Row="2" Grid.Column="1" FontSize="15" HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center" Margin="15">Sitzung beitreten</Button>
|
||||||
|
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</DockPanel>
|
||||||
|
</Window>
|
27
PenPaperMain/SitzungVerwalten.xaml.cs
Normal file
27
PenPaperMain/SitzungVerwalten.xaml.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace Pen_Paper_Main
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaktionslogik für SitzungVerwalten.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class SitzungVerwalten : Window
|
||||||
|
{
|
||||||
|
public SitzungVerwalten()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
66
PenPaperMain/Würfel.xaml
Normal file
66
PenPaperMain/Würfel.xaml
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
<Grid Background="LightBlue">
|
||||||
|
<Border Width="Auto"
|
||||||
|
Padding="20"
|
||||||
|
Height="Auto"
|
||||||
|
Background="White"
|
||||||
|
CornerRadius="10"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Center">
|
||||||
|
<StackPanel Margin="10"
|
||||||
|
Width="320">
|
||||||
|
<TextBlock Text="🎲 Würfel"
|
||||||
|
FontSize="22"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Margin="0,0,0,12"
|
||||||
|
HorizontalAlignment="Center"/>
|
||||||
|
|
||||||
|
<!-- eingabe von -->
|
||||||
|
<StackPanel Orientation="Horizontal"
|
||||||
|
Margin="0,0,0,8">
|
||||||
|
<TextBlock Text="Von:"
|
||||||
|
Width="80"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="TxtFrom"
|
||||||
|
Width="80"
|
||||||
|
Text="1"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- eingabe bis -->
|
||||||
|
<StackPanel Orientation="Horizontal"
|
||||||
|
Margin="0,0,0,12">
|
||||||
|
<TextBlock Text="Bis:"
|
||||||
|
Width="80"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="TxtTo"
|
||||||
|
Width="80"
|
||||||
|
Text="6"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- wie viel würfe -->
|
||||||
|
<StackPanel Orientation="Horizontal"
|
||||||
|
Margin="0,0,0,12">
|
||||||
|
<TextBlock Text="Anzahl:"
|
||||||
|
Width="80"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox x:Name="TxtCount"
|
||||||
|
Width="80"
|
||||||
|
Text="1"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<Button Content="🎲 Würfeln"
|
||||||
|
Click="BtnRoll_Click"
|
||||||
|
Height="36"/>
|
||||||
|
|
||||||
|
<TextBlock Text="📜 Ergebnisse:"
|
||||||
|
FontWeight="SemiBold"
|
||||||
|
Margin="0,12,0,4"/>
|
||||||
|
<ListBox x:Name="LstResults"
|
||||||
|
Height="120"
|
||||||
|
Margin="0,0,0,6"/>
|
||||||
|
|
||||||
|
<TextBlock x:Name="TxtSum"
|
||||||
|
Text="Summe: 0"
|
||||||
|
FontWeight="Bold"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
27
PenPaperMain/Würfel.xaml.cs
Normal file
27
PenPaperMain/Würfel.xaml.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace Pen_Paper_Main
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaktionslogik für Würfel.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class Würfel : Window
|
||||||
|
{
|
||||||
|
public Würfel()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user