1using System.Collections.Generic;
91 protected static Vector3
mpos;
93 public static float[]
GameSpeeds =
new float[4] { 0f, 1f, 2f, 5f };
95 public static List<TCSimpleText>
simpleTexts =
new List<TCSimpleText>();
121 public bool IsActive => EClass.scene.actionMode ==
this;
149 public virtual string id => GetType().Name.Split(
'_')[1];
203 return tileSelector.start !=
null;
328 string[] list =
Lang.
GetList(
"exhint_" + GetType().Name);
331 string[] array = list;
332 foreach (
string text
in array)
339 public void Activate(
bool toggle =
true,
bool forceActivate =
false)
363 EClass.scene.actionMode =
this;
364 if (actionMode !=
null)
376 item.renderer.DespawnSimpleText();
393 EClass.
ui.hud.transRight.SetActive(enable:
false);
398 EClass.
ui.ShowBalloon(enable:
false);
407 EClass.
ui.widgets.OnChangeActionMode();
408 EClass.
ui.extraHint.OnChangeActionMode();
409 CursorSystem.leftIcon =
null;
430 Sprite sprite =
null;
460 if (!simpleText.IsEmpty())
468 if (!Application.isEditor)
475 string text =
"Backer:" + row.id +
"/" + row.
Name;
488 if (!
card.isBackerContent)
495 string text2 =
"Backer:" + row2.id +
"/" + row2.
Name;
498 text2 =
"★" + text2;
521 if (simpleText !=
null)
556 CursorSystem.leftIcon =
null;
572 mpos = Input.mousePosition;
595 if ((
bool)componentOf && componentOf.invOwner !=
null && componentOf.invOwner.owner == EClass.pc && (componentOf.card ==
null || componentOf.card.trait is
TraitAbility) && !(componentOf.
invOwner is
InvOwnerEquip))
597 if (componentOf.
card !=
null)
606 thing.c_idAbility = hotElement.
source.alias;
608 thing.invX = componentOf.
index;
609 WidgetCurrentTool.dirty =
true;
631 if (componentOf2 !=
null)
634 if ((
bool)layerInventory)
636 LayerInventory.highlightInv = layerInventory.
invs[0].owner;
640 if (
EClass.
ui.layerFloat.layers.Contains(componentOf2) && !layerInventory)
642 componentOf2.transform.SetAsLastSibling();
645 if (componentOf3 !=
null &&
EClass.
ui.layerFloat.layers.Contains(componentOf3))
647 componentOf3.transform.SetAsLastSibling();
655 bool rightMouse = !Input.GetMouseButtonDown(1) && Input.GetMouseButton(1);
665 if (componentOf5 !=
null &&
EClass.
ui.layerFloat.layers.Contains(componentOf5) && EInput.rightMouse.down && !componentOf5.mainInv && !
InputModuleEX.GetComponentOf<
UIButton>() && !componentOf5.
windows[0].saveData.noRightClickClose)
667 componentOf5.
Close();
671 EClass.
ui.contextMenu.currentMenu.Hide();
673 Layer.rightClicked =
false;
679 Layer.rightClicked =
false;
696 if ((
bool)
EClass.
ui.contextMenu.currentMenu)
698 UIContextMenu.timeSinceClosed = 0f;
702 UIContextMenu.timeSinceClosed += Time.deltaTime;
725 middleMouse.pressedLongAction =
null;
729 middleMouse.pressedLongAction =
null;
739 if (Input.GetKeyDown(KeyCode.Tab) && !EClass.debug.debugInput && !EClass.ui.BlockInput && !
EInput.
waitReleaseAnyKey)
783 if ((
bool)componentOf7 && componentOf7.card !=
null)
790 if ((
bool)componentOf8 && componentOf8.refObj is
Thing)
798 if ((
bool)layerCraft)
827 bool flag2 = EInput.wheel > 0;
839 SourceMaterial.Row row = (flag2 ? source.NextItem(currentMat) : source.PrevItem(currentMat));
857 Msg.
Say(row.GetName() +
"(" + row.alias +
")");
869 hitPoint.cell.objMat = (byte)row2.
id;
885 if ((
bool)hotbarExtra)
942 if (Input.GetKey(KeyCode.LeftShift))
948 Vector2 zero = Vector2.zero;
953 if (
mpos.x > (
float)(Screen.width - 16))
961 if (
mpos.y > (
float)(Screen.height - 8))
965 if (zero != Vector2.zero)
967 axis += zero * (EClass.core.config.camera.sensEdge * 2f);
970 EInput.hasAxisMoved = axis != Vector2.zero;
990 EInput.hasAxisMoved =
true;
995 EClass.screen.zoomPos = Vector3.zero;
1003 if (momentum > 0f &&
EInput.
axis == Vector2.zero)
1005 smoothX = Mathf.Lerp(
smoothX, num, Time.smoothDeltaTime * momentum);
1006 smoothY = Mathf.Lerp(
smoothY, num2, Time.smoothDeltaTime * momentum);
1076 return input.middleClick == func;
1080 return input.middlePressLong == func;
1084 return input.mouse3Click == func;
1088 return input.mouse3PressLong == func;
1092 return input.mouse4Click == func;
1096 return input.mouse4PressLong == func;
1121 else if (targetChara !=
null &&
EClass.
pc.
Dist(targetChara) <= 1)
1127 EInput.action =
EAction.EmptyHand;
1140 EClass.
ui.widgets.Toggle(
"Search")?.SoundActivate();
1159 Msg.
Say(
"invalidAction");
1167 if ((
bool)layerJournal)
1170 layerJournal.
Delay();
1175 EClass.
ui.ToggleInventory(delay:
true);
1180 if ((
bool)layerChara)
1189 EClass.
ui.ToggleAbility(delay:
true);
1213 componentOf.
Close();
1224 componentOf.
Close();
1277 int num = (int)result;
1287 guidePass.
Add(vector.x, vector.y, vector.z - 0.01f, num, 0.3f);
1304 int num = (int)result;
1314 guidePass.
Add(vector.x, vector.y, vector.z - 0.01f, num, 0.3f);
1394 text = ((actionMode ==
Inspect && Inspect.target !=
null) ?
"hintMoveTarget".lang() : ((
selectType ==
BaseTileSelector.
SelectType.Single) ? (text +
"hintSelectSingle".lang()) : ((baseTileSelector.
start !=
null) ? (text +
"hintSelectEnd".lang()) : (text +
"hintSelectStart".lang()))));
1398 if (actionMode ==
Build)
1400 text +=
"hintBuild".lang();
1404 text +=
"hintCreateArea".lang();
1411 text = text +
" " +
"hintRotate".lang();
1415 text = text +
" " +
"hintAltitude2".lang();
1435 (hitPoint.Installed.trait as
TraitSeed).TrySprout(force:
true);
1485 SE.Play(
"tick" + a);
1487 EClass.game.gameSpeedIndex = a;
1490 EClass.game.lastGameSpeedIndex = a;
static AM_Inspect Inspect
virtual MeshPass GetGuidePass(Point point)
virtual bool AllowBuildModeShortcuts
virtual void InputWheel(int wheel)
static AM_RemoveDesignation RemoveDesignation
virtual void OnBeforeProcessTiles()
virtual bool IsRoofEditMode(Card c=null)
virtual bool HighlightWall(Point p)
static float hotElementTimer
virtual int SubMenuModeIndex
void ChangeGameSpeed(int a, bool sound=false)
virtual void OnBeforeUpdate()
virtual bool AllowAutoClick
virtual int SelectorHeight
void OnRenderTileFloor(Point point, HitResult result)
virtual void OnRefreshSummary(Point point, HitResult result, HitSummary summary)
virtual BaseTileSelector.SelectType selectType
virtual void OnUpdateInput()
static AM_Harvest Harvest
virtual void OnFinishProcessTiles()
virtual void OnActivate()
virtual void OnSelectEnd(bool cancel)
static float[] GameSpeeds
virtual string textHintTitle
void UnPause(bool sound=false)
static AM_ADV_Target AdvTarget
virtual bool AllowGeneralInput
virtual bool ShowExtraHint
virtual void OnDeactivate()
virtual string idHelpTopic
HitResult _HitTest(Point point, Point start)
void DoFunc(CoreConfig.GameFunc func)
static AM_StateEditor StateEditor
virtual bool ShouldPauseGame
static AM_ViewMap ViewMap
static AM_ExpandArea ExpandArea
static ActionMode DefaultMode
virtual bool ShowMouseoverTarget
virtual AreaHighlightMode AreaHihlight
virtual BaseGameScreen TargetGameScreen
static AM_NewZone NewZone
static AM_EditArea EditArea
static AM_MiniGame MiniGame
virtual void OnUpdateCursor()
virtual bool ShowBuildWidgets
void Pause(bool sound=false)
virtual void OnSelectStart(Point point)
static AM_Populate Populate
virtual bool AllowMiddleClickFunc
virtual void SEExecuteSummary()
virtual Layer OnShowLayer()
virtual string OnSetSubMenuButton(int a, UIButton b)
virtual void OnClickSubMenu(int a)
virtual void OnAfterProcessTiles(Point start, Point end)
virtual bool CanSelectTile
void Activate(bool toggle=true, bool forceActivate=false)
virtual BuildMenu.Mode buildMenuMode
void SetCursorOnMap(CursorInfo cursor)
virtual BaseTileMap.CardIconMode cardIconMode
static AM_Blueprint Blueprint
virtual bool AllowWheelZoom
virtual bool ShowMaskedThings
static List< TCSimpleText > simpleTexts
virtual ref string SetMouseInfo(ref string s)
virtual bool ShowActionHint
virtual bool CanProcessTiles()
void DoFunc(CoreConfig.GameFuncBuild func)
virtual bool ShouldHideBuildMenu
static AM_FlagCell FlagCell
virtual BaseTileSelector.BoxType boxType
virtual bool CanTargetOutsideBounds
virtual int GetDefaultTile(Point p)
virtual bool HideSubWidgets
static AM_Visibility Visibility
virtual string GetSimpleText(Card c)
static AM_Terrain Terrain
virtual HitResult HitTest(Point point, Point start)
static SourceMaterial.Row lastEditorMat
static AM_Deconstruct Deconstruct
virtual bool UseSubMenuSlider
virtual string GetHintText()
virtual void OnAfterUpdate()
bool IsFuncPressed(CoreConfig.GameFunc func)
static AM_Adv AdvOrRegion
BaseTileSelector tileSelector
virtual CursorInfo DefaultCursor
virtual void RotateUnderMouse()
static void OnGameInstantiated()
static ActionMode LastBuildMode
void TryRightClickCloseWidget()
virtual bool SubMenuAsGroup
virtual void OnHideLayer()
virtual bool ContinuousClick
virtual BaseTileSelector.HitType hitType
virtual bool CanTargetFog
virtual bool enableMouseInfo
static AM_EditMarker EditMarker
virtual void OnShowExtraHint(UINote n)
static AM_CreateArea CreateArea
virtual void OnRenderTile(Point point, HitResult result, int dir)
virtual bool IsFillMode()
virtual int TopHeight(Point p)
virtual void OnProcessTiles(Point point, int dir)
void ModTargetZoomIndex(int a)
void ScrollAxis(Vector3 axis, bool direct=false)
void ScrollMouse(float x, float y)
BaseTileSelector tileSelector
void OnChangeActionMode()
static void SetNormalRarity(bool fixedMat=false)
SourceMaterial.Row DyeMat
SourceMaterial.Row material
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Thing AddThing(string id, int lv=-1)
SourceMaterial.Row matObj
override bool IsPCFaction
static void SetCursor(CursorInfo info=null, int _priority=0)
static DropdownGrid Instance
static ColorProfile Colors
static SourceManager sources
static BaseGameScreen screen
static SoundManager Sound
static GameSetting setting
static TaskBuild taskBuild
virtual void OnShiftClick(ButtonGrid b, bool rightMouse=false)
virtual bool CanShiftClick(ButtonGrid b, bool rightMouse=false)
static string Get(string id)
static string[] GetList(string id)
static ButtonAbility hotElement
static void ClearHotElement()
LayerChara SetChara(Chara c)
static LayerDrama Instance
static LayerInventory CreateContainer(Card owner)
static LayerInventory GetLayer(Card t)
static void Close(Thing t)
void Delay(float duration=0.05f)
IEnumerable< Card > Cards
Dictionary< int, int > backerObjs
void Add(Point point, float tile=0f, float color=0f)
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
void SetCurrentHotItem(HotItem item)
SourceBlock.Row sourceBlock
ref Vector3 Position(int height)
ref Vector3 PositionTopdown()
bool Equals(int _x, int _z)
static void Despawn(Component c)
Popper SetText(string s, Color c=default(Color))
void DrawWall(Point point, int color, bool useMarkerPass=false, float offsetZ=0f)
static TCSimpleText SpawnIcon(Sprite sprite=null)
static TCSimpleText Spawn()
static Thing Create(string id, int idMat=-1, int lv=-1)
virtual void OnRenderTile(Point point, HitResult result, int dir)
UIItem AddText(string text, FontColor color=FontColor.DontChange)
bool CanEnterBuildModeAnywhere