-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Build and buy mode are fully functional on residential lots. Some category icons still have to be drawn and included. - Simless build mode on community lots is partially implemented - You can now switch lots and close the game from the options mode. Alt-F4 and the close button bring up a dialog ingame that will let you save, when that is possible. - CAS is partially implemented. You can create a sim, though you cannot browse existing families or save the sim. - You can now browse through neighbourhoods when you are not playing a family. - TS1 neighbourhoods are now copied to My Documents/Simitone. This folder also contains your mesh cache, and other temporary data. - Now uses TS1 strings rather than TSO. - Touch mode scroll now supports 3D pan as well. Will be enabled on windows tablets in time. - Lots more.
- Loading branch information
1 parent
a7bc1a5
commit a15ff35
Showing
66 changed files
with
3,872 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+743 Bytes
Client/Simitone/Simitone.Client/Content/uigraphics/cas/cas_bio_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+977 Bytes
Client/Simitone/Simitone.Client/Content/uigraphics/cas/cas_cat_del.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+958 Bytes
Client/Simitone/Simitone.Client/Content/uigraphics/cas/cas_cat_edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.03 KB
Client/Simitone/Simitone.Client/Content/uigraphics/cas/cas_female.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+376 Bytes
Client/Simitone/Simitone.Client/Content/uigraphics/cas/cas_new_plus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.11 KB
Client/Simitone/Simitone.Client/Content/uigraphics/cas/cas_skindrk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.02 KB
Client/Simitone/Simitone.Client/Content/uigraphics/cas/cas_skinlgt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.17 KB
Client/Simitone/Simitone.Client/Content/uigraphics/cas/cas_skinmed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.8 KB
Client/Simitone/Simitone.Client/Content/uigraphics/common/btn_accept.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.8 KB
Client/Simitone/Simitone.Client/Content/uigraphics/common/btn_back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.78 KB
Client/Simitone/Simitone.Client/Content/uigraphics/live/cat/cat_build_arch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+497 Bytes
Client/Simitone/Simitone.Client/Content/uigraphics/live/cat/cat_build_door.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+702 Bytes
Client/Simitone/Simitone.Client/Content/uigraphics/live/cat/cat_build_fire.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+827 Bytes
Client/Simitone/Simitone.Client/Content/uigraphics/live/cat/cat_build_flor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.05 KB
Client/Simitone/Simitone.Client/Content/uigraphics/live/cat/cat_build_objs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.35 KB
Client/Simitone/Simitone.Client/Content/uigraphics/live/cat/cat_build_outs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1 KB
Client/Simitone/Simitone.Client/Content/uigraphics/live/cat/cat_build_roof.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.01 KB
Client/Simitone/Simitone.Client/Content/uigraphics/live/cat/cat_build_stai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+833 Bytes
Client/Simitone/Simitone.Client/Content/uigraphics/live/cat/cat_build_terr.png
Oops, something went wrong.
Binary file added
BIN
+955 Bytes
Client/Simitone/Simitone.Client/Content/uigraphics/live/cat/cat_build_tree.png
Oops, something went wrong.
Binary file added
BIN
+913 Bytes
Client/Simitone/Simitone.Client/Content/uigraphics/live/cat/cat_build_wall.png
Oops, something went wrong.
Binary file added
BIN
+1.04 KB
Client/Simitone/Simitone.Client/Content/uigraphics/live/cat/cat_build_walp.png
Oops, something went wrong.
Binary file added
BIN
+840 Bytes
Client/Simitone/Simitone.Client/Content/uigraphics/live/cat/cat_build_watr.png
Oops, something went wrong.
Binary file added
BIN
+581 Bytes
Client/Simitone/Simitone.Client/Content/uigraphics/live/cat/cat_build_wind.png
Oops, something went wrong.
Binary file added
BIN
+732 Bytes
Client/Simitone/Simitone.Client/Content/uigraphics/live/cat/cat_cancel.png
Oops, something went wrong.
Binary file added
BIN
+2.71 KB
Client/Simitone/Simitone.Client/Content/uigraphics/live/cat_thumb_bg.png
Oops, something went wrong.
Binary file added
BIN
+968 Bytes
Client/Simitone/Simitone.Client/Content/uigraphics/live/modes/opt_neigh.png
Oops, something went wrong.
Binary file added
BIN
+595 Bytes
Client/Simitone/Simitone.Client/Content/uigraphics/live/modes/opt_quit.png
Oops, something went wrong.
Binary file added
BIN
+525 Bytes
Client/Simitone/Simitone.Client/Content/uigraphics/live/modes/opt_save.png
Oops, something went wrong.
Binary file added
BIN
+760 Bytes
Client/Simitone/Simitone.Client/Content/uigraphics/live/query_title.png
Oops, something went wrong.
Binary file added
BIN
+8.75 KB
Client/Simitone/Simitone.Client/Content/uigraphics/live/touch/touch_buy.png
Oops, something went wrong.
Binary file added
BIN
+1.97 KB
Client/Simitone/Simitone.Client/Content/uigraphics/live/touch/touch_cross.png
Oops, something went wrong.
Binary file added
BIN
+9.79 KB
Client/Simitone/Simitone.Client/Content/uigraphics/live/touch/touch_place.png
Oops, something went wrong.
Binary file added
BIN
+7.71 KB
Client/Simitone/Simitone.Client/Content/uigraphics/live/touch/touch_rotccw.png
Oops, something went wrong.
Binary file added
BIN
+7.77 KB
Client/Simitone/Simitone.Client/Content/uigraphics/live/touch/touch_rotcw.png
Oops, something went wrong.
Binary file added
BIN
+8.26 KB
Client/Simitone/Simitone.Client/Content/uigraphics/live/touch/touch_tool.png
Oops, something went wrong.
Binary file added
BIN
+9.96 KB
Client/Simitone/Simitone.Client/Content/uigraphics/live/touch/touch_toolc.png
Oops, something went wrong.
Binary file added
BIN
+8.99 KB
Client/Simitone/Simitone.Client/Content/uigraphics/live/touch/touch_tools.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+9.37 KB
Client/Simitone/Simitone.Client/Content/uigraphics/ngbh/ngbh_downt.png
Oops, something went wrong.
Binary file added
BIN
+8.68 KB
Client/Simitone/Simitone.Client/Content/uigraphics/ngbh/ngbh_magic.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+7.59 KB
Client/Simitone/Simitone.Client/Content/uigraphics/ngbh/ngbh_studio.png
Oops, something went wrong.
Binary file added
BIN
+12.3 KB
Client/Simitone/Simitone.Client/Content/uigraphics/ngbh/ngbh_vacat.png
Oops, something went wrong.
206 changes: 206 additions & 0 deletions
206
Client/Simitone/Simitone.Client/UI/Panels/CAS/UIFamilyCASPanel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,206 @@ | ||
using FSO.Client; | ||
using FSO.Client.UI.Controls; | ||
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; | ||
using Simitone.Client.UI.Model; | ||
using Simitone.Client.UI.Screens; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Simitone.Client.UI.Panels.CAS | ||
{ | ||
public class UIFamilyCASPanel : UIContainer | ||
{ | ||
public UIDiagonalStripe NameStripe; | ||
public UIDiagonalStripe ListStripe; | ||
|
||
public UITextBox SecondName; | ||
public UIAvatarListPanel AvatarList; | ||
public UICategorySwitcher AvatarOptions; | ||
|
||
public Action<bool, int> ModifySim; | ||
|
||
private float _ShowI; | ||
public float ShowI | ||
{ | ||
get | ||
{ | ||
return _ShowI; | ||
} | ||
set | ||
{ | ||
if (value < 1 && AvatarOptions.CategoryExpand == 1) AvatarOptions.Close(); | ||
ListStripe.Visible = value > 0; | ||
NameStripe.Visible = value > 0; | ||
NameStripe.X = (1 - value) * UIScreen.Current.ScreenWidth; | ||
NameStripe.Y = 30; | ||
NameStripe.BodySize = new Point((int)(value * UIScreen.Current.ScreenWidth), NameStripe.BodySize.Y); | ||
ListStripe.BodySize = new Point((int)(value * UIScreen.Current.ScreenWidth), ListStripe.BodySize.Y); | ||
AvatarList.X = (1-value) * (-UIScreen.Current.ScreenWidth); | ||
SecondName.X = (1 - value) * (UIScreen.Current.ScreenWidth); | ||
_ShowI = value; | ||
} | ||
} | ||
|
||
private List<UICategory> AvatarCategories = new List<UICategory>() | ||
{ | ||
new UICategory() { ID = 0, IconName = "live_motives.png" }, //dummy | ||
new UICategory() { ID = 1, IconName = "cas_cat_edit.png" }, | ||
new UICategory() { ID = 2, IconName = "cas_cat_del.png" }, | ||
}; | ||
|
||
private int ActiveSelection = -1; | ||
private List<VMAvatar> Avatars; | ||
|
||
public UIFamilyCASPanel(List<VMAvatar> avatar) | ||
{ | ||
Avatars = avatar; | ||
|
||
AvatarOptions = new UICategorySwitcher(); | ||
AvatarOptions.InitCategories(AvatarCategories); | ||
AvatarOptions.MainButton.Visible = false; | ||
AvatarOptions.OnCategorySelect += AvatarOptions_OnCategorySelect; | ||
Add(AvatarOptions); | ||
|
||
NameStripe = new UIDiagonalStripe(new Point(0, 75), UIDiagonalStripeSide.LEFT, UIStyle.Current.Bg); | ||
NameStripe.Position = new Vector2(UIScreen.Current.ScreenWidth, 30); | ||
Add(NameStripe); | ||
|
||
SecondName = new UITextBox(); | ||
SecondName.TextMargin = new Rectangle(); | ||
SecondName.SetSize(UIScreen.Current.ScreenWidth, 60); | ||
SecondName.Alignment = TextAlignment.Center; | ||
SecondName.TextStyle = SecondName.TextStyle.Clone(); | ||
SecondName.TextStyle.Size = 37; | ||
SecondName.TextStyle.Color = UIStyle.Current.SecondaryText; | ||
SecondName.Position = new Vector2(0, 40); | ||
Add(SecondName); | ||
|
||
ListStripe = new UIDiagonalStripe(new Point(0, 125), UIDiagonalStripeSide.RIGHT, UIStyle.Current.Bg); | ||
ListStripe.Position = new Vector2(0, UIScreen.Current.ScreenHeight - 145); | ||
Add(ListStripe); | ||
|
||
AvatarList = new UIAvatarListPanel(avatar); | ||
AvatarList.Y = UIScreen.Current.ScreenHeight - 145; | ||
AvatarList.OnSelection += AvatarList_OnSelection; | ||
Add(AvatarList); | ||
|
||
Reset(); | ||
ShowI = ShowI; | ||
} | ||
|
||
private void AvatarOptions_OnCategorySelect(int obj) | ||
{ | ||
if (obj == 0) return; | ||
ModifySim?.Invoke((obj == 2), ActiveSelection); | ||
AvatarOptions.Select(0); | ||
} | ||
|
||
public void Reset() | ||
{ | ||
AvatarList.InitAvatarList(); | ||
ActiveSelection = -1; | ||
} | ||
|
||
private void AvatarList_OnSelection(int obj) | ||
{ | ||
if (obj >= Avatars.Count) | ||
{ | ||
ModifySim?.Invoke(false, -1); | ||
} else | ||
{ | ||
AvatarOptions.X = AvatarOptions.X = UIScreen.Current.ScreenWidth / 2 - (Avatars.Count()) * 50 + obj * 100 - 44; | ||
AvatarOptions.Y = UIScreen.Current.ScreenHeight - 145; | ||
if (AvatarOptions.CategoryExpand < 1 || ActiveSelection == -1 || ActiveSelection == obj) | ||
AvatarOptions.Open(); | ||
} | ||
ActiveSelection = obj; | ||
} | ||
|
||
public override void GameResized() | ||
{ | ||
base.GameResized(); | ||
AvatarList.Y = UIScreen.Current.ScreenHeight - 145; | ||
ListStripe.Position = new Vector2(0, UIScreen.Current.ScreenHeight - 145); | ||
SecondName.SetSize(UIScreen.Current.ScreenWidth, 60); | ||
|
||
if (ActiveSelection > -1) | ||
{ | ||
AvatarOptions.X = UIScreen.Current.ScreenWidth / 2 - (Avatars.Count()) * 50 + ActiveSelection*100 - 44; | ||
AvatarOptions.Y = UIScreen.Current.ScreenHeight - 145; | ||
} | ||
|
||
AvatarList.InitAvatarList(); | ||
} | ||
} | ||
|
||
public class UIAvatarListPanel : UIContainer | ||
{ | ||
private List<VMAvatar> Avatars; | ||
private List<UIAvatarSelectButton> Btns = new List<UIAvatarSelectButton>(); | ||
private Texture2D Bg; | ||
public event Action<int> OnSelection; | ||
public UIAvatarListPanel(List<VMAvatar> avatar) | ||
{ | ||
Avatars = avatar; | ||
|
||
InitAvatarList(); | ||
} | ||
|
||
public void InitAvatarList() | ||
{ | ||
int i = 0; | ||
foreach (var btn in Btns) | ||
{ | ||
Remove(btn); | ||
} | ||
Btns.Clear(); | ||
|
||
i = 0; | ||
var baseX = UIScreen.Current.ScreenWidth/2 - (Avatars.Count()) * 50; | ||
foreach (var fam in Avatars) | ||
{ | ||
var btn = new UIAvatarSelectButton(UIIconCache.GetObject(fam)); | ||
btn.Opacity = 1f; | ||
var id = i; | ||
btn.OnButtonClick += (b) => { Select(id); }; | ||
btn.Name = fam.Name; | ||
btn.X = baseX + (i++) * 100; | ||
btn.Y = 50; | ||
Btns.Add(btn); | ||
Add(btn); | ||
} | ||
var btn2 = new UIAvatarSelectButton(Content.Get().CustomUI.Get("cas_new_plus.png").Get(GameFacade.GraphicsDevice)); | ||
btn2.Opacity = 1f; | ||
var id2 = i; | ||
btn2.OnButtonClick += (b) => { Select(id2); }; | ||
btn2.X = baseX + (i++) * 100; | ||
btn2.Y = 50; | ||
Btns.Add(btn2); | ||
Add(btn2); | ||
} | ||
|
||
private void Select(int selected) | ||
{ | ||
int i = 0; | ||
foreach (var btn in Btns) | ||
{ | ||
btn.Outlined = (i++) == selected; | ||
} | ||
OnSelection?.Invoke(selected); | ||
} | ||
|
||
public override void Draw(UISpriteBatch batch) | ||
{ | ||
base.Draw(batch); | ||
} | ||
} | ||
} |
Oops, something went wrong.