Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build Simitone

on:
workflow_dispatch:
inputs:
configuration:
description: 'Build configuration'
required: false
default: 'Release'
type: choice
options:
- Release
- Debug

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

- name: Run Protobuild
shell: pwsh
run: |
cd FreeSO/Other/libs/FSOMonoGame/
./protobuild.exe --generate
continue-on-error: true

- name: Restore Simitone dependencies
run: dotnet restore Client/Simitone/Simitone.sln

- name: Restore FreeSO dependencies
run: dotnet restore FreeSO/TSOClient/FreeSO.sln
continue-on-error: true

- name: Restore Roslyn dependencies
shell: pwsh
run: |
cd FreeSO/TSOClient/FSO.SimAntics.JIT.Roslyn/
dotnet restore
continue-on-error: true

- name: Build
run: dotnet build Client/Simitone/Simitone.sln -c ${{ inputs.configuration || 'Release' }} --no-restore

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: SimitoneWindows-${{ inputs.configuration || 'Release' }}
path: Client/Simitone/Simitone.Windows/bin/${{ inputs.configuration || 'Release' }}/net9.0-windows/
if-no-files-found: error
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "FreeSO"]
path = FreeSO
url = https://github.com/riperiperi/FreeSO
url = https://github.com/alexjyong/FreeSO
Binary file not shown.
Binary file not shown.
8 changes: 8 additions & 0 deletions Client/Simitone/Simitone.Client/Simitone.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,14 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Content\Sounds\rain_loop.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Sounds\thunder.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\FreeSO\TSOClient\FSO.UI\FSO.UI.csproj" />
<ProjectReference Include="..\..\..\FreeSO\TSOClient\tso.common\FSO.Common.csproj" />
Expand Down
3 changes: 3 additions & 0 deletions Client/Simitone/Simitone.Client/SimitoneGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ protected override void LoadContent()
}

FSO.Vitaboy.Avatar.setVitaboyEffect(vitaboyEffect);

WeatherSounds.Load("Content");
}

/// <summary>
Expand All @@ -268,6 +270,7 @@ protected override void LoadContent()
protected override void UnloadContent()
{
// TODO: Unload any non ContentManager content here
WeatherSounds.Unload();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,13 @@ public override void Update(UpdateState state)

//KEY SHORTCUTS
var keys = state.NewKeys;
var nofocus = true;
var nofocus = state.InputManager.GetFocus() == null; // Only process shortcuts when no text input has focus
if (Game.InLot)
{
if (keys.Contains(Keys.F1) && !LiveButton.Disabled) OnModeClick?.Invoke(UIMainPanelMode.LIVE);
if (keys.Contains(Keys.F2) && !BuyButton.Disabled) OnModeClick?.Invoke(UIMainPanelMode.BUY);
if (keys.Contains(Keys.F3) && !BuildButton.Disabled) OnModeClick?.Invoke(UIMainPanelMode.BUILD);
if (keys.Contains(Keys.F4)) OnModeClick?.Invoke(UIMainPanelMode.OPTIONS); // Options Panel
if (nofocus && keys.Contains(Keys.F1) && !LiveButton.Disabled) OnModeClick?.Invoke(UIMainPanelMode.LIVE);
if (nofocus && keys.Contains(Keys.F2) && !BuyButton.Disabled) OnModeClick?.Invoke(UIMainPanelMode.BUY);
if (nofocus && keys.Contains(Keys.F3) && !BuildButton.Disabled) OnModeClick?.Invoke(UIMainPanelMode.BUILD);
if (nofocus && keys.Contains(Keys.F4)) OnModeClick?.Invoke(UIMainPanelMode.OPTIONS); // Options Panel

if (nofocus)
{
Expand Down
72 changes: 70 additions & 2 deletions Client/Simitone/Simitone.Client/UI/Panels/UICheatTextbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public override void Update(UpdateState state)
&& state.NewKeys.Contains(Keys.C)) //prevent change over multiple frames
{
Visible = !Visible;
if (!Visible) state.InputManager.SetFocus(null);
else state.InputManager.SetFocus(baseTextbox);
}
baseTextbox.Visible = Visible;
if (Visible)
Expand All @@ -96,6 +98,14 @@ private void commandEntered(string commandString, out bool shouldHide)
shouldHide = true;
if (string.IsNullOrWhiteSpace(commandString)) return; // a blank textbox should close after hitting enter -- even if a command was never run.

// Handle weather commands separately (they don't use VMCheatContext)
if (trimRepetitions(commandString).StartsWith("weather", StringComparison.OrdinalIgnoreCase))
{
HandleWeatherCommand(commandString);
baseTextbox.CurrentText = "";
return;
}

var cheat = new VMNetCheatCmd();
var context = new VMCheatContext();
var repetitions = getRepetitions(commandString);
Expand All @@ -111,7 +121,7 @@ private void commandEntered(string commandString, out bool shouldHide)
context.Amount = (int)VMCheatContext.BudgetCheatPresetAmount.MOTHERLODE;
context.CheatBehavior = VMCheatContext.VMCheatType.Budget;
break;
default: context = parseCommandString(commandString); break;
default: context = parseCommandString(commandString); break;
}
cheat.Context = context;
shouldHide = false;
Expand Down Expand Up @@ -204,6 +214,64 @@ private VMCheatContext parseCommandString(string command)
}
}
return context;
}
}

private void HandleWeatherCommand(string command)
{
var parts = command.ToLower().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

if (parts.Length < 2)
{
FSO.HIT.HITVM.Get().PlaySoundEvent(UISounds.Error);
return;
}

string weatherType = parts[1];
int intensity = 50;

if (parts.Length >= 3 && int.TryParse(parts[2], out int parsedIntensity))
{
intensity = Math.Clamp(parsedIntensity, 0, 100);
}

short weatherData = 0;

switch (weatherType)
{
case "rain":
weatherData = (short)((1 << 8) | (0 << 9) | intensity);
break;
case "storm":
case "thunder":
if (parts.Length < 3) intensity = 75;
weatherData = (short)((1 << 8) | (1 << 11) | (0 << 9) | intensity);
break;
case "snow":
weatherData = (short)((1 << 8) | (1 << 9) | intensity);
break;
case "hail":
weatherData = (short)((1 << 8) | (2 << 9) | intensity);
break;
case "clear":
weatherData = (short)(1 << 8);
break;
case "auto":
weatherData = 0;
break;
default:
FSO.HIT.HITVM.Get().PlaySoundEvent(UISounds.Error);
return;
}

if (ts1VM?.Context?.Blueprint?.Weather != null)
{
ts1VM.Context.Blueprint.Weather.SetWeather(weatherData);
FSO.HIT.HITVM.Get().PlaySoundEvent(UISounds.Click);
}
else
{
FSO.HIT.HITVM.Get().PlaySoundEvent(UISounds.Error);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ private void CutPanel_OnSelection(int obj)
public float ClockTween;
public override void Update(UpdateState state)
{
if (state.NewKeys.Contains(Keys.Space))
// Only switch Sims with Space if no text input has focus
if (state.NewKeys.Contains(Keys.Space) && state.InputManager.GetFocus() == null)
{
var selected = Game.LotControl.ActiveEntity;
var familyMembers = Game.vm.Context.ObjectQueries.Avatars.Where(x =>
Expand Down
Loading