TheOneAndOnly
TheOneAndOnly
CC#
Created by TheOneAndOnly on 12/10/2023 in #help
Local and world position changing
Is that not correct than?
7 replies
CC#
Created by TheOneAndOnly on 12/10/2023 in #help
Local and world position changing
I though that I read that if you change the position of the child object that the parent object moves along
7 replies
CC#
Created by TheOneAndOnly on 12/10/2023 in #help
Local and world position changing
The child object moves to the new position best the rest does simple not
7 replies
CC#
Created by TheOneAndOnly on 11/9/2023 in #help
❔ How to bind data to a listbox that doesnt come out of a database?
Will try to make it a observable and hope that works than
25 replies
CC#
Created by TheOneAndOnly on 11/9/2023 in #help
❔ How to bind data to a listbox that doesnt come out of a database?
Fair enough
25 replies
CC#
Created by TheOneAndOnly on 11/9/2023 in #help
❔ How to bind data to a listbox that doesnt come out of a database?
C#
public IdeologiesWindow(MenuWindow menu)
{
this.menu = menu;
data = menu.projectData;
settings = menu.settingData;
InitializeComponent();
}
C#
public IdeologiesWindow(MenuWindow menu)
{
this.menu = menu;
data = menu.projectData;
settings = menu.settingData;
InitializeComponent();
}
InitializeComponent is run as last shouldnt that assure that the list is defined before binding?
25 replies
CC#
Created by TheOneAndOnly on 11/9/2023 in #help
❔ How to bind data to a listbox that doesnt come out of a database?
But it still doesnt work
25 replies
CC#
Created by TheOneAndOnly on 11/9/2023 in #help
❔ How to bind data to a listbox that doesnt come out of a database?

<Window x:Class="LOTRModdingProgram.Windows.IdeologiesWindow"
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:LOTRModdingProgram.Windows"
mc:Ignorable="d"
Title="IdeologiesWindow" Height="850" Width="1200">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="79*"/>
<RowDefinition Height="756*"/>
</Grid.RowDefinitions>
<ListBox x:Name="list_ideologies" Margin="0,0,1031,10" Grid.RowSpan="2" DisplayMemberPath="name" ItemsSource="{Binding data.ideologies}"/>
</Grid>
</Window>

<Window x:Class="LOTRModdingProgram.Windows.IdeologiesWindow"
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:LOTRModdingProgram.Windows"
mc:Ignorable="d"
Title="IdeologiesWindow" Height="850" Width="1200">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="79*"/>
<RowDefinition Height="756*"/>
</Grid.RowDefinitions>
<ListBox x:Name="list_ideologies" Margin="0,0,1031,10" Grid.RowSpan="2" DisplayMemberPath="name" ItemsSource="{Binding data.ideologies}"/>
</Grid>
</Window>
25 replies
CC#
Created by TheOneAndOnly on 11/9/2023 in #help
❔ How to bind data to a listbox that doesnt come out of a database?
Its only this
25 replies
CC#
Created by TheOneAndOnly on 11/9/2023 in #help
❔ How to bind data to a listbox that doesnt come out of a database?
That is really weird than
25 replies
CC#
Created by TheOneAndOnly on 11/9/2023 in #help
❔ How to bind data to a listbox that doesnt come out of a database?
That is my ideology class
25 replies
CC#
Created by TheOneAndOnly on 11/9/2023 in #help
❔ How to bind data to a listbox that doesnt come out of a database?
C#
public class Ideology
{
public string name { get; set; }
public string color { get; set; }
private List<SubIdeology> subideologiesl;
private List<string> dynamic_faction_names;
private List<NameValue> rules;
private List<NameValue> modifiers;
public bool can_collaborate { get; set; }
public bool ai_fascist { get; set; }
public double war_impact_on_world_tension { get; set; }
public double faction_impact_on_world_tension { get; set; }
public double ai_ideology_wanted_units_factor { get; set; }

public Ideology(string _name)
{
dynamic_faction_names = new List<string>();
rules = new List<NameValue>();
modifiers = new List<NameValue>();
subideologiesl = new List<SubIdeology>();
name = _name;
}

public void AddFactionName(string name)
{
dynamic_faction_names.Add(name);
}
public void AddRule(string name, string value)
{
rules.Add(new NameValue(name, value));
}
public void AddModifier(string name, string value)
{
modifiers.Add(new NameValue(name, value));
}
public void AddSubIdeology(SubIdeology subIdeology)
{
subideologiesl.Add(subIdeology);
}
}
public struct NameValue
{
public string name;
public string value;
public NameValue(string name, string value) { this.name = name; this.value = value; }
}

public struct SubIdeology
{
public string name;
public bool can_be_randomly_selected;
public List<NameValue> modifiers;
public SubIdeology(string name) { this.name = name; }
}
C#
public class Ideology
{
public string name { get; set; }
public string color { get; set; }
private List<SubIdeology> subideologiesl;
private List<string> dynamic_faction_names;
private List<NameValue> rules;
private List<NameValue> modifiers;
public bool can_collaborate { get; set; }
public bool ai_fascist { get; set; }
public double war_impact_on_world_tension { get; set; }
public double faction_impact_on_world_tension { get; set; }
public double ai_ideology_wanted_units_factor { get; set; }

public Ideology(string _name)
{
dynamic_faction_names = new List<string>();
rules = new List<NameValue>();
modifiers = new List<NameValue>();
subideologiesl = new List<SubIdeology>();
name = _name;
}

public void AddFactionName(string name)
{
dynamic_faction_names.Add(name);
}
public void AddRule(string name, string value)
{
rules.Add(new NameValue(name, value));
}
public void AddModifier(string name, string value)
{
modifiers.Add(new NameValue(name, value));
}
public void AddSubIdeology(SubIdeology subIdeology)
{
subideologiesl.Add(subIdeology);
}
}
public struct NameValue
{
public string name;
public string value;
public NameValue(string name, string value) { this.name = name; this.value = value; }
}

public struct SubIdeology
{
public string name;
public bool can_be_randomly_selected;
public List<NameValue> modifiers;
public SubIdeology(string name) { this.name = name; }
}
25 replies
CC#
Created by TheOneAndOnly on 11/9/2023 in #help
❔ How to bind data to a listbox that doesnt come out of a database?
I run this
projectData.ideologies = ProjectLoader.LoadInIdeologies(projectData.GetProjectFolder("ideologies"));
projectData.ideologies = ProjectLoader.LoadInIdeologies(projectData.GetProjectFolder("ideologies"));
When starting up the menu window and loading in all the data/settings
25 replies
CC#
Created by TheOneAndOnly on 11/9/2023 in #help
❔ How to bind data to a listbox that doesnt come out of a database?
Yeah, the list is correctly filled I have checked that
25 replies
CC#
Created by TheOneAndOnly on 11/9/2023 in #help
❔ How to bind data to a listbox that doesnt come out of a database?
public ProjectData()
{
countries = new Countries();
focusIcons = new List<FocusIcon>();
ideologies = new List<Ideology>();
projectFolder = new Dictionary<string, string>();
}
public ProjectData()
{
countries = new Countries();
focusIcons = new List<FocusIcon>();
ideologies = new List<Ideology>();
projectFolder = new Dictionary<string, string>();
}
ideologies is a simple list storing all the ideologies
25 replies
CC#
Created by TheOneAndOnly on 10/25/2023 in #help
❔ How would one convert string to int?
Hehe 69
19 replies
CC#
Created by TheOneAndOnly on 10/25/2023 in #help
❔ How would one convert string to int?
Its representive of a percentage, so the only thing I would maybe have to do is *100
19 replies
CC#
Created by TheOneAndOnly on 10/25/2023 in #help
❔ How would one convert string to int?
Thanks!
19 replies
CC#
Created by TheOneAndOnly on 10/25/2023 in #help
❔ How would one convert string to int?
But needed to no how to Parse with C#
19 replies
CC#
Created by TheOneAndOnly on 10/25/2023 in #help
❔ How would one convert string to int?
Oo yeah no not a int indeed
19 replies