-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #497 from Nashet/Map-options
Map options
- Loading branch information
Showing
67 changed files
with
3,264 additions
and
45 deletions.
There are no files selected for viewing
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file added
BIN
+16.1 KB
Assets/EconomicSimulation/Resources/Prefabs/Windows/BtnOpenFileImage.prefab
Binary file not shown.
10 changes: 10 additions & 0 deletions
10
Assets/EconomicSimulation/Resources/Prefabs/Windows/BtnOpenFileImage.prefab.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file added
BIN
+49.3 KB
Assets/EconomicSimulation/Resources/Prefabs/Windows/MapOptions.prefab
Binary file not shown.
10 changes: 10 additions & 0 deletions
10
Assets/EconomicSimulation/Resources/Prefabs/Windows/MapOptions.prefab.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file added
BIN
+6.88 KB
Assets/EconomicSimulation/Resources/Prefabs/Windows/OutputImage.prefab
Binary file not shown.
10 changes: 10 additions & 0 deletions
10
Assets/EconomicSimulation/Resources/Prefabs/Windows/OutputImage.prefab.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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,89 @@ | ||
using Nashet.UnityUIUtils; | ||
|
||
using SFB; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
namespace Nashet.EconomicSimulation | ||
{ | ||
/// <summary> | ||
/// Warning! This mono object will not work in webGL if instantiated (will not load image file) | ||
/// </summary> | ||
class MapOptions : Hideable | ||
{ | ||
static public bool MadeChoise; | ||
[SerializeField] | ||
private Toggle randomMap; | ||
|
||
[SerializeField] | ||
private CanvasSampleOpenFileImage imageOpener; | ||
|
||
[SerializeField] | ||
private RawImage loadedImage; | ||
|
||
[SerializeField] | ||
private Button generate, loadImage; | ||
|
||
internal static Texture2D MapImage; | ||
|
||
private void Start() | ||
{ | ||
//GetComponent<RectTransform>().anchoredPosition = new Vector2(800f, 200f); | ||
GUIChanger.Apply(gameObject); | ||
} | ||
//public override void Refresh() | ||
//{ | ||
|
||
//} | ||
public void OnMapFromFileToggled(bool value) | ||
{ | ||
if (value == true) | ||
{ | ||
generate.interactable = false; | ||
loadImage.interactable = true; | ||
} | ||
else | ||
{ | ||
generate.interactable = true; | ||
loadImage.interactable = false; | ||
} | ||
} | ||
public void OnLoadImageClicked() | ||
{ | ||
|
||
} | ||
public void OnGenerate() | ||
{ | ||
if (randomMap.isOn) | ||
{ | ||
Game.readMapFormFile = false; | ||
MadeChoise = true; | ||
Hide(); | ||
} | ||
else //take picture | ||
{ | ||
if (loadedImage.texture == null) //todo thats never true | ||
Message.NewMessage("", "Wasn't able to load that image", "Ok", false); | ||
else | ||
{ | ||
Game.readMapFormFile = true; | ||
MapImage = loadedImage.texture as Texture2D; | ||
MadeChoise = true; | ||
Hide(); | ||
} | ||
} | ||
|
||
} | ||
private void Update() | ||
{ | ||
if (!randomMap.isOn) | ||
generate.interactable = loadedImage.texture!=null; | ||
generate.interactable = true; | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
Assets/EconomicSimulation/Scripts/Panels/MapOptions.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Oops, something went wrong.