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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Client/Simitone/Simitone.Client/Simitone.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@
<Content Include="Content\uigraphics\live\modes\opt_save.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\uigraphics\live\modes\opt_freewill.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\uigraphics\live\money_bg.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
4 changes: 4 additions & 0 deletions Client/Simitone/Simitone.Client/SimitoneGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ protected override void Initialize()
if (FSOEnvironment.Enable3D) FSO.Files.RC.DGRP3DMesh.InitRCWorkers();
//FSO.Content.Content.Init(GlobalSettings.Default.StartupPath, GraphicsDevice);
FSO.SimAntics.VMAvatar.MissingIconProvider = Simitone.Client.UI.Model.UIIconCache.GetObject;

// Initialize Free Will setting from config
VM.FreeWillEnabled = GlobalSettings.Default.TS1FreeWill;

base.Initialize();

GameFacade.GameThread = Thread.CurrentThread;
Expand Down
43 changes: 43 additions & 0 deletions Client/Simitone/Simitone.Client/UI/Panels/UIMainPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using FSO.Client.UI.Framework;
using FSO.Common.Utils;
using FSO.Content;
using FSO.SimAntics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Simitone.Client.UI.Controls;
Expand Down Expand Up @@ -242,6 +243,7 @@ public void Switcher_OnCategorySelect(int obj)
new UICatFunc(GameFacade.Strings.GetString("145", "1"), "opt_neigh.png", () => { Game.ReturnToNeighbourhood(); }),
new UICatFunc(GameFacade.Strings.GetString("145", "5"), "opt_quit.png", () => { Game.CloseAttempt(); }),
});
AddFreeWillToggle(panel);
break;
}
SetSubpanel(panel);
Expand Down Expand Up @@ -434,6 +436,47 @@ public void ShowSelect()
};
}

private void AddFreeWillToggle(UISubpanel parent)
{
// Index 3 (4th button) to match spacing of existing buttons
// Existing buttons use: 50 + i * 120f for button X, 50 + i * 120f - 27 for label X
int index = 3;
float buttonX = 50 + index * 120f;
float labelX = buttonX - 27;

var label = new UILabel();
label.Alignment = TextAlignment.Middle | TextAlignment.Center;
label.Wrapped = true;
label.Position = new Vector2(labelX - 77, 106);
label.Size = new Vector2(120, 1);
label.CaptionStyle = label.CaptionStyle.Clone();
label.CaptionStyle.Size = 12;
label.CaptionStyle.Color = UIStyle.Current.Text;

Action updateLabel = () => {
bool enabled = VM.FreeWillEnabled;
label.Caption = "Free Will:\n" + (enabled ? "ON" : "OFF");
label.CaptionStyle.Color = enabled ? UIStyle.Current.Text : UIStyle.Current.NegMoney;
};

var toggleButton = new UICatButton(Content.Get().CustomUI.Get("opt_freewill.png").Get(GameFacade.GraphicsDevice));
toggleButton.Position = new Vector2(buttonX - 50, 16);
toggleButton.OnButtonClick += (btn) => {
VM.FreeWillEnabled = !VM.FreeWillEnabled;
GlobalSettings.Default.TS1FreeWill = VM.FreeWillEnabled;
GlobalSettings.Default.Save();
updateLabel();
};

// Animate in like other buttons
GameFacade.Screens.Tween.To(label, 0.5f, new Dictionary<string, float>() { { "X", labelX } }, TweenQuad.EaseOut);
GameFacade.Screens.Tween.To(toggleButton, 0.5f, new Dictionary<string, float>() { { "X", buttonX } }, TweenQuad.EaseOut);

parent.Add(label);
parent.Add(toggleButton);
updateLabel();
}

public override void GameResized()
{
base.GameResized();
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ On modern operating systems, The Sims has a few nagging issues that make it less
Simitone -> Semitone -> musical term -> C# -> a note

Further questions can be directed at my PR manager, uh, ... burglar cop.


# Attributions

Icon for Free Will option: <a target="_blank" href="https://icons8.com/icon/13KBHI5xdOT3/creativity-and-resourcefulness">Creativity And Resourcefulness</a> icon by <a target="_blank" href="https://icons8.com">Icons8</a>