private Color GetColor(MapDrawMode mapDrawMode, Race race) { switch (mapDrawMode) { case MapDrawMode.Normal: return(color); case MapDrawMode.Height: return(heightColor); case MapDrawMode.Temperature: return(tempColor); case MapDrawMode.Humidity: return(humidityColor); case MapDrawMode.Region: return(region.color); case MapDrawMode.Race: return(Color.Lerp(LowColor, HighColor, GetRaceCompatibility(race))); case MapDrawMode.Town: return(Color.Lerp(LowColor, HighColor, GetTownCompatibility(race))); default: throw new ArgumentOutOfRangeException(nameof(mapDrawMode), mapDrawMode, null); } }
private void cbLevel_SelectedIndexChanged(object sender, EventArgs e) { if (!UtilsGui.askToSave(ref dirty, saveToFile, returnCbLevelIndex)) { return; } if (cbLayoutNo.SelectedIndex == -1) { return; } curActiveLayout = cbLayoutNo.SelectedIndex; curWidth = ConfigScript.getLevelWidth(curActiveLayout); curHeight = ConfigScript.getLevelHeight(curActiveLayout); drawMode = MapDrawMode.Screens; curActiveBlock = 0; activeBlock.Image = screenImages.Images[0]; updatePanelsVisibility(); cbLayoutNo.Items.Clear(); foreach (var lr in ConfigScript.getLevelRecs()) { cbLayoutNo.Items.Add(String.Format("0x{0:X} ({1}x{2})", lr.layoutAddr, lr.width, lr.height)); } UtilsGui.setCbIndexWithoutUpdateLevel(cbLayoutNo, cbLevel_SelectedIndexChanged, curActiveLayout); reloadLevelLayer(); }
private void buttonBlockClick(Object button, EventArgs e) { int index = ((Button)button).ImageIndex; activeBlock.Image = screenImages.Images[index]; curActiveBlock = index; drawMode = MapDrawMode.Screens; }
public void OnDrawModeChanged() { MapDrawMode mapDrawMode = (MapDrawMode)mapDrawModeDropdown.value; mapDisplay.drawMode = mapDrawMode; mapDisplay.DrawTexture(); }
private void buttonDoorClick(Object button, EventArgs e) { int index = ((Button)button).ImageIndex; activeBlock.Image = doorSprites.Images[index]; curActiveBlock = index; drawMode = MapDrawMode.Doors; }
private void buttonScrollClick(Object button, EventArgs e) { int index = ((Button)button).ImageIndex; activeBlock.Image = scrollSprites.Images[index]; curActiveBlock = index; drawMode = MapDrawMode.Scrolls; }
public Texture2D GetTexture(MapDrawMode mapDrawMode) { for (int x = 0; x < size; x++) { for (int y = 0; y < size; y++) { colors[x + size * y] = GetTile(x, y).GetColor(mapDrawMode); } } texture.SetPixels(colors); texture.Apply(); return(texture); }
public Color GetColor(MapDrawMode mapDrawMode) { switch (mapDrawMode) { case MapDrawMode.Normal: return(customColor != Color.clear ? customColor : color); case MapDrawMode.Height: return(heightColor); case MapDrawMode.Temperature: return(tempColor); case MapDrawMode.Humidity: return(humidityColor); case MapDrawMode.Region: return(IsWater ? color : region.color); default: throw new ArgumentOutOfRangeException(nameof(mapDrawMode), mapDrawMode, null); } }
private void buttonDoorClick(Object button, EventArgs e) { int index = ((Button)button).ImageIndex; activeBlock.Image = doorSprites.Images[index]; curActiveBlock = index; drawMode = MapDrawMode.Doors; }
private void cbLevel_SelectedIndexChanged(object sender, EventArgs e) { if (!Utils.askToSave(ref dirty, saveToFile, returnCbLevelIndex)) return; if (cbLayoutNo.SelectedIndex == -1) return; curActiveLayout = cbLayoutNo.SelectedIndex; curWidth = ConfigScript.getLevelWidth(curActiveLayout); curHeight = ConfigScript.getLevelHeight(curActiveLayout); drawMode = MapDrawMode.Screens; curActiveBlock = 0; activeBlock.Image = screenImages.Images[0]; updatePanelsVisibility(); cbLayoutNo.Items.Clear(); foreach (var lr in ConfigScript.levelRecs) cbLayoutNo.Items.Add(String.Format("0x{0:X} ({1}x{2})", lr.layoutAddr, lr.width, lr.height)); Utils.setCbIndexWithoutUpdateLevel(cbLayoutNo, cbLevel_SelectedIndexChanged, curActiveLayout); reloadLevelLayer(); }
public void OnDrawModeChanged(int value) { DrawMode = value < mapDrawModesCount ? (MapDrawMode)value : 0; mapDisplay.DrawTexture(); }
public Color GetColor(MapDrawMode mapDrawMode, float transparency, [CanBeNull] Race race) => IsWater || mapDrawMode == MapDrawMode.Normal ? GetColor(MapDrawMode.Normal, race) : Color.Lerp(GetColor(MapDrawMode.Normal, race), GetColor(mapDrawMode, race), transparency);