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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ assemblies/*.dll
CS2M/Library
*.sln.DotSettings.user
*.drawio.bkp
*.url
/.vs
assemblies.zip
/TemplateEngineHost
/.idea
76561197960271872 - Shortcut.lnk
13 changes: 0 additions & 13 deletions .idea/.idea.CS2M/.idea/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/.idea.CS2M/.idea/encodings.xml

This file was deleted.

11 changes: 0 additions & 11 deletions .idea/.idea.CS2M/.idea/indexLayout.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/.idea.CS2M/.idea/vcs.xml

This file was deleted.

2 changes: 1 addition & 1 deletion CS2M.API/CS2M.API.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>

<Import Project="$([System.Environment]::GetEnvironmentVariable('CSII_TOOLPATH', 'EnvironmentVariableTarget.Process'))\Mod.props"/>
Expand Down
1 change: 1 addition & 0 deletions CS2M.API/Commands/CommandBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ public abstract class CommandBase
/// The id of the sending player. -1 for the server.
/// </summary>
public int SenderId { get; set; }
public string MesasgeBody { get; set; }
}
}
4 changes: 2 additions & 2 deletions CS2M.BaseGame/CS2M.BaseGame.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\CS2M.API\CS2M.API.csproj" />
</ItemGroup>

<Import Project="$([System.Environment]::GetEnvironmentVariable('CSII_TOOLPATH', 'EnvironmentVariableTarget.Process'))\Mod.props"/>
<Import Project="$([System.Environment]::GetEnvironmentVariable('CSII_TOOLPATH', 'EnvironmentVariableTarget.Process'))\Mod.props" />

<ItemGroup>
<Reference Include="Colossal.Core">
Expand Down
14 changes: 7 additions & 7 deletions CS2M.Test/CS2M.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFramework>net48</TargetFramework>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
Expand All @@ -11,11 +11,11 @@
<PackageReference Include="MessagePack" Version="2.6.100-alpha" />
<PackageReference Include="MessagePack.Attributeless" Version="1.0.1" />
<PackageReference Include="MessagePack.UnityShims" Version="2.6.100-alpha" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0"/>
<PackageReference Include="NUnit" Version="3.13.3"/>
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1"/>
<PackageReference Include="NUnit.Analyzers" Version="3.6.1"/>
<PackageReference Include="coverlet.collector" Version="6.0.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="protobuf-net" Version="3.2.30" />
</ItemGroup>

Expand Down
170 changes: 0 additions & 170 deletions CS2M.UI/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion CS2M.UI/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
}
}
}
2 changes: 1 addition & 1 deletion CS2M.UI/src/extends/main-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const PauseMenuCSMExtend : ModuleRegistryExtend = (Component) => {
if (props.src == 'Media/Glyphs/ArrowRight.svg') {
return (
<>
<MenuButton onClick={showMultiplayerMenu}>Multiplayer</MenuButton>
<MenuButton onClick={showMultiplayerMenu}>Multiplayer [CS2M]</MenuButton>
<Component {...otherProps}>
{children}
</Component>
Expand Down
27 changes: 20 additions & 7 deletions CS2M.UI/src/screens/host-game-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export const username = bindValue<string>(mod.id, 'Username');
export const hostGameEnabled = bindValue<boolean>(mod.id, 'HostGameEnabled');
export const playerStatus = bindValue<string>(mod.id, 'PlayerStatus');

export const stopSrvVisible = bindValue<boolean>(mod.id, 'stopSrvVisible');

export function hideHostGame() {
trigger(mod.id, "HideHostGameMenu");
}
Expand All @@ -28,13 +30,19 @@ export function hostGame() {
trigger(mod.id, "HostGame");
}

export function stopServer() {
trigger(mod.id, "StopServer");
}

export const HostGameSettings = () => {
const GameOptionsCSS = getModule('game-ui/menu/components/shared/game-options/game-options.module.scss', 'classes');

let portValue = useValue(port);
let usernameValue = useValue(username);
let enabled = useValue(hostGameEnabled);



const focusChange = () => {};
return (
<FocusBoundary onFocusChange={focusChange}>
Expand All @@ -48,7 +56,7 @@ export const HostGameSettings = () => {
</NavigationScope>
</div>
<div className={GameOptionsCSS.infoColumn}>

Some info from server
</div>
</div>
</FocusBoundary>
Expand All @@ -71,18 +79,20 @@ export const HostGameMenu = () => {
const enabled = useValue(hostGameEnabled);
const status = useValue(playerStatus);

const stopSrvVis = useValue(stopSrvVisible);

const { translate } = useLocalization();

const actions = {};

let details = [];
let detailsTitle;
if (enabled) {
detailsTitle = translate("CS2M.UI.Compatibility");
detailsTitle = translate("CS2M.UI.Compatibility", "Compatibility");
for (let support of modSupports) {
let support_str = translate("CS2M.UI.Compatibility[" + support.support + "]", support.support);
if (support.client_side) {
support_str = translate("CS2M.UI.ClientSide");
support_str = translate("CS2M.UI.ClientSide", "Client Side");
}
let color;
switch (support.support) {
Expand All @@ -102,21 +112,24 @@ export const HostGameMenu = () => {
details.push(<div style={{color: color}}><Field label={support.name}>{support_str}</Field></div>);
}
} else {
detailsTitle = status ?? translate("CS2M.UI.StartingServer");
detailsTitle = status ?? translate("CS2M.UI.StartingServer", "StartingServer");
}

let footer = <FooterButton disabled={!enabled} onSelect={hostGame}>{translate("CS2M.UI.StartServer")}</FooterButton>;
let footer = <>
{!stopSrvVis && (<FooterButton disabled={!enabled} onSelect={hostGame}>{translate("CS2M.UI.StartServer", "Start Server")}</FooterButton>)}
{stopSrvVis && (<FooterButton onSelect={stopServer}>{translate("CS2M.UI.StopServer", "Stop Server")}</FooterButton>)}
</>;

let content;
if (visible) {
content = (
<SubScreen title={translate("CS2M.UI.Multiplayer")} onClose={hideHostGame}>
<SubScreen title={translate("CS2M.UI.Multiplayer", "Multiplayer")} onClose={hideHostGame}>
<InputActionConsumer actions={actions}>
<div className={LoadGameScreenCSS.content}>
<AutoNavigationScope>
<div className={LoadGameScreenCSS.stepContainer}>
<div className={SaveListCSS.saveList + " " + LoadGameScreenCSS.step}>
<div className={DetailSectionCSS.title}>{translate("CS2M.UI.HostGame")}</div>
<div className={DetailSectionCSS.title}>{translate("CS2M.UI.HostGame", "Host Game")}</div>
<HostGameSettings></HostGameSettings>
</div>
</div>
Expand Down
Loading