// UpdateValue updates the value associated with a specific key-phrase in a specified language public void UpdateValue(string language, string key, string value) { DictionaryStringString langDict = langCollection[language]; langDict[key] = value; langCollection[language] = langDict; Debug.Log("updated keyPhrase " + key + " to value " + value + " in lang " + language); }
// GetValue returns the value associated with the key-phrase provided in the // dictionary for the currently selected language public string GetValue(string keyPhrase) { if (langCollection.ContainsKey(currentLang)) { DictionaryStringString dict = langCollection[currentLang]; if (dict.ContainsKey(keyPhrase)) { return(dict[keyPhrase]); } } return(""); }
public override void Get(string table, int index, DictionaryStringString items) { if (table == "nodes") { Node k = m.nodes[index]; items.Set("name", k.name); items.Set("paren", k.parentName); items.Set("x", p.FloatToString(k.posx)); items.Set("y", p.FloatToString(k.posy)); items.Set("z", p.FloatToString(k.posz)); items.Set("rotx", p.FloatToString(k.rotatex)); items.Set("roty", p.FloatToString(k.rotatey)); items.Set("rotz", p.FloatToString(k.rotatez)); items.Set("sizex", p.FloatToString(k.sizex)); items.Set("sizey", p.FloatToString(k.sizey)); items.Set("sizez", p.FloatToString(k.sizez)); items.Set("u", p.FloatToString(k.u)); items.Set("v", p.FloatToString(k.v)); items.Set("pivx", p.FloatToString(k.pivotx)); items.Set("pivy", p.FloatToString(k.pivoty)); items.Set("pivz", p.FloatToString(k.pivotz)); items.Set("scalx", p.FloatToString(k.scalex)); items.Set("scaly", p.FloatToString(k.scaley)); items.Set("scalz", p.FloatToString(k.scalez)); items.Set("head", p.FloatToString(k.head)); } if (table == "keyframes") { Keyframe k = m.keyframes[index]; items.Set("anim", k.animationName); items.Set("node", k.nodeName); items.Set("frame", p.FloatToString(k.frame)); items.Set("type", KeyframeType.GetName(k.frame)); items.Set("x", p.FloatToString(k.x)); items.Set("y", p.FloatToString(k.y)); items.Set("z", p.FloatToString(k.z)); } if (table == "animations") { Animation k = m.animations[index]; items.Set("name", k.name); items.Set("len", p.FloatToString(k.length)); } if (table == "global") { AnimationGlobal global = m.global; items.Set("texw", p.FloatToString(global.texw)); items.Set("texh", p.FloatToString(global.texh)); } }
// AddNewLang adds a new <language, dictionary<key-phrase, value>> to the langCollection, // and initializes the <key-phrase,value> dictionary with the key-set of the other languages and an empty string value, // else if there are no other languages, initializes an empty dictionary public void AddNewLang(string newLang) { if (!langs.Contains(newLang)) { langs.Add(newLang); DictionaryStringString dict = new DictionaryStringString(); foreach (string key in keyPhrases) { dict.Add(key, ""); } langCollection.Add(newLang, dict); Debug.Log("added language " + newLang); Debug.Log("now list of languages is"); foreach (string lang in langCollection.Keys) { Debug.Log(lang); } } }
// AddNewKey iterates through the languages and adds the specified key // to each languages <key-phrase,value> dictionary public void AddNewKey(string key) { if (!keyPhrases.Contains(key)) { keyPhrases.Add(key); foreach (string lang in langs) { Debug.Log("adding key " + key + " to lang " + lang); DictionaryStringString dict = langCollection[lang]; dict.Add(key, ""); langCollection[lang] = dict; } Debug.Log("added new key: " + key); raiseKeyUpdate(); } else { Debug.Log("key already exists: " + key); } }
public Preferences() { items = new DictionaryStringString(); }
public void SetGet(DictionaryStringString value_) { get = value_; }
public Game() { one = 1; map = new Map(); performanceinfo = new DictionaryStringString(); AudioEnabled = true; AutoJumpEnabled = false; playerPositionSpawnX = 15 + one / 2; playerPositionSpawnY = 64; playerPositionSpawnZ = 15 + one / 2; TextureId = new int[MaxBlockTypes][]; for (int i = 0; i < MaxBlockTypes; i++) { TextureId[i] = new int[6]; } TextureIdForInventory = new int[MaxBlockTypes]; language = new Language(); lastplacedblockX = -1; lastplacedblockY = -1; lastplacedblockZ = -1; mLightLevels = new float[16]; sunlight_ = 15; mvMatrix = new StackMatrix4(); pMatrix = new StackMatrix4(); mvMatrix.Push(Mat4.Create()); pMatrix.Push(Mat4.Create()); whitetexture = -1; cachedTextTexturesMax = 1024; cachedTextTextures = new CachedTextTexture[cachedTextTexturesMax]; for (int i = 0; i < cachedTextTexturesMax; i++) { cachedTextTextures[i] = null; } packetLen = new IntRef(); ENABLE_DRAW2D = true; AllowFreemove = true; enableCameraControl = true; textures = new DictionaryStringInt1024(); ServerInfo = new ServerInformation(); menustate = new MenuState(); mouseleftclick = false; mouseleftdeclick = false; wasmouseleft = false; mouserightclick = false; mouserightdeclick = false; wasmouseright = false; ENABLE_LAG = 0; znear = one / 10; CameraMatrix = new GetCameraMatrix(); ENABLE_ZFAR = true; TotalAmmo = new int[GlobalVar.MAX_BLOCKTYPES]; LoadedAmmo = new int[GlobalVar.MAX_BLOCKTYPES]; AllowedFontsCount = 1; AllowedFonts = new string[AllowedFontsCount]; AllowedFonts[0] = "Verdana"; fov = Game.GetPi() / 3; cameratype = CameraType.Fpp; ENABLE_TPP_VIEW = false; basemovespeed = 5; movespeed = 5; RadiusWhenMoving = one * 3 / 10; playervelocity = new Vector3Ref(); LocalPlayerId = -1; dialogs = new VisibleDialog[512]; dialogsCount = 512; blockHealth = new DictionaryVector3Float(); playertexturedefault = -1; a = new AnimationState(); constRotationSpeed = one * 180 / 20; modmanager = new ClientModManager1(); particleEffectBlockBreak = new ModDrawParticleEffectBlockBreak(); PICK_DISTANCE = 4.1f; selectedmodelid = -1; grenadetime = 3; rotationspeed = one * 15 / 100; entities = new Entity[entitiesMax]; for (int i = 0; i < entitiesMax; i++) { entities[i] = null; } entitiesCount = 512; PlayerPushDistance = 2; const int KeysMax = 256; keyboardState = new bool[KeysMax]; for (int i = 0; i < KeysMax; i++) { keyboardState[i] = false; } keyboardStateRaw = new bool[KeysMax]; for (int i = 0; i < KeysMax; i++) { keyboardStateRaw[i] = false; } overheadcameradistance = 10; tppcameradistance = 3; TPP_CAMERA_DISTANCE_MIN = 1; TPP_CAMERA_DISTANCE_MAX = 10; options = new OptionsCi(); overheadcameraK = new Kamera(); fillAreaLimit = 200; speculativeCount = 0; speculative = new Speculative[speculativeMax]; typinglog = new string[1024 * 16]; typinglogCount = 0; NewBlockTypes = new Packet_BlockType[GlobalVar.MAX_BLOCKTYPES]; localplayeranim = new AnimationState(); localplayeranimationhint = new AnimationHint(); enable_move = true; handTexture = -1; modelViewInverted = new float[16]; GLScaleTempVec3 = Vec3.Create(); GLRotateTempVec3 = Vec3.Create(); GLTranslateTempVec3 = Vec3.Create(); identityMatrix = Mat4.Identity_(Mat4.Create()); Set3dProjectionTempMat4 = Mat4.Create(); getAsset = new string[1024 * 2]; PlayerStats = new Packet_ServerPlayerStats(); mLightLevels = new float[16]; for (int i = 0; i < 16; i++) { mLightLevels[i] = one * i / 15; } soundnow = new BoolRef(); camera = Mat4.Create(); packetHandlers = new ClientPacketHandler[256]; player = new Entity(); player.position = new EntityPosition_(); currentlyAttackedEntity = -1; ChatLinesMax = 1; ChatLines = new Chatline[ChatLinesMax]; ChatLineLength = 64; audio = new AudioControl(); CameraEyeX = -1; CameraEyeY = -1; CameraEyeZ = -1; controls = new Controls(); movedz = 0; taskScheduler = new TaskScheduler(); commitActions = ListAction.Create(16 * 1024); constWallDistance = 0.3f; mouseSmoothing = true; }
public abstract void Get(string table, int index, DictionaryStringString items);