Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
LayerUploader Class Reference
Inheritance diagram for LayerUploader:
ELayer Layer IUISkin

Public Member Functions

override void OnInit ()
 
override void OnKill ()
 
void SaveID ()
 
void ExportMap ()
 
void Upload ()
 
- Public Member Functions inherited from ELayer
override void OnBeforeAddLayer ()
 
void InitInspector ()
 
sealed override void Init ()
 
override void OnAfterAddLayer ()
 
void TryShowHelp ()
 
void AddLayerToUI (string id)
 
void TryShowHint (string _langHint=null)
 
void TalkHomeMemeber (string id)
 
void TalkMaid (string id)
 
override void OnRightClick ()
 
- Public Member Functions inherited from Layer
virtual string GetTextHeader (Window window)
 
virtual bool HeaderIsListOf (int id)
 
virtual void Init ()
 
virtual void OnInit ()
 
virtual void OnAfterInit ()
 
virtual void ApplySkin ()
 
void ShowScreenLock (string id)
 
void UpdateInput ()
 
virtual void OnUpdateInput ()
 
virtual void OnRightClick ()
 
virtual bool OnBack ()
 
virtual void OnChangeLayer ()
 
virtual void OnCreate ()
 
void _AddLayer (string id)
 
Layer AddLayer (string id)
 
AddLayer< T > ()
 
AddLayer< T > (string id)
 
AddLayerDontCloseOthers< T > ()
 
Layer AddLayerDontCloseOthers (Layer l)
 
GetOrAddLayer< T > ()
 
virtual void OnBeforeAddLayer ()
 
virtual void OnAfterAddLayer ()
 
Layer AddLayer (Layer l)
 
void ToggleLayer (string id)
 
ToggleLayer< T > (string id=null)
 
void WaitAndClose ()
 
void OnClickClose ()
 
virtual void Close ()
 
void CloseLayers ()
 
void RemoveLayers (bool removeImportant=false)
 
bool RemoveLayer< T > ()
 
void RemoveLayer (Layer l)
 
virtual void OnKill ()
 
Layer SetOnKill (Action action)
 
void DisableClose ()
 
void Delay (float duration=0.05f)
 
Layer SetDelay (float d)
 
Layer GetLayer (string id)
 
GetLayer< T > (bool fromTop=false)
 
Layer GetTopLayer ()
 
void SwitchContent (int idWindow, int i)
 
virtual void OnSwitchContent (Window window)
 
Layer SetTitles (string langList, string idHeaderRow=null)
 
bool IsBlockWidgetClick ()
 
bool IsHideHud ()
 
bool IsAllowGeneralInput ()
 
bool IsUseBlur ()
 
bool IsPointerOnLayer ()
 
void ApplySkin ()
 

Public Attributes

InputField inputId
 
InputField inputPassword
 
InputField inputWelcome
 
IniData ini
 
UIText textInvalidId
 
UIText textInvalidPass
 
UIText textNextUpload
 
UIButton buttonUpload
 
UIButton buttonSave
 
UIButton toggleClearLocalCharas
 
int limitSec
 
HashSet< string > invalidIds = new HashSet<string>()
 
bool validId
 
bool validPass
 
- Public Attributes inherited from Layer
Option option
 
UnityEvent onKill
 
Anime animeIn
 
Anime animeOut
 
bool closeOthers
 
bool defaultActionMode = true
 
Button screenLock
 
Layer parent
 
string idLayer
 
List< Layerlayers = new List<Layer>()
 
Vector2 lastParentPos
 
List< Windowwindows = new List<Window>()
 
string langHint
 

Static Public Attributes

static int nextUpload
 
static char[] InvalidChars
 
- Static Public Attributes inherited from Layer
static int skipInput
 
static bool closeOnRightClick
 
static bool rightClicked
 
static bool cancelKeyDown
 
static bool ignoreSounds
 
static Transform blurStopInstance
 
static string[] searchPath = new string[3] { "Layer", "Layer/Dialog", "Layer/LayerHome" }
 

Properties

string savePath [get]
 
- Properties inherited from ELayer
static Core core [get]
 
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static FactionBranch Branch [get]
 
static Faction Home [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static CoreConfig config [get]
 
static GameSetting setting [get]
 
static ColorProfile Colors [get]
 
static SourceManager sources [get]
 
static World world [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 
bool IsFloat [get]
 
virtual string IdHelp [get]
 
- Properties inherited from Layer
Layer TopLayer [get]
 
string uid [get]
 
virtual RectTransform rectLayers [get]
 
virtual bool blockWidgetClick [get]
 

Private Member Functions

void Update ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ELayer
static int rnd (int a)
 
- Static Public Member Functions inherited from Layer
static T Create< T > ()
 
static T Create< T > (string path)
 
static Layer Create (string path)
 
- Protected Member Functions inherited from ELayer
sealed override void _Close ()
 
sealed override void Kill ()
 
- Protected Member Functions inherited from Layer
virtual void Awake ()
 
virtual void _Close ()
 
virtual void Kill ()
 
- Protected Attributes inherited from Layer
RectTransform _rect
 
bool isDestroyed
 

Detailed Description

Definition at line 7 of file LayerUploader.cs.

Member Function Documentation

◆ ExportMap()

void LayerUploader.ExportMap ( )
inline

Definition at line 113 of file LayerUploader.cs.

114 {
115 ELayer._zone.Export(savePath, null, usermap: true);
116 Msg.Say("net_mapSaved".lang(savePath));
117 SE.WriteJournal();
118 }
Definition: ELayer.cs:4
static Zone _zone
Definition: ELayer.cs:25
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
void Export(string path, PartialMap partial=null, bool usermap=false)
Definition: Zone.cs:2898

References ELayer._zone, Zone.Export(), savePath, and Msg.Say().

Referenced by Upload().

◆ OnInit()

override void LayerUploader.OnInit ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 50 of file LayerUploader.cs.

51 {
53 string text = ini.GetKey("pass") ?? "password";
54 inputId.text = ELayer._map.custom?.id ?? "new_zone";
55 inputPassword.text = text;
56 if (ELayer._map.exportSetting == null)
57 {
58 ELayer._map.exportSetting = new MapExportSetting();
59 }
61 inputWelcome.text = ex.textWelcome.IsEmpty("");
62 inputWelcome.onValueChanged.AddListener(delegate(string s)
63 {
64 ex.textWelcome = s;
65 });
67 {
68 ex.clearLocalCharas = on;
69 });
70 }
Definition: Core.cs:14
static IniData GetElinIni()
Definition: Core.cs:759
string id
Definition: CustomData.cs:6
static Map _map
Definition: ELayer.cs:23
UIButton toggleClearLocalCharas
InputField inputWelcome
CustomData custom
Definition: Map.cs:40
MapExportSetting exportSetting
Definition: Map.cs:73
void SetToggle(bool isOn, Action< bool > onToggle=null)
Definition: UIButton.cs:341

References ELayer._map, MapExportSetting.clearLocalCharas, Map.custom, Map.exportSetting, Core.GetElinIni(), CustomData.id, ini, inputWelcome, UIButton.SetToggle(), MapExportSetting.textWelcome, and toggleClearLocalCharas.

◆ OnKill()

override void LayerUploader.OnKill ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 95 of file LayerUploader.cs.

96 {
97 if (validId && validPass)
98 {
99 SaveID();
100 }
101 }

References SaveID(), validId, and validPass.

◆ SaveID()

void LayerUploader.SaveID ( )
inline

Definition at line 103 of file LayerUploader.cs.

104 {
105 if (ELayer._map.custom != null)
106 {
107 ELayer._map.custom.id = inputId.text;
108 }
109 ini.Global["pass"] = inputPassword.text;
111 }
static void SaveElinIni(IniData ini)
Definition: Core.cs:793
InputField inputPassword
InputField inputId

References ELayer._map, Map.custom, ini, inputId, inputPassword, and Core.SaveElinIni().

Referenced by OnKill(), and Upload().

◆ Update()

void LayerUploader.Update ( )
inlineprivate

Definition at line 72 of file LayerUploader.cs.

73 {
74 string text = inputId.text;
75 validId = text.Length >= 3 && text.IndexOfAny(InvalidChars) == -1 && !invalidIds.Contains(text);
76 text = inputPassword.text;
77 validPass = text.Length >= 3 && text.IndexOfAny(InvalidChars) == -1;
78 textInvalidId.SetActive(!validId);
79 textInvalidPass.SetActive(!validPass);
80 bool interactableWithAlpha = validId && validPass;
81 buttonSave.SetInteractableWithAlpha(interactableWithAlpha);
82 int num = nextUpload - (int)Time.realtimeSinceStartup;
83 textNextUpload.SetActive(num > 0);
84 if (num > 0)
85 {
86 textNextUpload.text = "net_nextUpload".lang(num.ToString() ?? "");
87 if (!ELayer.debug.enable)
88 {
89 interactableWithAlpha = false;
90 }
91 }
92 buttonUpload.SetInteractableWithAlpha(interactableWithAlpha);
93 }
bool enable
Definition: CoreDebug.cs:285
static CoreDebug debug
Definition: ELayer.cs:43
HashSet< string > invalidIds
UIText textInvalidId
UIButton buttonSave
static char[] InvalidChars
UIText textNextUpload
static int nextUpload
Definition: LayerUploader.cs:9
UIButton buttonUpload
UIText textInvalidPass
void SetInteractableWithAlpha(bool enable)
Definition: UIButton.cs:732
string lang
Definition: UIText.cs:9

References buttonSave, buttonUpload, ELayer.debug, CoreDebug.enable, inputId, inputPassword, InvalidChars, invalidIds, UIText.lang, nextUpload, UIButton.SetInteractableWithAlpha(), textInvalidId, textInvalidPass, textNextUpload, validId, and validPass.

◆ Upload()

void LayerUploader.Upload ( )
inline

Definition at line 120 of file LayerUploader.cs.

121 {
122 if (ini.Global["agreed_usercontents_upload_terms"] != "yes")
123 {
124 string[] items = new string[3] { "readTerms", "agree", "disagree" };
125 Dialog.List("dialogTermsOfUse".lang(), items, (string j) => j, delegate(int c, string d)
126 {
127 switch (c)
128 {
129 case 0:
130 LayerHelp.Toggle("custom", "terms");
131 return false;
132 case 1:
133 ini.Global["agreed_usercontents_upload_terms"] = "yes";
134 Upload();
135 break;
136 }
137 return true;
138 }, canCancel: true);
139 }
140 else
141 {
142 Debug.Log("Uploading map");
143 string text = inputId.text;
144 string text2 = inputPassword.text;
145 SaveID();
146 ExportMap();
148 nextUpload = (int)Time.realtimeSinceStartup + limitSec;
149 }
150 }
string NameBraced
Definition: Chara.cs:499
Definition: Dialog.cs:7
static Chara pc
Definition: ELayer.cs:15
Definition: Lang.cs:6
static string langCode
Definition: Lang.cs:28
static void Toggle(string idFile, string idTopic=null)
Definition: LayerHelp.cs:32
Definition: Net.cs:11
static async UniTask< bool > UploadFile(string id, string password, string name, string title, string path, string idLang)
Definition: Net.cs:97
virtual string Name
Definition: Spatial.cs:495

References ELayer._zone, Debug, ExportMap(), ini, inputId, inputPassword, Lang.langCode, limitSec, Spatial.Name, Chara.NameBraced, nextUpload, ELayer.pc, SaveID(), savePath, LayerHelp.Toggle(), Upload(), and Net.UploadFile().

Referenced by Upload().

Member Data Documentation

◆ buttonSave

UIButton LayerUploader.buttonSave

Definition at line 34 of file LayerUploader.cs.

Referenced by Update().

◆ buttonUpload

UIButton LayerUploader.buttonUpload

Definition at line 32 of file LayerUploader.cs.

Referenced by Update().

◆ ini

IniData LayerUploader.ini

Definition at line 24 of file LayerUploader.cs.

Referenced by OnInit(), SaveID(), and Upload().

◆ inputId

InputField LayerUploader.inputId

Definition at line 18 of file LayerUploader.cs.

Referenced by SaveID(), Update(), and Upload().

◆ inputPassword

InputField LayerUploader.inputPassword

Definition at line 20 of file LayerUploader.cs.

Referenced by SaveID(), Update(), and Upload().

◆ inputWelcome

InputField LayerUploader.inputWelcome

Definition at line 22 of file LayerUploader.cs.

Referenced by OnInit().

◆ InvalidChars

char [] LayerUploader.InvalidChars
static
Initial value:
= new char[21]
{
'*', '&', '|', '#', '\\', '/', '?', '!', '"', '>',
'<', ':', ';', '.', ',', '~', '@', '^', '$', '%',
' '
}

Definition at line 11 of file LayerUploader.cs.

Referenced by Update().

◆ invalidIds

HashSet<string> LayerUploader.invalidIds = new HashSet<string>()

Definition at line 40 of file LayerUploader.cs.

Referenced by Update().

◆ limitSec

int LayerUploader.limitSec

Definition at line 38 of file LayerUploader.cs.

Referenced by Upload().

◆ nextUpload

int LayerUploader.nextUpload
static

Definition at line 9 of file LayerUploader.cs.

Referenced by Update(), and Upload().

◆ textInvalidId

UIText LayerUploader.textInvalidId

Definition at line 26 of file LayerUploader.cs.

Referenced by Update().

◆ textInvalidPass

UIText LayerUploader.textInvalidPass

Definition at line 28 of file LayerUploader.cs.

Referenced by Update().

◆ textNextUpload

UIText LayerUploader.textNextUpload

Definition at line 30 of file LayerUploader.cs.

Referenced by Update().

◆ toggleClearLocalCharas

UIButton LayerUploader.toggleClearLocalCharas

Definition at line 36 of file LayerUploader.cs.

Referenced by OnInit().

◆ validId

bool LayerUploader.validId

Definition at line 43 of file LayerUploader.cs.

Referenced by OnKill(), and Update().

◆ validPass

bool LayerUploader.validPass

Definition at line 46 of file LayerUploader.cs.

Referenced by OnKill(), and Update().

Property Documentation

◆ savePath

string LayerUploader.savePath
getprivate

Definition at line 48 of file LayerUploader.cs.

Referenced by ExportMap(), and Upload().


The documentation for this class was generated from the following file: