Skip to content

Instantly share code, notes, and snippets.

@se5a
se5a / gist:e2530344e5d3cbb61539
Created February 8, 2016 06:21
eto SelectedValue
protected void AddModButton_Click(object sender, EventArgs e)
{
//var item = AvailableModList.SelectedValue;
if (AvailableModList.SelectedValue != null)
{
new_game_options.AvailableModList.RemoveAt(AvailableModList.SelectedIndex);
new_game_options.SelectedModList.Add((DataVersionInfo)AvailableModList.SelectedValue);
}
}
<Scrollable >
<TableLayout>
<TableRow ScaleHeight ="True">
<StackLayout ID ="AbilityTemplates"/>
</TableRow>
<TableRow ScaleHeight ="False">
<Panel Height="2" />
</TableRow>
<TableRow ScaleHeight ="False">
<Button Command="{Binding NewAbilityCommand}" Text="AddAbility"/>
Loaded assembly: /home/se5a/Pulsar4x/Pulsar4x-YetAnotherSysViewRewrite/Pulsar4X/Pulsar4X.CrossPlatformUI.Gtk2/bin/Linux/Pulsar4X.CrossPlatformUI.Gtk2.exe [External]
Loaded assembly: /home/se5a/Pulsar4x/Pulsar4x-YetAnotherSysViewRewrite/Pulsar4X/Pulsar4X.CrossPlatformUI.Gtk2/bin/Linux/Pulsar4X.CrossPlatformUI.dll
Loaded assembly: /home/se5a/Pulsar4x/Pulsar4x-YetAnotherSysViewRewrite/Pulsar4X/Pulsar4X.CrossPlatformUI.Gtk2/bin/Linux/Eto.dll [External]
Loaded assembly: /usr/lib/mono/4.5/Facades/System.Runtime.dll [External]
Loaded assembly: /home/se5a/Pulsar4x/Pulsar4x-YetAnotherSysViewRewrite/Pulsar4X/Pulsar4X.CrossPlatformUI.Gtk2/bin/Linux/Eto.Gtk2.dll [External]
Loaded assembly: /home/se5a/Pulsar4x/Pulsar4x-YetAnotherSysViewRewrite/Pulsar4X/Pulsar4X.CrossPlatformUI.Gtk2/bin/Linux/OpenTK.dll [External]
Loaded assembly: /usr/lib/mono/4.5/Facades/System.Collections.dll [External]
Loaded assembly: /usr/lib/mono/4.5/Facades/System.Threading.dll [External]
Loaded assembly: /usr/lib/mono/4.5/Facades/System.Reflection
@se5a
se5a / gist:74b9b86ae8f06deec4a4fba888415eea
Created July 26, 2016 00:45
gtk crash divide by zero
Loaded assembly: /home/se5a/Pulsar4x/Pulsar4X/Pulsar4X.CrossPlatformUI.Gtk2/bin/Debug/Pulsar4X.CrossPlatformUI.Gtk2.exe
Loaded assembly: /home/se5a/Pulsar4x/Pulsar4X/Pulsar4X.CrossPlatformUI.Gtk2/bin/Debug/Pulsar4X.CrossPlatformUI.dll
Loaded assembly: /home/se5a/Pulsar4x/Pulsar4X/Pulsar4X.CrossPlatformUI.Gtk2/bin/Debug/Eto.dll [External]
Loaded assembly: /usr/lib/mono/4.5/Facades/System.Runtime.dll [External]
Loaded assembly: /home/se5a/Pulsar4x/Pulsar4X/Pulsar4X.CrossPlatformUI.Gtk2/bin/Debug/Eto.Gtk2.dll [External]
Loaded assembly: /home/se5a/Pulsar4x/Pulsar4X/Pulsar4X.CrossPlatformUI.Gtk2/bin/Debug/OpenTK.dll [External]
Loaded assembly: /usr/lib/mono/4.5/Facades/System.Collections.dll [External]
Loaded assembly: /usr/lib/mono/4.5/Facades/System.Threading.dll [External]
Loaded assembly: /usr/lib/mono/4.5/Facades/System.Reflection.dll [External]
Loaded assembly: /usr/lib/mono/4.5/Facades/System.Runtime.Extensions.dll [External]
@se5a
se5a / gist:a0858e45146a7a08dc7f026c612297a4
Created August 9, 2016 06:44
angle from centre point of an ellipse to an orbiting body.
private float GetStartArcAngle()
{
_focalDistance = (float)_orbitDB.Eccentricity * _orbitElipseWidth /2;
//since the _focalDistance is only an X component we dont' bother calculating the Y part of the matrix
double focalX = (_focalDistance * Math.Cos(_rotation * Math.PI / 180)); // - 0 * Math.Sin(_rotation * Math.PI / 180));
double focalY = (_focalDistance * Math.Sin(_rotation * Math.PI / 180)); // + 0 * Math.Cos(_rotation * Math.PI / 180));
//addt the body posistion
Vector4 offsetPoint = new Vector4(focalX, focalY, 0, 0) + _bodyPositionDB.RelativePosition;
//find the angle to the offset point
float angle = (float)(Math.Atan2(offsetPoint.Y, offsetPoint.X) * 180 / Math.PI);
@se5a
se5a / gist:79c18daef31f1b7ba863ec2a8969a861
Created September 7, 2016 20:35
Eto.Forms GTK2 crash.
Loaded Module 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'
Started Thread 13048
Loaded Module 'F:\Users\se5a\Documents\Projects-Code\CSharp\pulsar4x\pulsar4x\Pulsar4X\Pulsar4X.CrossPlatformUI.Gtk2\bin\Debug\Pulsar4X.CrossPlatformUI.Gtk2.exe'
Loaded Module 'F:\Users\se5a\Documents\Projects-Code\CSharp\pulsar4x\pulsar4x\Pulsar4X\Pulsar4X.CrossPlatformUI.Gtk2\bin\Debug\OpenTK.dll'
Loaded Module 'F:\Users\se5a\Documents\Projects-Code\CSharp\pulsar4x\pulsar4x\Pulsar4X\Pulsar4X.CrossPlatformUI.Gtk2\bin\Debug\Eto.Gtk2.dll'
Loaded Module 'F:\Users\se5a\Documents\Projects-Code\CSharp\pulsar4x\pulsar4x\Pulsar4X\Pulsar4X.CrossPlatformUI.Gtk2\bin\Debug\Eto.dll'
Loaded Module 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll'
Loaded Module 'F:\Users\se5a\Documents\Projects-Code\CSharp\pulsar4x\pulsar4x\Pulsar4X\Pulsar4X.CrossPlatformUI.Gtk2\bin\Debug\Pulsar4X.CrossPlatformUI.dll'
Loaded Module 'C:\Windows\Microsof
@se5a
se5a / gist:f59b63b45ee43f8506aed0bc24e315be
Created September 24, 2016 19:21
Eto GenericControlStack
using System;
using Eto.Forms;
using Eto.Serialization.Xaml;
using System.Collections.Specialized;
using System.Collections;
namespace Pulsar4X.CrossPlatformUI.Views
{
public class GenericStackControl : Panel
{
make[3]: Entering directory '/mnt/98448323-4372-4c8a-904a-30b587cc3685/Games/warzone2100-3.2.2/src'
cd .. && ./build_tools/autorevision -t h -o /mnt/98448323-4372-4c8a-904a-30b587cc3685/Games/warzone2100-3.2.2/src/autorevision.cache > /mnt/98448323-4372-4c8a-904a-30b587cc3685/Games/warzone2100-3.2.2/src/autorevision.h.new
error: No repo or cache detected.
Makefile:1239: recipe for target 'autorevision.h' failed
make[3]: *** [autorevision.h] Error 1
make[3]: Leaving directory '/mnt/98448323-4372-4c8a-904a-30b587cc3685/Games/warzone2100-3.2.2/src'
Makefile:584: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/mnt/98448323-4372-4c8a-904a-30b587cc3685/Games/warzone2100-3.2.2'
Makefile:504: recipe for target 'all' failed
@se5a
se5a / gist:d1458eb992d952692fb0294bb9d038c3
Created March 11, 2017 09:27
DFhack crash when zooming out
Loading bindings from data/init/interface.txt
Resetting textures
Warning: Plugin automaterial compiled for DFHack 0.43.05-beta1-11-g67f39316, running DFHack 0.43.05-beta1-0-g33060c7d
Warning: Plugin resume compiled for DFHack 0.43.05-beta1-11-g67f39316, running DFHack 0.43.05-beta1-0-g33060c7d
Warning: Plugin mousequery compiled for DFHack 0.43.05-beta1-11-g67f39316, running DFHack 0.43.05-beta1-0-g33060c7d
Warning: Plugin twbt compiled for DFHack 0.43.05-beta1-11-g67f39316, running DFHack 0.43.05-beta1-0-g33060c7d
TWBT: version 5.77
TWBT: no display patch (not an error)
DFHack is ready. Have a nice day!
DFHack version 0.43.05-beta1 (release) on x86_64
@se5a
se5a / gist:9a0953f49591c53f1752a42f42a52b25
Created June 6, 2017 07:21
Rider Eto.Forms MD addin warnings
6/06/17
9:16 AM Project 'Eto.Addin.XamarinStudio' load finished with warnings: Could not resolve addin reference 'MonoDevelop.MacPlatform'
9:16 AM Project 'Eto - pcl' load finished with warnings: PCL Reference Assemblies not installed. at (188:3)
9:16 AM Project 'Eto.Serialization.Xaml - pcl' load finished with warnings: PCL Reference Assemblies not installed. at (188:3)
9:16 AM Project 'Eto.XamMac2 - net45' load failed: The imported project "/usr/lib/mono/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. /mnt/98448323-4372-4c8a-904a-30b587cc3685/Programing/Eto.Forms/Eto/Source/Eto.Mac/Eto.XamMac2 - net45.csproj at (249:3)
9:16 AM Project 'Eto.XamMac2 - mobile' load failed: The imported project "/usr/lib/mono/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. /mnt/98448323-4372-4c8a-904a-30b587cc